Skip to content

ToolChoice

type ToolChoice =
| {
auto: Record<string, never>;
}
| {
any: Record<string, never>;
}
| {
tool: {
name: string;
};
};

Defined in: src/tools/types.ts:62

Specifies how the model should choose which tool to use.

  • { auto: {} } - Let the model decide whether to use a tool
  • { any: {} } - Force the model to use one of the available tools
  • { tool: { name: 'name' } } - Force the model to use a specific tool