Skip to content

Commit

Permalink
Merge pull request #251 from nitya/main
Browse files Browse the repository at this point in the history
refactor / updated model references
  • Loading branch information
nitya authored Feb 27, 2025
2 parents 69200cb + 3f560c6 commit 7fa5612
Show file tree
Hide file tree
Showing 40 changed files with 264 additions and 334 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ products:
- azure-cognitive-search
- azure-cosmos-db
urlFragment: contoso-chat
name: Contoso Chat - Retail RAG Copilot with Azure AI Studio and Prompty (Python Implementation)
name: Contoso Chat - Retail RAG Copilot with Azure AI Foundry and Prompty (Python Implementation)
description: Build, evaluate, and deploy, a RAG-based retail copilot that responds to customer questions with responses grounded in the retailer's product and customer data.
---
<!-- YAML front-matter schema: https://review.learn.microsoft.com/en-us/help/contribute/samples/process/onboarding?branch=main#supported-metadata-fields-for-readmemd -->


# Contoso Chat: Retail RAG Copilot with Azure AI Studio and Prompty
# Contoso Chat: Retail RAG Copilot with Azure AI Foundry and Prompty

[![Open in GitHub Codespaces](https://img.shields.io/static/v1?style=for-the-badge&label=GitHub+Codespaces&message=Open&color=brightgreen&logo=github)](https://github.com/codespaces/new?hide_repo_select=true&machine=basicLinux32gb&repo=725257907&ref=main&devcontainer_path=.devcontainer%2Fdevcontainer.json&geo=UsEast)
[![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/azure-samples/contoso-chat)
Expand Down Expand Up @@ -102,9 +102,9 @@ To deploy and explore the sample, you will need:
1. An active GitHub account - [Signup for a free account here](https://github.com/signup)
1. Access to Azure OpenAI Services - [Learn about Limited Access here](https://learn.microsoft.com/legal/cognitive-services/openai/limited-access)
1. Access to Azure AI Search - [With Semantic Ranker](https://learn.microsoft.com/en-us/azure/search/semantic-search-overview) (premium feature)
1. Available Quota for: `text-embedding-ada-002`, `gpt-35-turbo`. and `gpt-4`
1. Available Quota for: `text-embedding-ada-002`, `gpt-4o-mini`. and `gpt-4`

We recommend deployments to `swedencentral` or `francecentral` as regions that can support all these models. In addition to the above, you will also need the ability to:
We recommend deployments to `eastus2` or `francecentral` as regions that can support all these models. In addition to the above, you will also need the ability to:
- provision Azure Monitor (free tier)
- provision Azure Container Apps (free tier)
- provision Azure CosmosDB for noSQL (free tier)
Expand Down Expand Up @@ -214,7 +214,7 @@ We can now proceed with next steps - click to expand for detailed instructions.
<details>
<summary> 3️⃣ | Validate the Infrastructure </summary>

1. Visit the [Azure Portal](https://portal.azure.con) - look for the `rg-ENVNAME` resource group created above
1. Visit the [Azure Portal](https://portal.azure.com) - look for the `rg-ENVNAME` resource group created above
1. Click the `Deployments` link in the **Essentials** section - wait till all are completed.
1. Return to `Overview` page - you should see: **35** deployments, **15** resources
1. Click on the `Azure CosmosDB resource` in the list
Expand All @@ -226,7 +226,7 @@ We can now proceed with next steps - click to expand for detailed instructions.
1. Click on the `Azure Container Apps` resource in the list
- Visit the resource detail page - click `Application Url`
- Verify that you see a hosted endpoint with a `Hello World` message on page
1. Next, visit the [Azure AI Studio](https://ai.azure.com) portal
1. Next, visit the [Azure AI Foundry](https://ai.azure.com) portal
- Sign in - you should be auto-logged in with existing Azure credential
- Click on `All Resources` - you should see an `AIServices` and `Hub` resources
- Click the hub resource - you should see an `AI Project` resource listed
Expand Down Expand Up @@ -316,7 +316,7 @@ This template currently uses the following models: `gpt35-turbo`, `gpt-4` and `t

Pricing for services may vary by region and usage and exact costs are hard to determine. You can _estimate_ the cost of this project's architecture with [Azure's pricing calculator](https://azure.microsoft.com/pricing/calculator/) with these services:

- Azure OpenAI - Standard tier, GPT-35-turbo and Ada models. [See Pricing](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/)
- Azure OpenAI - Standard tier, gpt-4, gpt-4o-mini and text-embedding-ada-002 models. [See Pricing](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/)
- Azure AI Search - Basic tier, Semantic Ranker enabled. [See Pricing](https://azure.microsoft.com/en-us/pricing/details/search/)
- Azure Cosmos DB for NoSQL - Serverless, Free Tier. [See Pricing](https://azure.microsoft.com/en-us/pricing/details/cosmos-db/autoscale-provisioned/#pricing)
- Azure Monitor - Serverless, Free Tier. [See Pricing](https://azure.microsoft.com/en-us/pricing/details/monitor/)
Expand Down Expand Up @@ -350,7 +350,7 @@ Have issues or questions about the workshop? Submit [a new issue](https://github
## Resources

1. [Prompty Documentation](https://prompty.ai)
1. [Azure AI Studio Documentation](https://aka.ms/aistudio)
1. [Azure AI Foundry Documentation](https://aka.ms/aistudio)
1. [Develop AI Apps using Azure AI Services](https://aka.ms/ai-apps-docs)
1. [Azure AI Templates with Azure Developer CLI](https://aka.ms/ai-studio/azd-templates)

Expand Down
2 changes: 1 addition & 1 deletion data/manual_info/contoso-manuals-index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"\n",
"client = AIClient.from_config(credential = DefaultAzureCredential())\n",
"\n",
"# Use the same index name when registering the index in AI Studio\n",
"# Use the same index name when registering the index in AI Foundry\n",
"index = build_index(\n",
" output_index_name=index_name,\n",
" vector_store=\"azure_cognitive_search\",\n",
Expand Down
16 changes: 8 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ products:
- azure-cognitive-search
- azure-cosmos-db
urlFragment: contoso-chat
name: Contoso Chat - Retail RAG Copilot with Azure AI Studio and Prompty (Python Implementation)
name: Contoso Chat - Retail RAG Copilot with Azure AI Foundry and Prompty (Python Implementation)
description: Build, evaluate, and deploy, a RAG-based retail copilot that responds to customer questions with responses grounded in the retailer's product and customer data.
---
<!-- YAML front-matter schema: https://review.learn.microsoft.com/en-us/help/contribute/samples/process/onboarding?branch=main#supported-metadata-fields-for-readmemd -->

> [!WARNING]
> **This sample is being actively updated at present and make have breaking changes**. We are refactoring the code to use new Azure AI platform features and moving deployment from Azure AI Studio to Azure Container Apps. We will remove this notice once the migration is complete. Till then, please pause on submitting new issues as codebase is changing.
> **This sample is being actively updated at present and make have breaking changes**. We are refactoring the code to use new Azure AI platform features and moving deployment from Azure AI Foundry to Azure Container Apps. We will remove this notice once the migration is complete. Till then, please pause on submitting new issues as codebase is changing.
>
> **Some of the features used in this repository are in preview.** Preview versions are provided without a service level agreement, and they are not recommended for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/).**

# Contoso Chat: Retail RAG Copilot with Azure AI Studio and Prompty
# Contoso Chat: Retail RAG Copilot with Azure AI Foundry and Prompty

[![Open in GitHub Codespaces](https://img.shields.io/static/v1?style=for-the-badge&label=GitHub+Codespaces&message=Open&color=brightgreen&logo=github)](https://github.com/codespaces/new?hide_repo_select=true&machine=basicLinux32gb&repo=725257907&ref=main&devcontainer_path=.devcontainer%2Fdevcontainer.json&geo=UsEast)
[![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/azure-samples/contoso-chat)
Expand Down Expand Up @@ -108,7 +108,7 @@ To deploy and explore the sample, you will need:
1. An active GitHub account - [Signup for a free account here](https://github.com/signup)
1. Access to Azure OpenAI Services - [Learn about Limited Access here](https://learn.microsoft.com/legal/cognitive-services/openai/limited-access)
1. Access to Azure AI Search - [With Semantic Ranker](https://learn.microsoft.com/en-us/azure/search/semantic-search-overview) (premiun feature)
1. Available Quota for: `text-embedding-ada-002`, `gpt-35-turbo`. and `gpt-4`
1. Available Quota for: `text-embedding-ada-002`, `gpt-4`. and `gpt-4o-mini`

We recommend deployments to `swedencentral` or `francecentral` as regions that can support all these models. In addition to the above, you will also need the ability to:
- provision Azure Monitor (free tier)
Expand Down Expand Up @@ -220,7 +220,7 @@ We can now proceed with next steps - click to expand for detailed instructions.
<details>
<summary> 3️⃣ | Validate the Infrastructure </summary>

1. Visit the [Azure Portal](https://portal.azure.con) - look for the `rg-ENVNAME` resource group created above
1. Visit the [Azure Portal](https://portal.azure.com) - look for the `rg-ENVNAME` resource group created above
1. Click the `Deployments` link in the **Essentials** section - wait till all are completed.
1. Return to `Overview` page - you should see: **35** deployments, **15** resources
1. Click on the `Azure CosmosDB resource` in the list
Expand All @@ -232,7 +232,7 @@ We can now proceed with next steps - click to expand for detailed instructions.
1. Click on the `Azure Container Apps` resource in the list
- Visit the resource detail page - click `Application Url`
- Verify that you see a hosted endpoint with a `Hello World` message on page
1. Next, visit the [Azure AI Studio](https://ai.azure.com) portal
1. Next, visit the [Azure AI Foundry](https://ai.azure.com) portal
- Sign in - you should be auto-logged in with existing Azure credential
- Click on `All Resources` - you should see an `AIServices` and `Hub` resources
- Click the hub resource - you should see an `AI Project` resource listed
Expand Down Expand Up @@ -322,7 +322,7 @@ This template currently uses the following models: `gpt35-turbo`, `gpt-4` and `t

Pricing for services may vary by region and usage and exact costs are hard to determine. You can _estimate_ the cost of this project's architecture with [Azure's pricing calculator](https://azure.microsoft.com/pricing/calculator/) with these services:

- Azure OpenAI - Standard tier, GPT-35-turbo and Ada models. [See Pricing](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/)
- Azure OpenAI - Global Standard tier, gpt-4, gpt-4o-mini [See Pricing](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/)
- Azure AI Search - Basic tier, Semantic Ranker enabled. [See Pricing](https://azure.microsoft.com/en-us/pricing/details/search/)
- Azure Cosmos DB for NoSQL - Serverless, Free Tier. [See Pricing](https://azure.microsoft.com/en-us/pricing/details/cosmos-db/autoscale-provisioned/#pricing)
- Azure Monitor - Serverless, Free Tier. [See Pricing](https://azure.microsoft.com/en-us/pricing/details/monitor/)
Expand Down Expand Up @@ -358,7 +358,7 @@ Have issues or questions about the workshop? Submit [a new issue](https://github
## Resources

1. [Prompty Documentation](https://prompty.ai)
1. [Azure AI Studio Documentation](https://aka.ms/aistudio)
1. [Azure AI Foundry Documentation](https://aka.ms/aistudio)
1. [Azure AI Templates with Azure Developer CLI](https://aka.ms/ai-studio/azd-templates)


Expand Down
2 changes: 1 addition & 1 deletion docs/workshop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## About Contoso Chat

The Contoso Chat repository provides a reference sample for an Azure AI Architecture and workflow to build a custom RAG-based copilot **code-first** on Azure AI Studio. The sample has been actively used to skill up developers in core Azure AI tools, services, and practices, since its creation in 2023.
The Contoso Chat repository provides a reference sample for an Azure AI Architecture and workflow to build a custom RAG-based copilot **code-first** on Azure AI Foundry. The sample has been actively used to skill up developers in core Azure AI tools, services, and practices, since its creation in 2023.

**The current version (v3) of the sample follows this architecture**.

Expand Down
2 changes: 1 addition & 1 deletion docs/workshop/docs/01-Introduction/02-RAG-Pattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ Let's learn how this design pattern works in the context of our Contoso Chat app

!!! info "The chat model uses prompt to generate a grounded response to user question."

This enhanced prompt is now sent to the Large Language "chat" model (e.g., Azure OpenAI `gpt-35-turbo` or `gpt-4o`) which sees the enhanced prompt (retrieved documents, customer profile data, chat history) as _grounding_ context for generating the final response, improving the quality (e.g., relevance, groundedness) of results returned from Contoso Chat.
This enhanced prompt is now sent to the Large Language "chat" model (e.g., Azure OpenAI `gpt-4` or `gpt-4o-mini`) which sees the enhanced prompt (retrieved documents, customer profile data, chat history) as _grounding_ context for generating the final response, improving the quality (e.g., relevance, groundedness) of results returned from Contoso Chat.
4 changes: 2 additions & 2 deletions docs/workshop/docs/01-Introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
The workshop teaches you to **build, evaluate, and deploy a retail copilot** code-first on Azure AI. By the end of the workshop, you will learn to:

- Use the [Retrieval Augmented Generation (RAG) pattern](https://learn.microsoft.com/azure/ai-studio/concepts/retrieval-augmented-generation) <br/> (to ground responses in your own data).
- Use [Prompty](https://prompty.ai) with [Azure AI Studio](https://ai.azure.com) for code-first development <br/> (to take your copilot from prompt to production)
- Use [Prompty](https://prompty.ai) with [Azure AI Foundry](https://ai.azure.com) for code-first development <br/> (to take your copilot from prompt to production)
- Use [Azure Container Apps](https://aka.ms/azcontainerapps) <br/> for deployment (to get a hosted API endpoint for real-world use).
- Use [Dev Containers](https://containers.dev) with GitHub Codespaces <br/> (to get a consistent, reproducible environment across teams)
- Use [Azure Developer CLI](https://aka.ms/azd) with AI Application Templates <br/> (to provision & deploy apps consistently across teams)

## Learning Resources

1. **Prompty** | [Documentation](https://prompty.ai) · [Specification](https://github.com/microsoft/prompty/blob/main/Prompty.yaml) · [Tooling](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.prompty) · [SDK](https://pypi.org/project/prompty/)
1. **Azure AI Studio** | [Documentation](https://learn.microsoft.com/en-us/azure/ai-studio/) · [Architecture](https://learn.microsoft.com/azure/ai-studio/concepts/architecture) · [SDKs](https://learn.microsoft.com/azure/ai-studio/how-to/develop/sdk-overview) · [Evaluation](https://learn.microsoft.com/azure/ai-studio/how-to/evaluate-generative-ai-app)
1. **Azure AI Foundry** | [Documentation](https://learn.microsoft.com/en-us/azure/ai-studio/) · [Architecture](https://learn.microsoft.com/azure/ai-studio/concepts/architecture) · [SDKs](https://learn.microsoft.com/azure/ai-studio/how-to/develop/sdk-overview) · [Evaluation](https://learn.microsoft.com/azure/ai-studio/how-to/evaluate-generative-ai-app)
1. **Azure AI Search** | [Documentation](https://learn.microsoft.com/azure/search/) · [Semantic Ranking](https://learn.microsoft.com/azure/search/semantic-search-overview)
1. **Azure Container Apps** | [Azure Container Apps](https://learn.microsoft.com/azure/container-apps/) · [Deploy from code](https://learn.microsoft.com/en-us/azure/container-apps/quickstart-repo-to-cloud?tabs=bash%2Ccsharp&pivots=with-dockerfile)
1. **Responsible AI** | [Overview](https://www.microsoft.com/ai/responsible-ai) · [With AI Services](https://learn.microsoft.com/en-us/azure/ai-services/responsible-use-of-ai-overview?context=%2Fazure%2Fai-studio%2Fcontext%2Fcontext) · [Azure AI Content Safety](https://learn.microsoft.com/en-us/azure/ai-services/content-safety/)
2 changes: 1 addition & 1 deletion docs/workshop/docs/02-Setup/0-PreRequisites/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You **must** have a GitHub account to get started. Take a minute to [sign up for
On completing this workshop, you will have:
1. A personal copy of the [Contoso Chat](https://aka.ms/aitour/contoso-chat) repository in your GitHub profile. This contains all the materials you need to reproduce the workshop on your own later (e.g., as a _Self-Guided_ session).
1. Hands-on understanding of the [Azure AI Studio](https://ai.azure.com) platform and relevant developer tools (e.g., Azure Developer CLI, Prompty, Fast API) to streamline end-to-end development workflows for your own AI apps.
1. Hands-on understanding of the [Azure AI Foundry](https://ai.azure.com) platform and relevant developer tools (e.g., Azure Developer CLI, Prompty, Fast API) to streamline end-to-end development workflows for your own AI apps.
=== "Microsoft AI Tour"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Here's a reminder of the Azure Application Architecture - let's check our provis
---
### 3.2 Azure AI Studio
### 3.2 Azure AI Foundry
!!! tip "The Azure AI Studio portal lets us view and manage the Azure AI project for our app."
!!! tip "The Azure AI Foundry portal lets us view and manage the Azure AI project for our app."
1. Open a new browser tab and [navigate to this page](https://ai.azure.com?feature.customportal=false#home):
``` title=""
Expand All @@ -62,7 +62,7 @@ Here's a reminder of the Azure Application Architecture - let's check our provis
- Click "Models + endpoints" in the left pane.
- **Check:** You should see deployed models for this project.
!!! info "For this application, we will use the chat completion models `gpt-4` and `gpt-35-turbo`, and the embedding model `text-embedding-ada-002`."
!!! info "For this application, we will use the chat completion models `gpt-4` and `gpt-4o-mini`, and the embedding model `text-embedding-ada-002`."
---
Expand Down
2 changes: 1 addition & 1 deletion docs/workshop/docs/03-Ideate/02.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To execute the Prompty asset, we need specify the languge model to use for gener
azure_deployment: ${env:AZURE_OPENAI_CHAT_DEPLOYMENT}
```
!!! info "Prompty will use the AZURE_OPENAI_CHAT_DEPLOYMENT variable from the .env file we created earlier to find the OpenAI endpoint we pre-deployed. For now, that env specifies _gpt-35-turbo_ as the model."
!!! info "Prompty will use the AZURE_OPENAI_CHAT_DEPLOYMENT variable from the .env file we created earlier to find the OpenAI endpoint we pre-deployed. For now, that env specifies _gpt-4o-mini_ as the model."
## 2. Edit Basic information
Expand Down
2 changes: 1 addition & 1 deletion docs/workshop/docs/03-Ideate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
1. Skillable VM tag - showing the countdown timer & launch page
1. GitHub Codespaces tab - showing the Visual Studio Code IDE.
1. Azure Portal tab - showing your `rg-AITOUR` resource group.
1. Azure AI Studio tab - showing your AI project page.
1. Azure AI Foundry tab - showing your AI project page.
1. Azure Container Apps - showing your deployed application.

We completed the setup, validated the infrastructure and verified that the application was deployed correctly.
Expand Down
2 changes: 1 addition & 1 deletion docs/workshop/in-person-starts/MSIgnite-2024-Skillable.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DO NOT DELETE OR EDIT THIS FILE UNLESS YOU ARE AN INSTRUCTOR FOR LAB 401
This file is dynamically retrieved and used by the Skillable VM as the Instruction Guide
-->

# LAB 401: Build a Retail Copilot Code-First on Azure AI Studio
# LAB 401: Build a Retail Copilot Code-First on Azure AI Foundry

This is a 75-minute instructor-led workshop at Microsoft Ignite 2024 where you learn to build, evaluate, and deploy, a RAG-based retail copilot on Azure AI.

Expand Down
Loading

0 comments on commit 7fa5612

Please sign in to comment.