课程: Build Prompt Flows with Azure AI Foundry
Use your data in prompt flow
- [Instructor] You can gain insights from your data in Prompt Flow. This feature is based on an architecture approach known as retrieval-augmented generation, or RAG. It enables an AI model to generate answers specific to your custom data. For example, here's a demo Excel file, which has a list of California tour packages with information like package name, duration, price, group discount rate, and a departing city. Based on this custom document, we can use Prompt Flow to help users find suitable tour packages. Now let's see how it works. Here's the Prompt Flow module in the Azure AI Foundry portal. Click Create to add a new flow. Instead of starting from scratch this time, I will clone the flow from the gallery. Choose the chat flow Multi-Round Q&A on your Data. Click Clone. I'll keep the folder name as it is. Click Clone. In the graph, a chat flow is created with inputs, outputs, and several tools, including LLM, index lookup, Python, and a prompt. We will use the index lookup tool to connect to our custom data later. Let's first configure the connection settings for the LLM tools. Choose the modify query with history node in the graph. In the flow tab, I will choose my Azure OpenAI Service connection. Set the API for chat, choose the deployment name, GPT-4o. Set the maximum tokens as 1,000. I'll do a similar setup for the chat with context node. Choose my Azure OpenAI Service connection. Select the API for chat, choose the deployment name, GPT-40, and set the maximum tokens as 1,000. Next, I will configure the index lookup node. In this demo, I will use the vector index provided by Azure AI Search service. To add an Azure AI Search index, I will click data plus indexes in the menu. Click Indexes, then click New Index. Choose the location of the input data. I will select Upload Files. Click Upload to upload my sample Excel file. Click Open, click Next. Click the link to create a new Azure AI Search resource. It will open the Azure portal to create a search service. I will use the existing resource group. Enter the service name. Select the location, is the US. For the pricing tier, I can change the pricing tier. For demo purposes, I will choose B, basic. Click Select, click Next, click Review plus Create. Click Create. After the AI search service is created, go back to the index settings page in Azure AI Foundry portal. Under Select Azure AI Search Service, select connect other Azure AI search resource. I can see the newly created Azure AI Search service. Click Add Connection. I'll enter the vector index name, index-tour-packages. Click Next, then click Next. Finally, click Create Vector Index. It may take a while to create the index. You can click Refresh to view the current progress. After the status becomes completed, return to the Prompt Flow. Click Start Compute Session in the top menu. Wait until the session status becomes running. Choose the lookup index node. Click the value field of the ML index content. For the index type, select the Azure AI Search. Select the index connection, the index name, the content field, the embedding field, the metadata field, the semantic configuration, the embedding type, the embedding connection, and then deploy the embedding model. Click Save. In the settings of the lookup index node, select the query type as hybrid vector plus keyword. Click save in the menu to save my changes. Finally, let's test this chat flow. Click Chat in the top menu. Click to start a new session. In the chat interface, enter find California tour packages priced under $200. It shows the matched packages. Let me ask a more complex question. Find some California tour packages. I'm looking for a three day tour priced under $550, and offering a group discount of 15% or more. The Prompt Flow finds the answer for me.
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。