Skip to content

Commit 797b7ee

Browse files
Merge pull request #245536 from mrbullwinkle/mrb_07_19_2023_function_ref
[Azure AI] [Azure OpenAI] Update ref docs
2 parents 99b1dc7 + ce749d0 commit 797b7ee

File tree

1 file changed

+47
-3
lines changed

1 file changed

+47
-3
lines changed

articles/ai-services/openai/reference.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ manager: nitinme
77
ms.service: cognitive-services
88
ms.subservice: openai
99
ms.topic: conceptual
10-
ms.date: 05/15/2023
10+
ms.date: 07/19/2023
1111
author: mrbullwinkle
1212
ms.author: mbullwin
1313
recommendations: false
@@ -198,6 +198,7 @@ POST https://{your-resource-name}.openai.azure.com/openai/deployments/{deploymen
198198
- `2023-03-15-preview` [Swagger spec](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-03-15-preview/inference.json)
199199
- `2023-05-15` [Swagger spec](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/inference.json)
200200
- `2023-06-01-preview` [Swagger spec](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/inference.json)
201+
- `2023-07-01-preview` [Swagger spec](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json)
201202

202203
#### Example request
203204

@@ -228,7 +229,7 @@ Output formatting adjusted for ease of reading, actual output is a single block
228229

229230
| Parameter | Type | Required? | Default | Description |
230231
|--|--|--|--|--|
231-
| ```messages``` | array | Required | | The messages to generate chat completions for, in the chat format. |
232+
| ```messages``` | array | Required | | The collection of context messages associated with this chat completions request. Typical usage begins with a [chat message](#chatmessage) for the System role that provides instructions for the behavior of the assistant, followed by alternating messages between the User and Assistant roles.|
232233
| ```temperature```| number | Optional | 1 | What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\nWe generally recommend altering this or `top_p` but not both. |
233234
| ```n``` | integer | Optional | 1 | How many chat completion choices to generate for each input message. |
234235
| ```stream``` | boolean | Optional | false | If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a `data: [DONE]` message." |
@@ -238,6 +239,49 @@ Output formatting adjusted for ease of reading, actual output is a single block
238239
| ```frequency_penalty``` | number | Optional | 0 | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.|
239240
| ```logit_bias``` | object | Optional | null | Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.|
240241
| ```user``` | string | Optional | | A unique identifier representing your end-user, which can help Azure OpenAI to monitor and detect abuse.|
242+
|```function_call```| | Optional | | 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. This parameter requires API version [`2023-07-01-preview`](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json) |
243+
|```functions``` | [`FunctionDefinition[]`](#functiondefinition) | Optional | | A list of functions the model may generate JSON inputs for. This parameter requires API version [`2023-07-01-preview`](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json)|
244+
245+
### ChatMessage
246+
247+
A single, role-attributed message within a chat completion interaction.
248+
249+
| Name | Type | Description |
250+
|---|---|---|
251+
| content | string | The text associated with this message payload.|
252+
| function_call | [FunctionCall](#functioncall)| The name and arguments of a function that should be called, as generated by the model. |
253+
| name | string | The `name` of the author of this message. `name` is required if role is `function`, and it should be the name of the function whose response is in the `content`. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.|
254+
|role | [ChatRole](#chatrole) | The role associated with this message payload |
255+
256+
### ChatRole
257+
258+
A description of the intended purpose of a message within a chat completions interaction.
259+
260+
|Name | Type | Description |
261+
|---|---|---|
262+
| assistant | string | The role that provides responses to system-instructed, user-prompted input. |
263+
| function | string | The role that provides function results for chat completions. |
264+
| system | string | The role that instructs or sets the behavior of the assistant. |
265+
| user | string | The role that provides input for chat completions. |
266+
267+
### FunctionCall
268+
269+
The name and arguments of a function that should be called, as generated by the model. This requires API version [`2023-07-01-preview`](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json)
270+
271+
| Name | Type | Description|
272+
|---|---|---|
273+
| 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 fabricate parameters not defined by your function schema. Validate the arguments in your code before calling your function. |
274+
| name | string | The name of the function to call.|
275+
276+
### FunctionDefinition
277+
278+
The definition of a caller-specified function that chat completions may invoke in response to matching user input. This requires API version [`2023-07-01-preview`](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-07-01-preview/generated.json)
279+
280+
|Name | Type| Description|
281+
|---|---|---|
282+
| description | string | A description of what the function does. The model will use this description when selecting the function and interpreting its parameters. |
283+
| name | string | The name of the function to be called. |
284+
| parameters | | The parameters the functions accepts, described as a [JSON Schema](https://json-schema.org/understanding-json-schema/) object.|
241285

242286
## Completions extensions
243287

@@ -489,5 +533,5 @@ Azure OpenAI is deployed as a part of the Azure AI services. All Azure AI servic
489533

490534
## Next steps
491535

492-
Learn about [managing deployments, models, and fine-tuning with the REST API](/rest/api/cognitiveservices/azureopenaistable/deployments/create).
536+
Learn about [ Models, and fine-tuning with the REST API](/rest/api/cognitiveservices/azureopenaistable/files).
493537
Learn more about the [underlying models that power Azure OpenAI](./concepts/models.md).

0 commit comments

Comments
 (0)