Current section
Files
Jump to
Current section
Files
lib/ex_openai/generated/components/tool_choice_allowed.ex
defmodule ExOpenAI.Components.ToolChoiceAllowed do
use ExOpenAI.Jason
@moduledoc """
Constrains the tools available to the model to a pre-defined set.
## Fields
* `:mode` - **required** - `:auto | :required`
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.
Allowed values: `"auto"`, `"required"`
* `:tools` - **required** - `[map()]`
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" }
]
```
* `:type` - **required** - `:allowed_tools`
Allowed tool configuration type. Always `allowed_tools`.
Allowed values: `"allowed_tools"`
"""
@type t() :: %{
__struct__: __MODULE__,
mode: :auto | :required,
tools: list(map()),
type: :allowed_tools
}
defstruct [:mode, :tools, :type]
end