You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-studio/reference/reference-model-inference-chat-completions.md
+19-12Lines changed: 19 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,14 @@ POST /chat/completions?api-version=2024-04-01-preview
30
30
| --- | --- | --- | --- | --- |
31
31
| api-version | query | True | string | The version of the API in the format "YYYY-MM-DD" or "YYYY-MM-DD-preview". |
32
32
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
+
33
41
## Request Body
34
42
35
43
| Name | Required | Type | Description |
@@ -157,7 +165,7 @@ Status code: 200
157
165
|[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. |
|[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.|
161
169
|[ChatCompletionResponseMessage](#chatcompletionresponsemessage)| A chat completion message generated by the model. |
162
170
|[ChatCompletionTool](#chatcompletiontool)||
163
171
|[ChatMessageRole](#chatmessagerole)| The role of the author of this message. |
@@ -166,15 +174,15 @@ Status code: 200
166
174
|[ContentFilterError](#contentfiltererror)| The API call fails when the prompt triggers a content filter as configured. Modify the prompt and try again. |
|[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.|
170
178
|[Function](#function)| The function that the model called. |
171
-
|[FunctionObject](#functionobject)||
179
+
|[FunctionObject](#functionobject)|Definition of a function the model has access to.|
172
180
|[ImageDetail](#imagedetail)| Specifies the detail level of the image. |
173
-
|[NotFoundError](#notfounderror)||
181
+
|[NotFoundError](#notfounderror)|The route is not valid for the deployed model.|
174
182
|[ToolType](#tooltype)| The type of the tool. Currently, only `function` is supported. |
|[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.|
178
186
179
187
180
188
### ChatCompletionFinishReason
@@ -209,6 +217,7 @@ The object type, which is always `chat.completion`.
209
217
210
218
### ChatCompletionResponseFormat
211
219
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.
212
221
213
222
| Name | Type | Description |
214
223
| --- | --- | --- |
@@ -237,7 +246,6 @@ A chat completion message generated by the model.
237
246
238
247
The role of the author of this message.
239
248
240
-
241
249
| Name | Type | Description |
242
250
| --- | --- | --- |
243
251
| assistant | string ||
@@ -249,7 +257,6 @@ The role of the author of this message.
249
257
250
258
A list of chat completion choices. Can be more than one if `n` is greater than 1.
251
259
252
-
253
260
| Name | Type | Description |
254
261
| --- | --- | --- |
255
262
| 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
282
289
283
290
### CreateChatCompletionRequest
284
291
285
-
286
292
| Name | Type | Default Value | Description |
287
293
| --- | --- | --- | --- |
288
294
| 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.
348
354
349
355
Represents a chat completion response returned by model, based on the provided input.
350
356
351
-
352
357
| Name | Type | Description |
353
358
| --- | --- | --- |
354
359
| 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
361
366
362
367
### Detail
363
368
369
+
Details for the [UnprocessableContentError](#unprocessablecontenterror) error.
364
370
365
371
| Name | Type | Description |
366
372
| --- | --- | --- |
@@ -371,14 +377,14 @@ Represents a chat completion response returned by model, based on the provided i
371
377
372
378
The function that the model called.
373
379
374
-
375
380
| Name | Type | Description |
376
381
| --- | --- | --- |
377
382
| 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. |
378
383
| name | string | The name of the function to call. |
379
384
380
385
### FunctionObject
381
386
387
+
Definition of a function the model has access to.
382
388
383
389
| Name | Type | Description |
384
390
| --- | --- | --- |
@@ -407,6 +413,7 @@ The type of the tool. Currently, only `function` is supported.
0 commit comments