Skip to content

Commit f77426b

Browse files
authored
Update reference-model-inference-chat-completions.md
1 parent b1ec88b commit f77426b

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

articles/machine-learning/reference-model-inference-chat-completions.md

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ POST /chat/completions?api-version=2024-04-01-preview
2929
| --- | --- | --- | --- | --- |
3030
| api-version | query | True | string | The version of the API in the format "YYYY-MM-DD" or "YYYY-MM-DD-preview". |
3131

32+
## Request Header
33+
34+
35+
| Name | Required | Type | Description |
36+
| --- | --- | --- | --- |
37+
| extra-parameters | | string | The behavior of the API when extra parameters are indicated in the payload. Using `pass-through` makes the API to pass the parameter to the underlying model. Use this value when you want to pass parameters that you know the underlying model can support. Using `ignore` makes the API to drop any unsupported parameter. Use this value when you need to use the same payload across different models, but one of the extra parameters may make a model to error out if not supported. Using `error` makes the API to reject any extra parameter in the payload. Only parameters specified in this API can be indicated, or a 400 error is returned. |
38+
| azureml-model-deployment | | string | Name of the deployment you want to route the request to. Supported for endpoints that support multiple deployments. |
39+
3240
## Request Body
3341

3442
| Name | Required | Type | Description |
@@ -112,7 +120,7 @@ POST /chat/completions?api-version=2024-04-01-preview
112120
"stream": false,
113121
"temperature": 0,
114122
"top_p": 1,
115-
"response_format": "text"
123+
"response_format": { "type": "text" }
116124
}
117125
```
118126

@@ -156,7 +164,8 @@ Status code: 200
156164
| [ChatCompletionFinishReason](#chatcompletionfinishreason) | The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool. |
157165
| [ChatCompletionMessageToolCall](#chatcompletionmessagetoolcall) | |
158166
| [ChatCompletionObject](#chatcompletionobject) | The object type, which is always `chat.completion`. |
159-
| [ChatCompletionResponseFormat](#chatcompletionresponseformat) | |
167+
| [ChatCompletionResponseFormat](#chatcompletionresponseformat) | The response format for the model response. Setting to `json_object` enables JSON mode, which guarantees the message the model generates is valid JSON. When using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. 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. |
168+
| [ChatCompletionResponseFormatType](#chatcompletionresponseformattype) | The response format type. |
160169
| [ChatCompletionResponseMessage](#chatcompletionresponsemessage) | A chat completion message generated by the model. |
161170
| [ChatCompletionTool](#chatcompletiontool) | |
162171
| [ChatMessageRole](#chatmessagerole) | The role of the author of this message. |
@@ -165,15 +174,15 @@ Status code: 200
165174
| [ContentFilterError](#contentfiltererror) | The API call fails when the prompt triggers a content filter as configured. Modify the prompt and try again. |
166175
| [CreateChatCompletionRequest](#createchatcompletionrequest) | |
167176
| [CreateChatCompletionResponse](#createchatcompletionresponse) | Represents a chat completion response returned by model, based on the provided input. |
168-
| [Detail](#detail) | |
177+
| [Detail](#detail) | Details for the [UnprocessableContentError](#unprocessablecontenterror) error. |
169178
| [Function](#function) | The function that the model called. |
170-
| [FunctionObject](#functionobject) | |
179+
| [FunctionObject](#functionobject) | Definition of a function the model has access to. |
171180
| [ImageDetail](#imagedetail) | Specifies the detail level of the image. |
172-
| [NotFoundError](#notfounderror) | |
181+
| [NotFoundError](#notfounderror) | The route is not valid for the deployed model. |
173182
| [ToolType](#tooltype) | The type of the tool. Currently, only `function` is supported. |
174-
| [TooManyRequestsError](#toomanyrequestserror) | |
175-
| [UnauthorizedError](#unauthorizederror) | |
176-
| [UnprocessableContentError](#unprocessablecontenterror) | |
183+
| [TooManyRequestsError](#toomanyrequestserror) | You have hit your assigned rate limit and your requests need to be paced. |
184+
| [UnauthorizedError](#unauthorizederror) | Authentication is missing or invalid. |
185+
| [UnprocessableContentError](#unprocessablecontenterror) | The request contains unprocessable content. The error is returned when the payload indicated is valid according to this specification. However, some of the instructions indicated in the payload are not supported by the underlying model. Use the `details` section to understand the offending parameter. |
177186

178187

179188
### ChatCompletionFinishReason
@@ -208,6 +217,15 @@ The object type, which is always `chat.completion`.
208217

209218
### ChatCompletionResponseFormat
210219

220+
The response format for the model response. Setting to `json_object` enables JSON mode, which guarantees the message the model generates is valid JSON. When using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. 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.
221+
222+
| Name | Type | Description |
223+
| --- | --- | --- |
224+
| type | [ChatCompletionResponseFormatType](#chatcompletionresponseformattype) | The response format type. |
225+
226+
### ChatCompletionResponseFormatType
227+
228+
The response format type.
211229

212230
| Name | Type | Description |
213231
| --- | --- | --- |
@@ -236,7 +254,6 @@ A chat completion message generated by the model.
236254

237255
The role of the author of this message.
238256

239-
240257
| Name | Type | Description |
241258
| --- | --- | --- |
242259
| assistant | string | |
@@ -248,7 +265,6 @@ The role of the author of this message.
248265

249266
A list of chat completion choices. Can be more than one if `n` is greater than 1.
250267

251-
252268
| Name | Type | Description |
253269
| --- | --- | --- |
254270
| finish\_reason | [ChatCompletionFinishReason](#chatcompletionfinishreason) | The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `content_filter` if content was omitted due to a flag from our content filters, `tool_calls` if the model called a tool. |
@@ -281,7 +297,6 @@ The API call fails when the prompt triggers a content filter as configured. Modi
281297

282298
### CreateChatCompletionRequest
283299

284-
285300
| Name | Type | Default Value | Description |
286301
| --- | --- | --- | --- |
287302
| frequency\_penalty | number | 0 | Helps prevent word repetitions by reducing the chance of a word being selected if it has already been used. The higher the frequency penalty, the less likely the model is to repeat the same words in its output. Return a 422 error if value or parameter is not supported by model. |
@@ -347,7 +362,6 @@ Specifies the detail level of the image.
347362

348363
Represents a chat completion response returned by model, based on the provided input.
349364

350-
351365
| Name | Type | Description |
352366
| --- | --- | --- |
353367
| choices | [Choices](#choices)\[\] | A list of chat completion choices. Can be more than one if `n` is greater than 1. |
@@ -360,6 +374,7 @@ Represents a chat completion response returned by model, based on the provided i
360374

361375
### Detail
362376

377+
Details for the [UnprocessableContentError](#unprocessablecontenterror) error.
363378

364379
| Name | Type | Description |
365380
| --- | --- | --- |
@@ -370,14 +385,14 @@ Represents a chat completion response returned by model, based on the provided i
370385

371386
The function that the model called.
372387

373-
374388
| Name | Type | Description |
375389
| --- | --- | --- |
376390
| arguments | string | The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may generate incorrect parameters not defined by your function schema. Validate the arguments in your code before calling your function. |
377391
| name | string | The name of the function to call. |
378392

379393
### FunctionObject
380394

395+
Definition of a function the model has access to.
381396

382397
| Name | Type | Description |
383398
| --- | --- | --- |
@@ -406,6 +421,7 @@ The type of the tool. Currently, only `function` is supported.
406421
### TooManyRequestsError
407422

408423

424+
409425
| Name | Type | Description |
410426
| --- | --- | --- |
411427
| error | string | The error description. |
@@ -423,11 +439,12 @@ The type of the tool. Currently, only `function` is supported.
423439

424440
### UnprocessableContentError
425441

442+
The request contains unprocessable content. The error is returned when the payload indicated is valid according to this specification. However, some of the instructions indicated in the payload are not supported by the underlying model. Use the `details` section to understand the offending parameter.
426443

427444
| Name | Type | Description |
428445
| --- | --- | --- |
429446
| code | string | The error code. |
430447
| detail | [Detail](#detail) | |
431448
| error | string | The error description. |
432449
| message | string | The error message. |
433-
| status | integer | The HTTP status code. |
450+
| status | integer | The HTTP status code. |

0 commit comments

Comments
 (0)