{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "#/components/schemas/createChatCompletionRequest", "title": "createChatCompletionRequest", "type": "object", "allOf": [ { "$ref": "#/components/schemas/chatCompletionsRequestCommon" }, { "properties": { "messages": { "description": "A list of messages comprising the conversation so far. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb).", "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/chatCompletionRequestMessage" } }, "data_sources": { "type": "array", "description": " The configuration entries for Azure OpenAI chat extensions that use them.\n This additional specification is only compatible with Azure OpenAI.", "items": { "$ref": "#/components/schemas/azureChatExtensionConfiguration" } }, "enhancements": { "type": "object", "description": "The type of enhancements needed.", "properties": { "grounding": { "type": "object", "description": "Request object to specify if grounding enhancement is needed.", "properties": { "enabled": { "type": "boolean", "default": false } } }, "ocr": { "type": "object", "description": "Request object to specify if ocr enhancement is needed.", "properties": { "enabled": { "type": "boolean", "default": false } } } } }, "n": { "type": "integer", "minimum": 1, "maximum": 128, "default": 1, "example": 1, "nullable": true, "description": "How many chat completion choices to generate for each input message." }, "seed": { "type": "integer", "minimum": -9223372036854776000, "maximum": 9223372036854776000, "default": 0, "example": 1, "nullable": true, "description": "If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend." }, "logprobs": { "description": "Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`. This option is currently not available on the `gpt-4-vision-preview` model.", "type": "boolean", "default": false, "nullable": true }, "top_logprobs": { "description": "An integer between 0 and 5 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used.", "type": "integer", "minimum": 0, "maximum": 5, "nullable": true }, "response_format": { "type": "object", "description": "An object specifying the format that the model must output. Used to enable JSON mode.", "properties": { "type": { "$ref": "#/components/schemas/chatCompletionResponseFormat" } } }, "tools": { "description": "A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.", "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/chatCompletionTool" } }, "tool_choice": { "$ref": "#/components/schemas/chatCompletionToolChoiceOption" }, "functions": { "description": "Deprecated in favor of `tools`. A list of functions the model may generate JSON inputs for.", "type": "array", "minItems": 1, "maxItems": 128, "items": { "$ref": "#/components/schemas/chatCompletionFunction" } }, "function_call": { "description": "Deprecated in favor of `tool_choice`. Controls how the model responds to function calls. \"none\" means the model does not call a function, and responds to the end-user. \"auto\" means the model can pick between an end-user or calling a function. Specifying a particular function via `{\"name\":\\ \"my_function\"}` forces the model to call that function. \"none\" is the default when no functions are present. \"auto\" is the default if functions are present.", "oneOf": [ { "type": "string", "enum": [ "none", "auto" ], "description": "`none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function." }, { "type": "object", "description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.", "properties": { "name": { "type": "string", "description": "The name of the function to call." } }, "required": [ "name" ] } ] } } } ], "required": [ "messages" ] }