class

OpenAI::ChatCompletionAllowedTools

Inherits JSON::Serializable < Reference < Object

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

Constructors

new(mode : ChatCompletionAllowedToolsMode = ChatCompletionAllowedToolsMode::Auto, tools : Array(Hash(String, JSON::Any)) = [] of Hash(String, JSON::Any))
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

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.

Source
mode=(mode : ChatCompletionAllowedToolsMode)

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.

Source
tools

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" } } ] '''

Source
tools=(tools : Array(Hash(String, JSON::Any)))

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" } } ] '''

Source