Class: OpenAI::Models::Chat::ChatCompletionAllowedTools
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Chat::ChatCompletionAllowedTools
- Defined in:
- lib/openai/models/chat/chat_completion_allowed_tools.rb,
sig/openai/models/chat/chat_completion_allowed_tools.rbs
Defined Under Namespace
Modules: Mode
Instance Attribute Summary collapse
-
#mode ⇒ OpenAI::Models::Chat::ChatCompletionAllowedTools::mode
Constrains the tools available to the model to a pre-defined set.
-
#tools ⇒ ::Array[::Hash[Symbol, top]]
A list of tool definitions that the model should be allowed to call.
Attributes inherited from Internal::Type::BaseModel
Instance Method Summary collapse
-
#initialize(mode:, tools:) ⇒ ChatCompletionAllowedTools
constructor
A new instance of ChatCompletionAllowedTools.
- #to_hash ⇒ { mode: OpenAI::Models::Chat::ChatCompletionAllowedTools::mode, tools: ::Array[::Hash[Symbol, top]] }
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_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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:) ⇒ ChatCompletionAllowedTools
Returns a new instance of ChatCompletionAllowedTools.
|
|
# File 'lib/openai/models/chat/chat_completion_allowed_tools.rb', line 36
|
Instance Attribute Details
#mode ⇒ OpenAI::Models::Chat::ChatCompletionAllowedTools::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/chat/chat_completion_allowed_tools.rb', line 16 required :mode, enum: -> { OpenAI::Chat::ChatCompletionAllowedTools::Mode } |
#tools ⇒ ::Array[::Hash[Symbol, top]]
A list of tool definitions that the model should be allowed to call.
For the Chat Completions API, the list of tool definitions might look like:
[
{ "type": "function", "function": { "name": "get_weather" } },
{ "type": "function", "function": { "name": "get_time" } }
]
31 32 33 34 |
# File 'lib/openai/models/chat/chat_completion_allowed_tools.rb', line 31 required( :tools, OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown]] ) |
Instance Method Details
#to_hash ⇒ { mode: OpenAI::Models::Chat::ChatCompletionAllowedTools::mode, tools: ::Array[::Hash[Symbol, top]] }
54 55 56 57 |
# File 'sig/openai/models/chat/chat_completion_allowed_tools.rbs', line 54
def to_hash: -> {
mode: OpenAI::Models::Chat::ChatCompletionAllowedTools::mode,
tools: ::Array[::Hash[Symbol, top]]
}
|