Skip to content

Commit 16a0ec6

Browse files
committed
Merge branch 'main' into visionv2
2 parents ea3ee28 + 10904b6 commit 16a0ec6

File tree

100 files changed

+1033
-257
lines changed

Some content is hidden

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

100 files changed

+1033
-257
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This template, the application code and configuration it contains, has been buil
5151

5252
[📺 Watch a video overview of the app.](https://youtu.be/3acB0OWmLvM)
5353

54-
This sample demonstrates a few approaches for creating ChatGPT-like experiences over your own data using the Retrieval Augmented Generation pattern. It uses Azure OpenAI Service to access a GPT model (gpt-4o-mini), and Azure AI Search for data indexing and retrieval.
54+
This sample demonstrates a few approaches for creating ChatGPT-like experiences over your own data using the Retrieval Augmented Generation pattern. It uses Azure OpenAI Service to access a GPT model (gpt-4.1-mini), and Azure AI Search for data indexing and retrieval.
5555

5656
The repo includes sample data so it's ready to try end to end. In this sample application we use a fictitious company called Contoso Electronics, and the experience allows its employees to ask questions about the benefits, internal policies, as well as job descriptions and roles.
5757

@@ -258,9 +258,11 @@ You can find extensive documentation in the [docs](docs/README.md) folder:
258258
- [Multimodal](docs/multimodal.md)
259259
- [Reasoning](docs/reasoning.md)
260260
- [Private endpoints](docs/deploy_private.md)
261+
- [Agentic retrieval](docs/agentic_retrieval.md)
261262
- [Sharing deployment environments](docs/sharing_environments.md)
262263
- [Local development](docs/localdev.md)
263264
- [Customizing the app](docs/customization.md)
265+
- [HTTP Protocol](docs/http_protocol.md)
264266
- [Data ingestion](docs/data_ingestion.md)
265267
- [Evaluation](docs/evaluation.md)
266268
- [Safety evaluation](docs/safety_evaluation.md)

app/backend/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ pyjwt==2.10.1
342342
# via
343343
# -r requirements.in
344344
# msal
345-
pymupdf==1.25.1
345+
pymupdf==1.26.0
346346
# via -r requirements.in
347347
pypdf==4.3.1
348348
# via -r requirements.in
@@ -398,7 +398,7 @@ types-html5lib==1.1.11.20241018
398398
# via types-beautifulsoup4
399399
types-pillow==10.2.0.20240822
400400
# via -r requirements.in
401-
typing-extensions==4.12.2
401+
typing-extensions==4.13.2
402402
# via
403403
# -r requirements.in
404404
# azure-ai-documentintelligence

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ These are advanced topics that are not necessary for a basic deployment.
1414
- [Login and access control](login_and_acl.md)
1515
- [GPT-4 Turbo with Vision](gpt4v.md)
1616
- [Private endpoints](deploy_private.md)
17+
- [Agentic retrieval](agentic_retrieval.md)
1718
- [Sharing deployment environments](sharing_environments.md)
1819
- [Local development](localdev.md)
1920
- [Customizing the app](customization.md)
21+
- [HTTP Protocol](http_protocol.md)
22+
- [Data ingestion](data_ingestion.md)
2023
- [Evaluation](docs/evaluation.md)
2124
- [Safety evaluation](safety_evaluation.md)
22-
- [Data ingestion](data_ingestion.md)
2325
- [Monitoring with Application Insights](monitoring.md)
2426
- [Productionizing](productionizing.md)
2527
- [Alternative RAG chat samples](other_samples.md)

docs/agentic_retrieval.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ See the agentic retrieval documentation.
1010

1111
### Prerequisites
1212

13-
* A deployment of any of the supported agentic retrieval models in the [supported regions](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#standard-deployment-model-availability). If you're not sure, try to create a gpt-4o-mini deployment from your Azure OpenAI deployments page.
13+
* A deployment of any of the supported agentic retrieval models in the [supported regions](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#standard-deployment-model-availability). If you're not sure, try to create a gpt-4.1-mini deployment from your Azure OpenAI deployments page.
1414

1515
### Deployment
1616

@@ -24,14 +24,14 @@ See the agentic retrieval documentation.
2424

2525
2. **(Optional) Set the agentic retrieval model**
2626

27-
You can configure which model agentic retrieval uses. By default, gpt-4o-mini is used
27+
You can configure which model agentic retrieval uses. By default, gpt-4.1-mini is used.
2828

29-
For gpt-4o:
29+
To change the model, set the following environment variables appropriately:
3030

3131
```shell
3232
azd env set AZURE_OPENAI_SEARCHAGENT_DEPLOYMENT searchagent
33-
azd env set AZURE_OPENAI_SEARCHAGENT_MODEL gpt-4o
34-
azd env set AZURE_OPENAI_SEARCHAGENT_MODEL_VERSION 2024-11-20
33+
azd env set AZURE_OPENAI_SEARCHAGENT_MODEL gpt-4.1-mini
34+
azd env set AZURE_OPENAI_SEARCHAGENT_MODEL_VERSION 2025-04-14
3535
```
3636

3737
3. **Update the infrastructure and application:**

docs/customization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The frontend is built using [React](https://reactjs.org/) and [Fluent UI compone
2828

2929
## Customizing the backend
3030

31-
The backend is built using [Quart](https://quart.palletsprojects.com/), a Python framework for asynchronous web applications. The backend code is stored in the `app/backend` folder. The frontend and backend communicate using the [AI Chat HTTP Protocol](https://aka.ms/chatprotocol).
31+
The backend is built using [Quart](https://quart.palletsprojects.com/), a Python framework for asynchronous web applications. The backend code is stored in the `app/backend` folder. The frontend and backend communicate over HTTP using JSON or streamed NDJSON responses. Learn more in the [HTTP Protocol guide](http_protocol.md).
3232

3333
### Chat/Ask tabs
3434

@@ -46,7 +46,7 @@ The prompts are currently tailored to the sample data since they start with "Ass
4646

4747
##### Chat with vision
4848

49-
If you followed the instructions in [docs/gpt4v.md](gpt4v.md) to enable a GPT Vision model and then select "Use GPT vision model", then the chat tab will use the `chatreadretrievereadvision.py` approach instead. This approach is similar to the `chatreadretrieveread.py` approach, with a few differences:
49+
If you followed the instructions in [the GPT vision guide](gpt4v.md) to enable the vision approach and the "Use GPT vision model" option is selected, then the chat tab will use the `chatreadretrievereadvision.py` approach instead. This approach is similar to the `chatreadretrieveread.py` approach, with a few differences:
5050

5151
1. Step 1 is the same as before, except it uses the GPT-4 Vision model instead of the default GPT-3.5 model.
5252
2. For this step, it also calculates a vector embedding for the user question using [the Computer Vision vectorize text API](https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/image-retrieval#call-the-vectorize-text-api), and passes that to the Azure AI Search to compare against the `imageEmbeddings` fields in the indexed documents. For each matching document, it downloads the image blob and converts it to a base 64 encoding.
@@ -65,7 +65,7 @@ The prompt for step 2 is currently tailored to the sample data since it starts w
6565

6666
#### Ask with vision
6767

68-
If you followed the instructions in [docs/gpt4v.md](gpt4v.md) to enable the GPT-4 Vision model and then select "Use GPT vision model", then the ask tab will use the `retrievethenreadvision.py` approach instead. This approach is similar to the `retrievethenread.py` approach, with a few differences:
68+
If you followed the instructions in [the GPT vision guide](gpt4v.md) to enable the vision approach and the "Use GPT vision model" option is selected, then the ask tab will use the `retrievethenreadvision.py` approach instead. This approach is similar to the `retrievethenread.py` approach, with a few differences:
6969

7070
1. For this step, it also calculates a vector embedding for the user question using [the Computer Vision vectorize text API](https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/image-retrieval#call-the-vectorize-text-api), and passes that to the Azure AI Search to compare against the `imageEmbeddings` fields in the indexed documents. For each matching document, it downloads the image blob and converts it to a base 64 encoding.
7171
2. When it combines the search results and user question, it includes the base 64 encoded images, and sends along both the text and images to the GPT4 Vision model (similar to this [documentation example](https://platform.openai.com/docs/guides/vision/quick-start)). The model generates a response that includes citations to the images, and the UI renders the base64 encoded images when a citation is clicked.

docs/deploy_existing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ You should set these values before running `azd up`. Once you've set them, retur
2626
1. Run `azd env set AZURE_OPENAI_SERVICE {Name of existing OpenAI service}`
2727
1. Run `azd env set AZURE_OPENAI_RESOURCE_GROUP {Name of existing resource group that OpenAI service is provisioned to}`
2828
1. Run `azd env set AZURE_OPENAI_LOCATION {Location of existing OpenAI service}`
29-
1. Run `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT {Name of existing chat deployment}`. Only needed if your chat deployment name is not the default 'gpt-4o-mini'.
30-
1. Run `azd env set AZURE_OPENAI_CHATGPT_MODEL {Model name of existing chat deployment}`. Only needed if your chat model is not the default 'gpt-4o-mini'.
29+
1. Run `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT {Name of existing chat deployment}`. Only needed if your chat deployment name is not the default 'gpt-4.1-mini'.
30+
1. Run `azd env set AZURE_OPENAI_CHATGPT_MODEL {Model name of existing chat deployment}`. Only needed if your chat model is not the default 'gpt-4.1-mini'.
3131
1. Run `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION {Version string for existing chat deployment}`. Only needed if your chat deployment model version is not the default '2024-07-18'. You definitely need to change this if you changed the model.
3232
1. Run `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU {Name of SKU for existing chat deployment}`. Only needed if your chat deployment SKU is not the default 'Standard', like if it is 'GlobalStandard' instead.
3333
1. Run `azd env set AZURE_OPENAI_EMB_DEPLOYMENT {Name of existing embedding deployment}`. Only needed if your embeddings deployment is not the default 'embedding'.

docs/deploy_features.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You should typically enable these features before running `azd up`. Once you've
2424

2525
## Using different chat completion models
2626

27-
As of late March 2025, the default chat completion model is `gpt-4o-mini`. If you deployed this sample before that date, the default model is `gpt-3.5-turbo`. You can change the chat completion model to any Azure OpenAI chat model that's available in your Azure OpenAI resource region by following these steps:
27+
As of early June 2025, the default chat completion model is `gpt-4.1-mini`. If you deployed this sample before that date, the default model is `gpt-3.5-turbo` or `gpt-4o-mini`. You can change the chat completion model to any Azure OpenAI chat model that's available in your Azure OpenAI resource region by following these steps:
2828

2929
1. To set the name of the deployment, run this command with a unique name in your Azure OpenAI account. You can use any deployment name, as long as it's unique in your Azure OpenAI account. For convenience, many developers use the same deployment name as the model name, but this is not required.
3030

@@ -40,24 +40,30 @@ As of late March 2025, the default chat completion model is `gpt-4o-mini`. If yo
4040

4141
1. To set the GPT model to a different [available model](https://learn.microsoft.com/azure/ai-services/openai/concepts/models), run this command with the appropriate model name.
4242

43-
For GPT-4:
43+
For gpt-4.1-mini:
4444

4545
```bash
46-
azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-4
46+
azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-4.1-mini
4747
```
4848

49-
For GPT-4o:
49+
For gpt-4o:
5050

5151
```bash
5252
azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-4o
5353
```
5454

55-
For GPT-4o mini:
55+
For gpt-4o mini:
5656

5757
```bash
5858
azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-4o-mini
5959
```
6060

61+
For gpt-4:
62+
63+
```bash
64+
azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-4
65+
```
66+
6167
For gpt-3.5-turbo:
6268

6369
```bash
@@ -66,24 +72,30 @@ As of late March 2025, the default chat completion model is `gpt-4o-mini`. If yo
6672

6773
1. To set the Azure OpenAI model version from the [available versions](https://learn.microsoft.com/azure/ai-services/openai/concepts/models), run this command with the appropriate version string.
6874

69-
For GPT-4:
75+
For gpt-4.1-mini:
7076

7177
```bash
72-
azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION turbo-2024-04-09
78+
azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION 2025-04-14
7379
```
7480

75-
For GPT-4o:
81+
For gpt-4o:
7682

7783
```bash
7884
azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION 2024-05-13
7985
```
8086

81-
For GPT-4o mini:
87+
For gpt-4o mini:
8288

8389
```bash
8490
azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION 2024-07-18
8591
```
8692

93+
For gpt-4:
94+
95+
```bash
96+
azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION turbo-2024-04-09
97+
```
98+
8799
For gpt-3.5-turbo:
88100

89101
```bash

docs/gpt4v.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ For more details on how this feature works, read [this blog post](https://techco
2323
* The ability to deploy a gpt-4o model in the [supported regions](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#standard-deployment-model-availability). If you're not sure, try to create a gpt-4o deployment from your Azure OpenAI deployments page.
2424
* Ensure that you can deploy the Azure OpenAI resource group in [a region and deployment SKU where all required components are available](https://learn.microsoft.com/azure/cognitive-services/openai/concepts/models#model-summary-table-and-region-availability):
2525
* Azure OpenAI models
26-
* gpt-4o-mini
26+
* gpt-4.1-mini
2727
* text-embedding-3-large
2828
* gpt-4o (for vision/evaluation features)
2929
* [Azure AI Vision](https://learn.microsoft.com/azure/ai-services/computer-vision/)

0 commit comments

Comments
 (0)