Class: OpenAI::Models::Chat::ChatCompletionAllowedTools

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/chat/chat_completion_allowed_tools.rb

Defined Under Namespace

Modules: Mode

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

#initialize(mode:, tools:) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Chat::ChatCompletionAllowedTools for more details.

Constrains the tools available to the model to a pre-defined set.

Parameters:



# File 'lib/openai/models/chat/chat_completion_allowed_tools.rb', line 34

Instance Attribute Details

#modeSymbol, 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 }

#toolsArray<Hash{Symbol=>Object}>

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:

“‘json [

{ "type": "function", "function": { "name": "get_weather" } },
{ "type": "function", "function": { "name": "get_time" } }

] “‘

Returns:

  • (Array<Hash{Symbol=>Object}>)


31
32
# 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]]