Skip to content

Commit 5fe10be

Browse files
authored
Update reference-model-inference-chat-completions.md
1 parent d5b5ec4 commit 5fe10be

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

articles/ai-studio/reference/reference-model-inference-chat-completions.md

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

33+
## Request Header
34+
35+
36+
| Name | Required | Type | Description |
37+
| --- | --- | --- | --- |
38+
| extra-parameters | | string | The behavior of the API when extra parameters are indicated in the payload. Using `allow` 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 `drop` 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 int this API can be indicated, or a 400 error is returned. |
39+
| azureml-model-deployment | | string | Name of the deployment you want to route the request to. Supported for endpoints that support multiple deployments. |
40+
3341
## Request Body
3442

3543
| Name | Required | Type | Description |
@@ -157,7 +165,7 @@ Status code: 200
157165
| [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. |
158166
| [ChatCompletionMessageToolCall](#chatcompletionmessagetoolcall) | |
159167
| [ChatCompletionObject](#chatcompletionobject) | The object type, which is always `chat.completion`. |
160-
| [ChatCompletionResponseFormat](#chatcompletionresponseformat) | |
168+
| [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. |
161169
| [ChatCompletionResponseMessage](#chatcompletionresponsemessage) | A chat completion message generated by the model. |
162170
| [ChatCompletionTool](#chatcompletiontool) | |
163171
| [ChatMessageRole](#chatmessagerole) | The role of the author of this message. |
@@ -166,15 +174,15 @@ Status code: 200
166174
| [ContentFilterError](#contentfiltererror) | The API call fails when the prompt triggers a content filter as configured. Modify the prompt and try again. |
167175
| [CreateChatCompletionRequest](#createchatcompletionrequest) | |
168176
| [CreateChatCompletionResponse](#createchatcompletionresponse) | Represents a chat completion response returned by model, based on the provided input. |
169-
| [Detail](#detail) | |
177+
| [Detail](#detail) | Details for the [UnprocessableContentError](#unprocessablecontenterror) error. |
170178
| [Function](#function) | The function that the model called. |
171-
| [FunctionObject](#functionobject) | |
179+
| [FunctionObject](#functionobject) | Definition of a function the model has access to. |
172180
| [ImageDetail](#imagedetail) | Specifies the detail level of the image. |
173-
| [NotFoundError](#notfounderror) | |
181+
| [NotFoundError](#notfounderror) | The route is not valid for the deployed model. |
174182
| [ToolType](#tooltype) | The type of the tool. Currently, only `function` is supported. |
175-
| [TooManyRequestsError](#toomanyrequestserror) | |
176-
| [UnauthorizedError](#unauthorizederror) | |
177-
| [UnprocessableContentError](#unprocessablecontenterror) | |
183+
| [TooManyRequestsError](#toomanyrequestserror) | You have hit your assigned rate limit and your request 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. |
178186

179187

180188
### ChatCompletionFinishReason
@@ -209,6 +217,7 @@ The object type, which is always `chat.completion`.
209217

210218
### ChatCompletionResponseFormat
211219

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.
212221

213222
| Name | Type | Description |
214223
| --- | --- | --- |
@@ -237,7 +246,6 @@ A chat completion message generated by the model.
237246

238247
The role of the author of this message.
239248

240-
241249
| Name | Type | Description |
242250
| --- | --- | --- |
243251
| assistant | string | |
@@ -249,7 +257,6 @@ The role of the author of this message.
249257

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

252-
253260
| Name | Type | Description |
254261
| --- | --- | --- |
255262
| 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. |
@@ -282,7 +289,6 @@ The API call fails when the prompt triggers a content filter as configured. Modi
282289

283290
### CreateChatCompletionRequest
284291

285-
286292
| Name | Type | Default Value | Description |
287293
| --- | --- | --- | --- |
288294
| 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. |
@@ -348,7 +354,6 @@ Specifies the detail level of the image.
348354

349355
Represents a chat completion response returned by model, based on the provided input.
350356

351-
352357
| Name | Type | Description |
353358
| --- | --- | --- |
354359
| choices | [Choices](#choices)\[\] | A list of chat completion choices. Can be more than one if `n` is greater than 1. |
@@ -361,6 +366,7 @@ Represents a chat completion response returned by model, based on the provided i
361366

362367
### Detail
363368

369+
Details for the [UnprocessableContentError](#unprocessablecontenterror) error.
364370

365371
| Name | Type | Description |
366372
| --- | --- | --- |
@@ -371,14 +377,14 @@ Represents a chat completion response returned by model, based on the provided i
371377

372378
The function that the model called.
373379

374-
375380
| Name | Type | Description |
376381
| --- | --- | --- |
377382
| 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. |
378383
| name | string | The name of the function to call. |
379384

380385
### FunctionObject
381386

387+
Definition of a function the model has access to.
382388

383389
| Name | Type | Description |
384390
| --- | --- | --- |
@@ -407,6 +413,7 @@ The type of the tool. Currently, only `function` is supported.
407413
### TooManyRequestsError
408414

409415

416+
410417
| Name | Type | Description |
411418
| --- | --- | --- |
412419
| error | string | The error description. |

0 commit comments

Comments
 (0)