ChatToolChoice - TypeScript SDK

ChatToolChoice type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Tool choice configuration

Supported Types

models.ChatToolChoiceNone

1const value: models.ChatToolChoiceNone = "none";

models.ChatToolChoiceAuto

1const value: models.ChatToolChoiceAuto = "auto";

models.ChatToolChoiceRequired

1const value: models.ChatToolChoiceRequired = "required";

models.ChatNamedToolChoice

1const value: models.ChatNamedToolChoice = {
2 function: {
3 name: "get_weather",
4 },
5 type: "function",
6};

models.ChatServerToolChoice

1const value: models.ChatServerToolChoice = {
2 type: "openrouter:web_search",
3};