Skip to content

Tutorial about building, testing, and deployment of a copilot capable of retrieving relevant information from an indexed dataset and delivering accurate, real-time responses to customer inquiries

License

Notifications You must be signed in to change notification settings

deepbiolab/custom-copilot-with-azure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Custom Copilot with Azure

Project Overview

These project instructions will guide you through creating and deploying a custom AI copilot using Azure AI Studio. Follow the steps below carefully, and be sure to complete each deliverable for submission.

In this project, you will:

  1. Create an AI Studio project and hub.
  2. Deploy an AI model and upload product data for indexing.
  3. Build and test a custom copilot app using Prompt Flow.
  4. Evaluate the app with both automated and manual prompt evaluation.
  5. Deploy and test the copilot application.

Step-by-Step Guide

1. Create an AI Studio Hub and Project

  • Log in to Azure AI Studio.

    image-20241121113508200

  • Click Create Project, name your project (outlander-ai-project), and create a new hub (outlander-ai-hub).

    image-20241121114026889
  • When we first time create this project and not create hub yet, after click Customize, we will customize below settings. For key settings in below you can custom by the instruction.

    image-20241121114734878

  • Leave default configurations unless necessary adjustments are needed(below is my settings), and click Next in below.

    image-20241121120802182

  • Ensure you have an Azure AI Search service for indexing data. And finally review the information and click Create

    image-20241121114944714

    image-20241121115535949

2. Deploy an AI Model

  • With your project selected, go to Models + endpoints.

    image-20241121121410538

  • Click +Deploy Model, choose a base model like gpt-4o, and confirm the deployment.

    image-20241121121625966

    image-20241121121722867

    image-20241121121906334

    image-20241121122431637

    image-20241121122651808

3. Upload Product Data to Azure AI Studio

  • Download and unzip the product-info.zip from this GitHub link.

  • In AI Studio, select the Data + indexes blade and click +New Data.

    image-20241121122847180

  • Upload the unzipped product data files or connect to your storage account if preferred.

    image-20241121123005228

    image-20241121123215337

    image-20241121123325596

  • After upload files, you can see the files structure in Data + indexes panel.

    image-20241121123456693

4. Create an AI Search Index

  • Create a Embedding model, we can transform the document (uploaded above) to dense embedding which we can use it in RAG system later. Like procedure created for gpt-4o, we choose Models + endpoints >>> Deploy model >>> Deploy base model in sequentially, and choose text-embedding-ada-002 model to create.

    image-20241121124142845

  • Still you can custom below settings, but i leave here by default and click Deploy

    image-20241121124343536

  • After deployed, we can see the model in the service we created before.

    image-20241121124541818

  • Go to the Data + indexes blade and click +New Index after Indexes

    image-20241121124755977

    image-20241121124924496

  • Select Data in Azure AI Studio as the data source, choose the uploaded data, and proceed.

    image-20241121125015098

    image-20241121125303308

    image-20241121125542058

  • Choose your deployed model for text embeddings and create the index.

    image-20241121125757914

    image-20241121125851637

    image-20241121133104319

5. Build the Copilot App

  • Navigate to the Chat blade under Project Playground.

    image-20241121133250989

  • Select your deployed model and add your data by choosing the created index.

    image-20241121133509986

    image-20241121133644108

  • Click Prompt Flow, name your flow (e.g., Outlander AI Copilot), and open it.

    image-20241121133858092

    image-20241121133930169

  • Review and understand the default components, such as data retrieval and response generation.

    image-20241121135138303

6. Test the Copilot

  • Start a compute session by clicking Start compute session.

    image-20241121140303726

  • Test the copilot by entering sample questions such as:

    Below questions basically stick with the documents we uploaded, so ideally it will reply the relevant response based the document that is purpose of RAG.

    • How much do the TrailWalker Hiking Shoes cost?

      test01

    • Which tent is the most waterproof?

      test02

    • Can the warranty for TrailBlaze pants be transferred?

      test03

  • After test, click Save for this copilot.

7. Perform Automated Prompt Evaluation

  • Create a JSONL or CSV file with evaluation questions and answers (see below for format).

    Sample Evaluation Data (JSONL format)

    {"chat_input": "Which tent is the most waterproof?", 
    "truth": "The Alpine Explorer Tent has the highest rainfly waterproof rating at 3000m", 
    "chat_history": []}
    {"chat_input": "How much do the TrailWalker Hiking Shoes cost?", 
    "truth": "The TrailWalker Hiking Shoes are priced at $110", 
    "chat_history": []}
    

    Sample Evaluation Data (CSV format)

    chat_input truth chat_history
    Which tent is the most waterproof? The Alpine Explorer Tent has the highest rainfly waterproof rating at 3000m []
    How much do the TrailWalker Hiking Shoes cost? The TrailWalker Hiking Shoes are priced at $110 []
  • In Prompt Flow, click Evaluate, choose Automated evaluation, and then and use your dataset.

    image-20241121142553882

    image-20241121142724140

    image-20241121143218630

  • Map inputs and outputs and Submit on the next page and then run the evaluation.

    image-20241121143617316

    image-20241121144300055

8. Manual Prompt Evaluation

  • Go to Evaluation in AI Studio and Create a Manual evaluations

    image-20241121144618653

  • Add questions and expected responses and run evaluations, right here I only add one.

    • Input: How much do the TrailWalker Hiking Shoes cost?
    • Expected response: The TrailWalker Hiking Shoes are priced at $110.

    image-20241121144810236

  • After run, you can provide feedback using thumbs up or down for the response. image-20241121145131253

9. Deploy the Copilot

  • In Prompt Flow, click Deploy and name the deployment.

    image-20241121145320570

    image-20241121145504522

  • Verify the deployment details and create, finally you will see the created endpoint in below image.

    image-20241121150106569

  • Finally, click the created endpoint outlander-ai-project-znsmp-1 and you will see ready-to-use deployment info

    image-20241121151529198

  • And we can test some question.

    image-20241121152034536

🎉Good luck, and enjoy building your custom Azure AI copilot✨!

About

Tutorial about building, testing, and deployment of a copilot capable of retrieving relevant information from an indexed dataset and delivering accurate, real-time responses to customer inquiries

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published