共用方式為


ChatCompletionsResponseFormat type

表示模型必須輸出的格式。 使用此選項可啟用 JSON 模式,而不是預設文字模式。 請注意,若要啟用 JSON 模式,某些 AI 模型可能也需要指示模型透過系統或使用者訊息產生 JSON。

type ChatCompletionsResponseFormat =
  | ChatCompletionsResponseFormatParent
  | ChatCompletionsResponseFormatText
  | ChatCompletionsResponseFormatJsonObject
  | ChatCompletionsResponseFormatJsonSchema