Class: OpenAI::Models::Responses::FunctionTool
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Responses::FunctionTool
- Defined in:
- lib/openai/models/responses/function_tool.rb
Instance Attribute Summary collapse
-
#description ⇒ String?
A description of the function.
-
#name ⇒ String
The name of the function to call.
-
#parameters ⇒ Hash{Symbol=>Object}?
A JSON schema object describing the parameters of the function.
-
#strict ⇒ Boolean?
Whether to enforce strict parameter validation.
-
#type ⇒ Symbol, :function
The type of the function tool.
Instance Method Summary collapse
-
#initialize(name: , parameters: , strict: , description: nil, type: :function) ⇒ Object
constructor
Some parameter documentations has been truncated, see FunctionTool for more details.
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, 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: , parameters: , strict: , description: nil, type: :function) ⇒ Object
Some parameter documentations has been truncated, see OpenAI::Models::Responses::FunctionTool for more details.
Defines a function in your own code the model can choose to call. Learn more about [function calling](platform.openai.com/docs/guides/function-calling).
|
# File 'lib/openai/models/responses/function_tool.rb', line 43
|
Instance Attribute Details
#description ⇒ String?
A description of the function. Used by the model to determine whether or not to call the function.
41 |
# File 'lib/openai/models/responses/function_tool.rb', line 41 optional :description, String, nil?: true |
#name ⇒ String
The name of the function to call.
11 |
# File 'lib/openai/models/responses/function_tool.rb', line 11 required :name, String |
#parameters ⇒ Hash{Symbol=>Object}?
A JSON schema object describing the parameters of the function.
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 |
#strict ⇒ Boolean?
Whether to enforce strict parameter validation. Default ‘true`.
28 |
# File 'lib/openai/models/responses/function_tool.rb', line 28 required :strict, OpenAI::Internal::Type::Boolean, nil?: true |
#type ⇒ Symbol, :function
The type of the function tool. Always ‘function`.
34 |
# File 'lib/openai/models/responses/function_tool.rb', line 34 required :type, const: :function |