Skip to content

Commit 255ce43

Browse files
committed
Dan's code updates
1 parent 211996e commit 255ce43

File tree

5 files changed

+58
-22
lines changed

5 files changed

+58
-22
lines changed

articles/ai-studio/includes/install-cli.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ You can follow instructions [How to install the Azure CLI](/cli/azure/install-az
3838
After you install the Azure CLI, sign in using the ``az login`` command and sign-in using the browser:
3939
```
4040
az login
41-
4241
```
4342
Alternatively, you can log in manually via the browser with a device code.
4443
```

articles/ai-studio/quickstarts/get-started-code.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ ms.author: sgilley
1212
author: sdgilley
1313
---
1414

15-
# Build a custom chat app in Python using Azure AI Foundry SDK
15+
# Build a basic chat app in Python using Azure AI Foundry SDK
1616

1717
[!INCLUDE [feature-preview](../includes/feature-preview.md)]
1818

19-
In this quickstart, we walk you through setting up your local development environment with the prompt flow SDK. We write a prompt, run it as part of your app code, trace the LLM calls being made, and run a basic evaluation on the outputs of the LLM.
19+
In this quickstart, we walk you through setting up your local development environment with the Azure AI Foundry SDK. We write a prompt, run it as part of your app code, trace the LLM calls being made, and run a basic evaluation on the outputs of the LLM.
2020

2121
## Prerequisites
2222

@@ -93,4 +93,4 @@ python chat.py
9393
## Next step
9494

9595
> [!div class="nextstepaction"]
96-
> [Add data and use retrieval augmented generation (RAG) to build a custom chat app](../tutorials/copilot-sdk-build-rag.md)
96+
> [Add data and use retrieval augmented generation (RAG) to build a custom chat app](../tutorials/copilot-sdk-create-resources.md)

articles/ai-studio/tutorials/copilot-sdk-build-rag.md

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
title: "Part 2: Build a custom chat app with the Azure AI Foundry SDK"
2+
title: "Part 2: Build a ca custom knowledge retrieval (RAG) app with the Azure AI Foundry SDK"
33
titleSuffix: Azure AI Studio
44
description: Learn how to build a RAG-based chat app using the Azure AI Foundry SDK. This tutorial is part 2 of a 3-part tutorial series.
55
manager: scottpolly
66
ms.service: azure-ai-studio
77
ms.topic: tutorial
8-
ms.date: 11/03/2024
8+
ms.date: 11/11/2024
99
ms.reviewer: lebaro
1010
ms.author: sgilley
1111
author: sdgilley
1212
ms.custom: [copilot-learning-hub]
1313
#customer intent: As a developer, I want to learn how to use the prompt flow SDK so that I can build a RAG-based chat app.
1414
---
1515

16-
# Tutorial: Part 2 - Build a custom chat application with the Azure AI Foundry SDK
16+
# Tutorial: Part 2 - Build a custom knowledge retrieval (RAG) app with the Azure AI Foundry SDK
1717

1818
In this tutorial, you use the Azure AI Foundry SDK (and other libraries) to build, configure, evaluate, and deploy a chat app for your retail company called Contoso Trek. Your retail company specializes in outdoor camping gear and clothing. The chat app should answer questions about your products and services. For example, the chat app can answer questions such as "which tent is the most waterproof?" or "what is the best sleeping bag for cold weather?".
1919

@@ -49,8 +49,21 @@ The search index is used to store vectorized data from the embeddings model. The
4949

5050
1. Create the file **create_search_index.py** in your main folder (that is, the same directory where you placed your **assets** folder, not inside the **assets** folder).
5151
1. Copy and paste the following code into your **create_search_index.py** file.
52+
1. Add the code to import the required libraries, create a project client, and configure some settings:
5253

53-
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/create_search_index.py":::
54+
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/create_search_index.py" id="imports_and_config":::
55+
56+
1. Now add the function to define a search index:
57+
58+
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/create_search_index.py" id="create_search_index":::
59+
60+
1. Create the function to add a csv file to the index:
61+
62+
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/create_search_index.py" id="add_csv_to_index":::
63+
64+
1. Finally, run the functions to build the index and register it to the cloud project:
65+
66+
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/create_search_index.py" id="test_create_index":::
5467

5568
1. From your console, log in to your Azure account and follow instructions for authenticating your account:
5669

@@ -71,15 +84,25 @@ The search index is used to store vectorized data from the embeddings model. The
7184

7285
## <a name="get-documents"></a> Get product documents
7386

74-
Next, you create a script to get product documents from the search index. The script uses the Azure AI SDK to query the search index for documents that match a user's question.
87+
Next, you create a script to get product documents from the search index. The script queries the search index for documents that match a user's question.
7588
7689
### Create script to get product documents
7790
7891
When the chat gets a request, it searches through your data to find relevant information. This script uses the Azure AI SDK to query the search index for documents that match a user's question. It then returns the documents to the chat app.
7992

80-
Create the **get_product_documents.py** file in your main directory. Copy and paste the following code into the file.
93+
1. Create the **get_product_documents.py** file in your main directory. Copy and paste the following code into the file.
94+
95+
1. Start with code to import the required libraries, create a project client, and configure settings:
8196

82-
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/get_product_documents.py":::
97+
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/get_product_documents.py" id="imports_and_config":::
98+
99+
1. Add the function to get product documents:
100+
101+
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/get_product_documents.py" id="get_product_documents":::
102+
103+
1. Finally, add code to test the function when you run the script directly:
104+
105+
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/get_product_documents.py" id="test_get_documents":::
83106

84107
### Create prompt template for intent mapping
85108

@@ -103,9 +126,18 @@ Next you create custom code to add retrieval augmented generation (RAG) capabili
103126
104127
### Create a chat script with RAG capabilities
105128
106-
In your main folder, create a new file called **chat_with_products.py**. This script uses the Azure AI SDK to retrieve product documents and generate a response to a user's question.
129+
1. In your main folder, create a new file called **chat_with_products.py**. This script retrieves product documents and generates a response to a user's question.
130+
1. Add the code to import the required libraries, create a project client, and configure settings:
131+
132+
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/chat_with_products.py" id="imports_and_config":::
133+
134+
1. Create the chat function that uses the RAG capabilities:
135+
136+
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/chat_with_products.py" id="chat_function":::
107137

108-
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/chat_with_products.py":::
138+
1. Finally, add the code to run the chat function:
139+
140+
:::code language="python" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/chat_with_products.py" id="test_function":::
109141

110142
### Create a grounded chat prompt template
111143

articles/ai-studio/tutorials/copilot-sdk-create-resources.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
title: "Part 1: Create resources to build a custom chat app"
2+
title: "Part 1: Set up project and development environment to build a a custom knowledge retrieval (RAG) app"
33
titleSuffix: Azure AI Studio
44
description: Build a custom chat app using the Azure AI Foundry SDK. Part 1 of a 3-part tutorial series, which shows how to create the resources you'll need for parts 2 and 3.
55
manager: scottpolly
66
ms.service: azure-ai-studio
77
ms.topic: tutorial
8-
ms.date: 11/03/2024
8+
ms.date: 11/11/2024
99
ms.reviewer: lebaro
1010
ms.author: sgilley
1111
author: sdgilley
1212
#customer intent: As a developer, I want to learn how to use the prompt flow SDK so that I can build a RAG-based chat app.
1313
---
1414

15-
# Tutorial: Part 1 - Create resources for building a custom chat application with the Azure AI Foundry SDK
15+
# Tutorial: Part 1 - Set up project and development environment to build a custom knowledge retrieval (RAG) app with the Azure AI Foundry SDK
1616

1717

18-
In this tutorial, you use the Azure AI SDK (and other libraries) to build, configure, evaluate, and deploy a chat app for your retail company called Contoso Trek. Your retail company specializes in outdoor camping gear and clothing. The chat app should answer questions about your products and services. For example, the chat app can answer questions such as "which tent is the most waterproof?" or "what is the best sleeping bag for cold weather?".
18+
In this tutorial, you use the Azure AI Foundry SDK (and other libraries) to build, configure, evaluate, and deploy a chat app for your retail company called Contoso Trek. Your retail company specializes in outdoor camping gear and clothing. The chat app should answer questions about your products and services. For example, the chat app can answer questions such as "which tent is the most waterproof?" or "what is the best sleeping bag for cold weather?".
1919

2020
This tutorial is part one of a three-part tutorial. This part one gets you ready to write code in part two and evaluate your chat app in part three. In this part, you:
2121

@@ -95,10 +95,16 @@ In the Azure AI Studio, check for an Azure AI Search connected resource.
9595

9696
## Install packages
9797

98-
* Install `azure-ai-projects`(preview) and `azure-ai-inference` (preview), along with other required packages.
98+
Install `azure-ai-projects`(preview) and `azure-ai-inference` (preview), along with other required packages.
99+
100+
1. First, create a file named **requirements.txt** in your project folder. Add the following packages to the file:
101+
102+
:::code language="txt" source="~/azureai-samples-nov2024/scenarios/rag/custom-rag-app/requirements.txt":::
103+
104+
1. Install the required packages:
99105

100106
```bash
101-
pip install azure-ai-projects azure-ai-inference azure-ai-identity azure-search-documents pandas python-dotenv
107+
pip install -r requirements.txt
102108
```
103109

104110
### Create helper script

articles/ai-studio/tutorials/copilot-sdk-evaluate.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: "Part 3: Evaluate chat app with the Azure AI Foundry SDK"
2+
title: "Part 3: Evaluate and deploy chat app with the Azure AI SDK"
33
titleSuffix: Azure AI Studio
44
description: Evaluate and deploy a custom chat app with the prompt flow SDK. This tutorial is part 3 of a 3-part tutorial series.
55
manager: scottpolly
66
ms.service: azure-ai-studio
77
ms.topic: tutorial
8-
ms.date: 11/11/2024
8+
ms.date: 11/06/2024
99
ms.reviewer: lebaro
1010
ms.author: sgilley
1111
author: sdgilley
@@ -49,7 +49,6 @@ Use the following evaluation dataset, which contains example questions and expec
4949

5050
Now define an evaluation script that will:
5151

52-
5352
- Generate a target function wrapper around our chat app logic.
5453
- Load the sample `.jsonl` dataset.
5554
- Run the evaluation, which takes the target function, and merges the evaluation dataset with the responses from the chat app.

0 commit comments

Comments
 (0)