Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Tool choice configuration

Supported Types

models.ChatToolChoiceNone

const value: models.ChatToolChoiceNone = "none";

models.ChatToolChoiceAuto

const value: models.ChatToolChoiceAuto = "auto";

models.ChatToolChoiceRequired

const value: models.ChatToolChoiceRequired = "required";

models.ChatNamedToolChoice

const value: models.ChatNamedToolChoice = {
  function: {
    name: "get_weather",
  },
  type: "function",
};

models.ChatServerToolChoice

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