Class: OpenAI::Models::Responses::FunctionTool

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

Defined Under Namespace

Modules: AllowedCaller

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #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

#initializeObject



35
# File 'sig/openai/models/responses/function_tool.rbs', line 35

def initialize: (

Instance Attribute Details

#allowed_callersArray<Symbol, OpenAI::Models::Responses::FunctionTool::AllowedCaller>?

The tool invocation context(s).

Parameters:

  • value (::Array[OpenAI::Models::Responses::FunctionTool::allowed_caller], nil)

Returns:



40
41
42
# File 'lib/openai/models/responses/function_tool.rb', line 40

optional :allowed_callers,
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Responses::FunctionTool::AllowedCaller] },
nil?: true

#defer_loadingBoolean?

Whether this function is deferred and loaded via tool search.

Parameters:

Returns:



48
# File 'lib/openai/models/responses/function_tool.rb', line 48

optional :defer_loading, OpenAI::Internal::Type::Boolean

#descriptionString?

A description of the function. Used by the model to determine whether or not to call the function.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


55
# File 'lib/openai/models/responses/function_tool.rb', line 55

optional :description, String, nil?: true

#nameString

The name of the function to call.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :name, String

#output_schemaHash{Symbol=>Object}?

A JSON schema object describing the JSON value encoded in string outputs for this function.

Parameters:

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

Returns:

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


62
# File 'lib/openai/models/responses/function_tool.rb', line 62

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

#parametersHash{Symbol=>Object}?

A JSON schema object describing the parameters of the function.

Parameters:

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

Returns:

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


17
18
19
20
21
22
# File 'lib/openai/models/responses/function_tool.rb', line 17

required :parameters,
union: OpenAI::UnionOf[
  OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown],
  OpenAI::StructuredOutput::JsonSchemaConverter
],
nil?: true

#strictBoolean?

Whether strict parameter validation is enforced for this function tool.

Parameters:

Returns:



28
# File 'lib/openai/models/responses/function_tool.rb', line 28

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

#typeSymbol, :function

The type of the function tool. Always function.

Parameters:

  • value (:function)

Returns:

  • (Symbol, :function)


34
# File 'lib/openai/models/responses/function_tool.rb', line 34

required :type, const: :function

Instance Method Details

#to_hash{

Returns:

  • ({)


46
# File 'sig/openai/models/responses/function_tool.rbs', line 46

def to_hash: -> {