Class: OpenAI::Models::Live::FunctionTool

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/live/function_tool.rb,
sig/openai/models/live/function_tool.rbs

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(name:, description: nil, parameters: nil, strict: nil, type: :function) ⇒ Object

A function tool available to the Responses backend when the Live model delegates a task.

Parameters:

  • name (String)

    The name the delegated Responses model uses when calling this function.

  • description (String, nil) (defaults to: nil)

    What the function does and when the delegated Responses model should call it.

  • parameters (Hash{Symbol=>Object}, nil) (defaults to: nil)

    A JSON Schema object describing the arguments accepted by the function.

  • strict (Boolean, nil) (defaults to: nil)

    Whether the delegated Responses model must follow the function’s parameter schema exactly.

  • type (Symbol, :function) (defaults to: :function)

    The tool type. Always function.



# File 'lib/openai/models/live/function_tool.rb', line 38

Instance Attribute Details

#descriptionString?

What the function does and when the delegated Responses model should call it.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


23
# File 'lib/openai/models/live/function_tool.rb', line 23

optional :description, String, nil?: true

#nameString

The name the delegated Responses model uses when calling this function.

Parameters:

  • value (String)

Returns:

  • (String)


11
# File 'lib/openai/models/live/function_tool.rb', line 11

required :name, String

#parametersHash{Symbol=>Object}?

A JSON Schema object describing the arguments accepted by the function.

Parameters:

  • value (::Hash[Symbol, top], nil)

Returns:

  • (Hash{Symbol=>Object}, nil)


29
# File 'lib/openai/models/live/function_tool.rb', line 29

optional :parameters, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown], nil?: true

#strictBoolean?

Whether the delegated Responses model must follow the function’s parameter schema exactly.

Parameters:

Returns:



36
# File 'lib/openai/models/live/function_tool.rb', line 36

optional :strict, OpenAI::Internal::Type::Boolean, nil?: true

#typeSymbol, :function

The tool type. Always function.

Parameters:

  • value (:function)

Returns:

  • (Symbol, :function)


17
# File 'lib/openai/models/live/function_tool.rb', line 17

required :type, const: :function

Instance Method Details

#to_hash{

Returns:

  • ({)


32
# File 'sig/openai/models/live/function_tool.rbs', line 32

def to_hash: -> {