Skip to content

Commit 703020e

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into event-hubs-articles-batch1
2 parents 273ee7f + 21e2012 commit 703020e

File tree

1,437 files changed

+22508
-5143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,437 files changed

+22508
-5143
lines changed

.openpublishing.redirection.azure-kubernetes-service.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,6 @@
456456
"redirect_url": "/azure/aks/create-node-pools",
457457
"redirect_document_id": false
458458
},
459-
{
460-
"source_path_from_root": "/articles/copilot/limited-access.md",
461-
"redirect_url": "/azure/copilot/manage-access",
462-
"redirect_document_id": false
463-
},
464459
{
465460
"source_path_from_root": "/articles/aks/command-invoke.md",
466461
"redirect_url": "/azure/aks/access-private-cluster",

.openpublishing.redirection.azure-monitor.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6728,8 +6728,14 @@
67286728
"source_path_from_root": "/articles/azure-monitor/essentials/prometheus-get-started.md",
67296729
"redirect_url": "/azure/azure-monitor/essentials/prometheus-metrics-overview",
67306730
"redirect_document_id": false
6731+
},
6732+
{
6733+
"source_path_from_root": "/articles/azure-monitor/essentials/pipeline-overview.md",
6734+
"redirect_url": "/azure/azure-monitor/essentials/data-collection-rule-overview",
6735+
"redirect_document_id": false
67316736
}
67326737

6738+
67336739

67346740
]
67356741
}

.openpublishing.redirection.azure-resource-manager.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,11 @@
19201920
"redirect_url": "/azure/azure-resource-manager/managed-applications/overview",
19211921
"redirect_document_id": false
19221922
},
1923+
{
1924+
"source_path_from_root": "/articles/azure-resource-manager/managed-applications/deploy-marketplace-app-quickstart.md",
1925+
"redirect_url": "/azure/azure-resource-manager/managed-applications/deploy-service-catalog-quickstart",
1926+
"redirect_document_id": false
1927+
},
19231928
{
19241929
"source_path_from_root": "/articles/resource-manager-policy.md",
19251930
"redirect_url": "/azure/governance/policy/overview",

.openpublishing.redirection.container-registry.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
{
22
"redirections": [
3+
4+
{
5+
"source_path_from_root": "/articles/container-registry/container-registry-oci-artifacts.md",
6+
"redirect_url": "/azure/container-registry/container-registry-manage-artifact",
7+
"redirect_document_id": false
8+
},
9+
{
10+
"source_path_from_root": "/articles/container-registry/container-registry-oras-artifacts.md",
11+
"redirect_url": "/azure/container-registry/container-registry-manage-artifact",
12+
"redirect_document_id": false
13+
},
314
{
415
"source_path_from_root": "/articles/container-registry/tutorial-enable-registry-cache-auth.md",
516
"redirect_url": "/azure/container-registry/container-registry-artifact-cache",
617
"redirect_document_id": false
718
},
19+
820
{
921
"source_path_from_root": "/articles/container-registry/tutorial-enable-registry-cache-auth-cli.md",
1022
"redirect_url": "/azure/container-registry/container-registry-artifact-cache",

.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4063,6 +4063,16 @@
40634063
"redirect_url":"/azure/reliability/reliability-cosmos-db-nosql",
40644064
"redirect_document_id":false
40654065
},
4066+
{
4067+
"source_path_from_root": "/articles/copilot/limited-access.md",
4068+
"redirect_url": "/azure/copilot/manage-access",
4069+
"redirect_document_id": false
4070+
},
4071+
{
4072+
"source_path_from_root": "/articles/azure-portal/mobile-app/microsoft-copilot-for-azure.md",
4073+
"redirect_url": "/azure/azure-portal/mobile-app/microsoft-copilot-in-azure",
4074+
"redirect_document_id": false
4075+
},
40664076
{
40674077
"source_path_from_root":"/articles/migrate/how-to-assess.md",
40684078
"redirect_url":"/azure/migrate/whats-new#update-april-2024",

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

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ You might want to consider using an Azure AI Search index when you either want t
7878
* Reuse an index created before by ingesting data from other data sources.
7979

8080
> [!NOTE]
81-
> * To use an existing index, it must have at least one searchable field.
82-
> * Set the CORS **Allow Origin Type** option to `all` and the **Allowed origins** option to `*`.
83-
81+
> To use an existing index, it must have at least one searchable field.
8482
8583
### Search types
8684

@@ -137,7 +135,6 @@ If you want to implement additional value-based criteria for query execution, yo
137135

138136
[!INCLUDE [ai-search-ingestion](../includes/ai-search-ingestion.md)]
139137

140-
[!INCLUDE [authentication](../includes/on-your-data-authentication.md)]
141138

142139
# [Vector Database in Azure Cosmos DB for MongoDB](#tab/mongo-db)
143140

@@ -205,8 +202,6 @@ To modify the schedule, you can use the [Azure portal](https://portal.azure.com/
205202

206203
[!INCLUDE [ai-search-ingestion](../includes/ai-search-ingestion.md)]
207204

208-
[!INCLUDE [authentication](../includes/on-your-data-authentication.md)]
209-
210205
# [Upload files (preview)](#tab/file-upload)
211206

212207
Using Azure OpenAI Studio, you can upload files from your machine to try Azure OpenAI On Your Data. You also have the option to create a new Azure Blob Storage account and Azure AI Search resource. The service then stores the files to an Azure storage container and performs ingestion from the container. You can use the [quickstart](../use-your-data-quickstart.md) article to learn how to use this data source option.
@@ -215,8 +210,6 @@ Using Azure OpenAI Studio, you can upload files from your machine to try Azure O
215210

216211
[!INCLUDE [ai-search-ingestion](../includes/ai-search-ingestion.md)]
217212

218-
[!INCLUDE [authentication](../includes/on-your-data-authentication.md)]
219-
220213
# [URL/Web address (preview)](#tab/web-pages)
221214

222215
You can paste URLs and the service will store the webpage content, using it when generating responses from the model. The content in URLs/web addresses that you use need to have the following characteristics to be properly ingested:
@@ -231,10 +224,6 @@ You can paste URLs and the service will store the webpage content, using it when
231224

232225
Once you have added the URL/web address for data ingestion, the web pages from your URL are fetched and saved to Azure Blob Storage with a container name: `webpage-<index name>`. Each URL will be saved into a different container within the account. Then the files are indexed into an Azure AI Search index, which is used for retrieval when you’re chatting with the model.
233226

234-
[!INCLUDE [ai-search-ingestion](../includes/ai-search-ingestion.md)]
235-
236-
[!INCLUDE [authentication](../includes/on-your-data-authentication.md)]
237-
238227
# [Elasticsearch (preview)](#tab/elasticsearch)
239228

240229
You can connect to your [Elasticsearch vector database](https://www.elastic.co/guide/en/elasticsearch/reference/current/elasticsearch-intro.html) and chat with your data.
@@ -592,24 +581,22 @@ Each user message can translate to multiple search queries, all of which get sen
592581

593582
## Regional availability and model support
594583

595-
| Region | `gpt-35-turbo-16k (0613)` | `gpt-35-turbo (1106)` | `gpt-4-32k (0613)` | `gpt-4 (1106-preview)` | `gpt-4 (0125-preview)` | `gpt-4-32k (0314)`** | `gpt-4 (0613)` | `gpt-4 (0314)`** | `gpt-4o` | `gpt-turbo (409)` |
596-
|------|---|---|---|---|---|----|----|----|----|---|
597-
| Australia East ||||| |||| | |
598-
| Canada East ||||| |||| | |
599-
| East US || | | ||| ||| |
600-
| East US 2 || | || || ||||
601-
| France Central ||||| |||| | |
602-
| Japan East || | | | || || | |
603-
| North Central US || | | ||| ||| |
604-
| Norway East || | || || || | |
605-
| South Central US | | | | ||| ||| |
606-
| South India | || || || || | |
607-
| Sweden Central ||||| |||| ||
608-
| Switzerland North || || | |||| | |
609-
| UK South ||| |||| || | |
610-
| West US | || || || ||| |
611-
612-
** Models are being retired no sooner than 31 July 2024
584+
| Region | `gpt-35-turbo-16k (0613)` | `gpt-35-turbo (1106)` | `gpt-4-32k (0613)` | `gpt-4 (1106-preview)` | `gpt-4 (0125-preview)` | `gpt-4 (0613)` | `gpt-4o` | `gpt-turbo (409)` |
585+
|------|---|---|---|---|---|----|----|----|
586+
| Australia East ||||| || | |
587+
| Canada East ||||| || | |
588+
| East US || | | || || |
589+
| East US 2 || | || | |||
590+
| France Central ||||| || | |
591+
| Japan East || | | | | | | |
592+
| North Central US || | | || || |
593+
| Norway East || | || | | | |
594+
| South Central US | | | | || || |
595+
| South India | || || | | | |
596+
| Sweden Central ||||| || ||
597+
| Switzerland North || || | || | |
598+
| UK South ||| ||| | | |
599+
| West US | || || | || |
613600

614601
If your Azure OpenAI resource is in another region, you won't be able to use Azure OpenAI On Your Data.
615602

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
title: Best practices for using Azure OpenAI On Your Data
3+
titleSuffix: Azure OpenAI
4+
description: Learn about the best practices when using Azure OpenAI On Your data.
5+
ms.service: azure-ai-openai
6+
ms.topic: conceptual
7+
ms.date: 04/08/2024
8+
ms.custom: references_regions, build-2023, build-2023-dataai, refefences_regions
9+
manager: nitinme
10+
author: aahill
11+
ms.author: aahi
12+
recommendations: false
13+
---
14+
15+
# Troubleshooting and best practices for Azure OpenAI On Your Data
16+
17+
Use this article to help you guide through the common issues you might run into while developing a solution using Azure OpenAI On Your Data, a service that allows you to use the power of OpenAI models with your own data. By following the best practices and tips in this article, you can optimize your output with Azure OpenAI On Your Data and achieve the best AI quality possible.
18+
19+
This document covers:
20+
21+
* High level workflow of the Azure OpenAI On Your Data
22+
* How to structure your debugging investigation
23+
* Common issues and their respective solutions
24+
25+
## Azure OpenAI On Your Data: workflow
26+
27+
Azure OpenAI On Your Data's workflow can be divided into two major parts:
28+
29+
* Data ingestion
30+
* Inferencing
31+
32+
## Data ingestion
33+
34+
This is the stage where you connect your data with the Azure OpenAI On Your Data service. In this stage, user documents are processed and broken down into smaller chunks (1,024 tokens by default, however there are more chunking options available) and then indexed. This is the stage where you can choose an embedding model (embeddings are representations of values or objects like text, images, and audio that are designed to be consumed by machine learning models and semantic search algorithms) to use for embeddings creation or preferred search type. The output of this process is an index that will later be used to retrieve documents from during inference.
35+
36+
## Inferencing
37+
38+
This is the stage where users chat with their data using a studio, deployed webapp, or direct API calls. In this stage users are able to set various model parameters (such as `temperature`, or `top_P` ) and system parameters such as `strictness`, and `topNDocuments`.
39+
40+
## Inner workings
41+
42+
Ingestion should be thought of as a separate process before inference. After the index has been created, Azure OpenAI On Your Data has many steps it goes through to generate a good response to user questions.
43+
44+
1. **Intent generation**: Multiple search intents are generated using user question and conversation history. We generate multiple search intents to address any ambiguity in the user's question, add more context using the conversation history to retrieve holistic information in the retrieval stage, and to provide any additional information to make the final response thorough and useful.
45+
2. **Retrieval**: Using the search type provided during the ingestion, a list of relevant document chunks are retrieved corresponding to each of the search intents.
46+
3. **Filtration**: The strictness setting is used to filter out the retrieved documents that are considered irrelevant per the strictness threshold. `strictness` controls how aggressive the filtration is.
47+
4. **Re-ranking**: The remaining document chunks retrieved for each of the search intents are reranked. Reranking is done to come up with a combined list of most relevant documents retrieved for all search intents.
48+
5. **TopNDocuments**: The `topNDocuments` from this reranked list is included in the prompt sent to the model, along with the question, the conversation history, and the role information/system message.
49+
1. **Response Generation**: The model uses the provided context to generate the final response along with citations.
50+
51+
## How to structure debugging investigation
52+
53+
When you see an unfavorable response to a query, it could be the result of different outputs from various components not working as expected. It's advisable to debug the outputs of each component using the following steps.
54+
55+
### Step 1: Check for Retrieval issues
56+
57+
Check if the correct document chunks are present in the retrieved documents. This is straight forward to check using the REST API. In the API response, check the citations in the `tool` message.
58+
59+
### Step 2: Check for Generation issues
60+
61+
If you're seeing the correct document chunks in the retrieved documents, then you're likely encountering a **generation issue**. Consider using a more powerful model. If you aren't, go to [step 3](#step-3-check-the-rest-of-the-funnel).
62+
63+
1. **Upgrade the model**: For example, if you're using gpt-35-turbo, consider using gpt-4.
64+
1. **Switch the model version**: If you're using gpt-35-turbo-1106, consider using gpt-35-turbo-16k (0613).
65+
1. You can also tune the finer aspects of the response by changing the role information / system message.
66+
67+
### Step 3: Check the rest of the funnel
68+
69+
If you aren't seeing the correct document chunks in step 1, then you need to dig further down the funnel.
70+
71+
1. It's possible that the correct document chunk was retrieved but was filtered out based on `strictness`. In this case, try reducing the `strictness` parameter.
72+
73+
1. It's possible that the correct document chunk wasn't part of the `topNDocuments`. In this case, increase the `topNDocuments` parameter.
74+
75+
1. It's possible that your index fields are not correctly mapped, meaning retrieval might not work well. This is particularly relevant if you're using a pre-existing data source (you did not create the index using the Studio or offline scripts available on [GitHub](https://github.com/microsoft/sample-app-aoai-chatGPT/tree/main/scripts). For more information on mapping index fields, see the [how-to article](../concepts/use-your-data.md?tabs=ai-search#index-field-mapping).
76+
77+
1. It's possible that the intent generation step isn't working well. In the API response, check the `intents` fields in the `tool` message.
78+
79+
- Some models are known to not work well for intent generation. For example, if you're using the GPT-35-turbo-1106 model version, consider using a later model, such as gpt-35-turbo (0125) or GPT-4-1106-preview.
80+
81+
1. Do you have semi-structured data in your documents, such as numerous tables? There might be an **ingestion issue**. Your data might need special handling during ingestion.
82+
- If the file format is PDF, we offer optimized ingestion for tables using the offline scripts available on [GitHub](https://github.com/microsoft/sample-app-aoai-chatGPT/tree/main/scripts). to use the scripts, you need to have a [Document Intelligence](../../document-intelligence/overview.md) resource and use the `Layout` [model](../../document-intelligence/concept-layout.md). You can also:
83+
- Adjust your chunk size to make sure your largest table fits within the specified [chunk size](../concepts/use-your-data.md#chunk-size-preview).
84+
85+
1. Are you converting a semi-structured data type such as json/xml to a PDF document? This might cause an **ingestion issue** because structured information needs a chunking strategy that is different from purely text content.
86+
87+
1. If none of the above apply, you might be encountering a **retrieval issue**. Consider using a more powerful `query_type`. Based on our benchmarking, `semantic` and `vectorSemanticHybrid` are preferred.
88+
89+
## Frequently encountered issues
90+
91+
**Issue 1**: _The model responds with "The requested information isn't present in the retrieved documents. Please try a different query or topic" even though that's not the case._
92+
93+
See [Step 3](#step-3-check-the-rest-of-the-funnel) in the above debugging process.
94+
95+
**Issue 2**: _The response is from my data, but it isn't relevant/correct in the context of the question._
96+
97+
See the debugging process starting at [Step 1](#step-1-check-for-retrieval-issues).
98+
99+
**Issue 3**: _The role information / system message isn't being followed by the model._
100+
101+
- Instructions in the role information might contradict with our [Responsible AI guidelines](/legal/cognitive-services/openai/overview?context=%2Fazure%2Fai-services%2Fopenai%2Fcontext%2Fcontext), in which case it won't likely be followed.
102+
103+
- For each model, there is an implicit token limit for the role information, beyond which it is truncated. Ensure your role information follows the established [limits](../concepts/use-your-data.md#token-usage-estimation-for-azure-openai-on-your-data).
104+
105+
- A prompt engineering technique you can use is to repeat an important instruction at the end of the prompt. Surrounding the important instruction with `**` on both side of it can also help.
106+
- Upgrade to a newer GPT-4 model as it's likely to follow your instructions better than GPT-35.
107+
108+
**Issue 4**: _There are inconsistencies in responses._
109+
110+
- Ensure you're using a low `temperature`. We recommend setting it to `0`.
111+
112+
- Although the question is the same, the conversation history gets added to the context and affects how the model responds to same question over a long session.
113+
114+
- Using the REST API, check if the search intents generated are the same both times or not. If they are very different, try a more powerful model such as GPT-4 to see if the problem is affected by the chosen model.
115+
116+
- If the intents are same or similar, try reducing `strictness` or increasing `topNDocuments`.
117+
118+
**Issue 5**: _Intents are empty or wrong._
119+
120+
- Refer to [Step 3](#step-3-check-the-rest-of-the-funnel) in the above debugging process.
121+
122+
- If intents are irrelevant, the issue might be that the intent generation step lacks context. It only considers the user question and conversation history. It does not look at the role information or the document chunks. You might want to consider adding a prefix to each user question with a short context string to help the intent generation step.
123+
124+
**Issue 6**: _I have set inScope=true or checked "Restrict responses to my data" but it still responds to Out-Of-Domain questions._
125+
126+
- Consider increasing `strictness`.
127+
- Add the following instruction in your role information / system message:
128+
- _"You are also allowed to respond to questions based on the retrieved documents."_
129+
- The `inscope` parameter isn't a hard switch, but setting it to `true` encourages the model to stay restricted.
130+
131+
**Issue 7**: _The response is correct but occasionally missing document references/citations._
132+
- Consider upgrading to a GPT-4 model if you're already not using it. GPT-4 is generally more consistent with citation generation.
133+
- You can try to emphasize citation generation in the response by adding `**You must generate citation based on the retrieved documents in the response**` in the role information.
134+
- Or you can add a prefix in the user query `**You must generate citation to the retrieved documents in the response to the user question \n User Question: {actual user question}**`

0 commit comments

Comments
 (0)