Class: OpenAI::Models::Responses::ToolChoiceAllowed
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Responses::ToolChoiceAllowed
- Defined in:
- lib/openai/models/responses/tool_choice_allowed.rb
Defined Under Namespace
Modules: Mode
Instance Attribute Summary collapse
-
#mode ⇒ Symbol, OpenAI::Models::Responses::ToolChoiceAllowed::Mode
Constrains the tools available to the model to a pre-defined set.
-
#tools ⇒ Array<Hash{Symbol=>Object}>
A list of tool definitions that the model should be allowed to call.
-
#type ⇒ Symbol, :allowed_tools
Allowed tool configuration type.
Instance Method Summary collapse
-
#initialize(mode:, tools:, type: :allowed_tools) ⇒ Object
constructor
Some parameter documentations has been truncated, see ToolChoiceAllowed 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, 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(mode:, tools:, type: :allowed_tools) ⇒ Object
Some parameter documentations has been truncated, see OpenAI::Models::Responses::ToolChoiceAllowed for more details.
Constrains the tools available to the model to a pre-defined set.
|
|
# File 'lib/openai/models/responses/tool_choice_allowed.rb', line 41
|
Instance Attribute Details
#mode ⇒ Symbol, OpenAI::Models::Responses::ToolChoiceAllowed::Mode
Constrains the tools available to the model to a pre-defined set.
‘auto` allows the model to pick from among the allowed tools and generate a message.
‘required` requires the model to call one or more of the allowed tools.
16 |
# File 'lib/openai/models/responses/tool_choice_allowed.rb', line 16 required :mode, enum: -> { OpenAI::Responses::ToolChoiceAllowed::Mode } |
#tools ⇒ Array<Hash{Symbol=>Object}>
A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
“‘json [
{ "type": "function", "name": "get_weather" },
{ "type": "mcp", "server_label": "deepwiki" },
{ "type": "image_generation" }
] “‘
32 33 |
# File 'lib/openai/models/responses/tool_choice_allowed.rb', line 32 required :tools, OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown]] |
#type ⇒ Symbol, :allowed_tools
Allowed tool configuration type. Always ‘allowed_tools`.
39 |
# File 'lib/openai/models/responses/tool_choice_allowed.rb', line 39 required :type, const: :allowed_tools |