Skip to content

@ralphschuler.ai function caller.index.<internal>.OpenAI.Chat.Completions.ChatCompletionCreateParams.ResponseFormat

github-actions edited this page Nov 26, 2023 · 1 revision

Interface: ResponseFormat

Completions.ChatCompletionCreateParams.ResponseFormat

An object specifying the format that the model must output.

Setting to { "type": "json_object" } enables JSON mode, which guarantees the message the model generates is valid JSON.

Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in increased latency and appearance of a "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.

Table of contents

Properties

Properties

type

Optional type: "text" | "json_object"

Must be one of text or json_object.

Defined in

node_modules/openai/resources/chat/completions.d.ts:634

Typescript Libraries

Modules

Namespaces

Clone this wiki locally