Skip to content

Commit 4be80c6

Browse files
Merge pull request #268980 from wangyuantao/yuantw/previ
Azure OpenAI On Your Data - Remove previous intent
2 parents 3b9fd64 + e81f79b commit 4be80c6

File tree

2 files changed

+10
-49
lines changed

2 files changed

+10
-49
lines changed

articles/ai-services/openai/concepts/use-your-data.md

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -383,40 +383,8 @@ You can send a streaming request using the `stream` parameter, allowing data to
383383

384384
#### Conversation history for better results
385385

386-
When you chat with a model, providing a history of the chat will help the model return higher quality results.
386+
When you chat with a model, providing a history of the chat will help the model return higher quality results. You don't need to include the `context` property of the assistant messages in your API requests for better response quality. See [the API reference documentation](../references/on-your-data.md#examples) for examples.
387387

388-
```json
389-
{
390-
"dataSources": [
391-
{
392-
"type": "AzureCognitiveSearch",
393-
"parameters": {
394-
"endpoint": "'$AZURE_AI_SEARCH_ENDPOINT'",
395-
"key": "'$AZURE_AI_SEARCH_API_KEY'",
396-
"indexName": "'$AZURE_AI_SEARCH_INDEX'"
397-
}
398-
}
399-
],
400-
"messages": [
401-
{
402-
"role": "user",
403-
"content": "What are the differences between Azure Machine Learning and Azure AI services?"
404-
},
405-
{
406-
"role": "tool",
407-
"content": "{\"citations\": [{\"content\": \"title: Azure AI services and Machine Learning\\ntitleSuffix: Azure AI services\\ndescription: Learn where Azure AI services fits in with other Azure offerings for machine learning.\\nAzure AI services and machine learning\\nAzure AI services provides machine learning capabilities to solve general problems such as...\\n \"articles\\\\cognitive-services\\\\cognitive-services-and-machine-learning.md\", \"url\": null, \"metadata\": {\"chunking\": \"orignal document size=1018. Scores=0.32200050354003906 and 1.2880020141601562.Org Highlight count=115.\"}, \"chunk_id\": \"0\"}], \"intent\": \"[\\\"What are the differences between Azure Machine Learning and Azure AI services?\\\"]\"}"
408-
},
409-
{
410-
"role": "assistant",
411-
"content": " \nAzure Machine Learning is a product and service tailored for data scientists to build, train, and deploy machine learning models [doc1]..."
412-
},
413-
{
414-
"role": "user",
415-
"content": "How do I use Azure machine learning?"
416-
}
417-
]
418-
}
419-
```
420388

421389
## Token usage estimation for Azure OpenAI On Your Data
422390

articles/ai-services/openai/references/on-your-data.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ POST {endpoint}/openai/deployments/{deployment-id}/chat/completions?api-version=
2828
```
2929

3030
**Supported versions**
31-
* `2024-02-15-preview` [Swagger spec](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-02-15-preview/inference.json)
31+
* `2024-02-15-preview` [Swagger spec](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-02-15-preview/inference.json).
3232
* `2024-02-01` [Swagger spec](https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-02-01).
3333

3434
> [!NOTE]
@@ -48,7 +48,6 @@ The request body inherits the same schema of chat completions API request. This
4848

4949
|Name | Type | Required | Description |
5050
|--- | --- | --- | --- |
51-
| `messages` | [ChatMessage](#chat-message)[] | True | The array of messages to generate chat completions for, in the chat format. The [request chat message](#chat-message) has a `context` property, which is added for Azure OpenAI On Your Data.|
5251
| `data_sources` | [DataSource](#data-source)[] | True | The configuration entries for Azure OpenAI On Your Data. There must be exactly one element in the array. If `data_sources` is not provided, the service uses chat completions model directly, and does not use Azure OpenAI On Your Data.|
5352

5453
## Response body
@@ -57,17 +56,17 @@ The response body inherits the same schema of chat completions API response. The
5756

5857
## Chat message
5958

60-
In both request and response, when the chat message `role` is `assistant`, the chat message schema inherits from the chat completions assistant chat message, and is extended with the property `context`.
59+
The response assistant message schema inherits from the chat completions assistant [chat message](../reference.md#chatmessage), and is extended with the property `context`.
6160

6261
|Name | Type | Required | Description |
6362
|--- | --- | --- | --- |
64-
| `context` | [Context](#context) | False | Represents the incremental steps performed by the Azure OpenAI On Your Data while processing the request, including the detected search intent and the retrieved documents. |
63+
| `context` | [Context](#context) | False | Represents the incremental steps performed by the Azure OpenAI On Your Data while processing the request, including the retrieved documents. |
6564

6665
## Context
6766
|Name | Type | Required | Description |
6867
|--- | --- | --- | --- |
69-
| `citations` | [Citation](#citation)[] | False | The data source retrieval result, used to generate the assistant message in the response.|
70-
| `intent` | string | False | The detected intent from the chat history, used to pass to the next turn to carry over the context.|
68+
| `citations` | [Citation](#citation)[] | False | The data source retrieval result, used to generate the assistant message in the response. Clients can render references from the citations. |
69+
| `intent` | string | False | The detected intent from the chat history. Passing back the previous intent is no longer needed. Ignore this property. |
7170

7271
## Citation
7372

@@ -91,7 +90,7 @@ This list shows the supported data sources.
9190

9291
## Examples
9392

94-
This example shows how to pass context with conversation history for better results.
93+
This example shows how to pass conversation history for better results.
9594

9695
Prerequisites:
9796
* Configure the role assignments from Azure OpenAI system assigned managed identity to Azure search service. Required roles: `Search Index Data Reader`, `Search Service Contributor`.
@@ -137,10 +136,7 @@ completion = client.chat.completions.create(
137136
},
138137
{
139138
"role": "assistant",
140-
"content": "DRI stands for Directly Responsible Individual of a service. Which service are you asking about?",
141-
"context": {
142-
"intent": "[\"Who is DRI?\", \"What is the meaning of DRI?\", \"Define DRI\"]"
143-
}
139+
"content": "DRI stands for Directly Responsible Individual of a service. Which service are you asking about?"
144140
},
145141
{
146142
"role": "user",
@@ -191,14 +187,11 @@ az rest --method POST \
191187
"messages": [
192188
{
193189
"role": "user",
194-
"content": "Who is DRI?",
190+
"content": "Who is DRI?"
195191
},
196192
{
197193
"role": "assistant",
198-
"content": "DRI stands for Directly Responsible Individual of a service. Which service are you asking about?",
199-
"context": {
200-
"intent": "[\"Who is DRI?\", \"What is the meaning of DRI?\", \"Define DRI\"]"
201-
}
194+
"content": "DRI stands for Directly Responsible Individual of a service. Which service are you asking about?"
202195
},
203196
{
204197
"role": "user",

0 commit comments

Comments
 (0)