Share via


ToolChoiceAllowed interface

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

Extends

Properties

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.

tools

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:

[
  { "type": "function", "name": "get_weather" },
  { "type": "mcp", "server_label": "deepwiki" },
  { "type": "image_generation" }
]
type

Allowed tool configuration type. Always allowed_tools.

Property Details

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.

mode: "auto" | "required"

Property Value

"auto" | "required"

tools

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:

[
  { "type": "function", "name": "get_weather" },
  { "type": "mcp", "server_label": "deepwiki" },
  { "type": "image_generation" }
]
tools: Record<string, unknown>[]

Property Value

Record<string, unknown>[]

type

Allowed tool configuration type. Always allowed_tools.

type: "allowed_tools"

Property Value

"allowed_tools"