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

Supported Types

models.ChatFormatGrammarConfig

const value: models.ChatFormatGrammarConfig = {
  grammar: "root ::= \"yes\" | \"no\"",
  type: "grammar",
};

models.FormatJsonObjectConfig

const value: models.FormatJsonObjectConfig = {
  type: "json_object",
};

models.ChatFormatJsonSchemaConfig

const value: models.ChatFormatJsonSchemaConfig = {
  jsonSchema: {
    name: "math_response",
  },
  type: "json_schema",
};

models.ChatFormatPythonConfig

const value: models.ChatFormatPythonConfig = {
  type: "python",
};

models.ChatFormatTextConfig

const value: models.ChatFormatTextConfig = {
  type: "text",
};