Skip to content

Commit f2ae7da

Browse files
authored
Merge branch 'Azure-Samples:main' into improve-security
2 parents bbf02c4 + e2dc0aa commit f2ae7da

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ description: A csharp sample app that chats with your data using OpenAI and AI S
5656
[![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&ref=main&repo=624102171&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)
5757
[![Open in Remote - Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Remote%20-%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/azure-search-openai-demo-csharp)
5858

59-
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 the ChatGPT model (`gpt-35-turbo`), and Azure Cognitive Search for data indexing and retrieval.
59+
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 the ChatGPT model (`gpt-35-turbo`), and Azure AI Search for data indexing and retrieval.
6060

6161
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.
6262

63-
![RAG Architecture](docs/appcomponents-version-4.png)
63+
![RAG Architecture](docs/appcomponents.png)
6464

6565
For more details on how this application was built, check out:
6666

@@ -84,7 +84,7 @@ We want to hear from you! Are you interested in building or currently building i
8484

8585
- **User interface** - The application’s chat interface is a [Blazor WebAssembly](https://learn.microsoft.com/aspnet/core/blazor/) application. This interface is what accepts user queries, routes request to the application backend, and displays generated responses.
8686
- **Backend** - The application backend is an [ASP.NET Core Minimal API](https://learn.microsoft.com/aspnet/core/fundamentals/minimal-apis/overview). The backend hosts the Blazor static web application and what orchestrates the interactions among the different services. Services used in this application include:
87-
- [**Azure Cognitive Search**](https://learn.microsoft.com/azure/search/search-what-is-azure-search) – indexes documents from the data stored in an Azure Storage Account. This makes the documents searchable using [vector search](https://learn.microsoft.com/azure/search/search-get-started-vector) capabilities.
87+
- [**Azure AI Search**](https://learn.microsoft.com/azure/search/search-what-is-azure-search) – indexes documents from the data stored in an Azure Storage Account. This makes the documents searchable using [vector search](https://learn.microsoft.com/azure/search/search-get-started-vector) capabilities.
8888
- [**Azure OpenAI Service**](https://learn.microsoft.com/azure/ai-services/openai/overview) – provides the Large Language Models to generate responses. [Semantic Kernel](https://learn.microsoft.com/semantic-kernel/whatissk) is used in conjunction with the Azure OpenAI Service to orchestrate the more complex AI workflows.
8989

9090
## Getting Started
@@ -99,7 +99,7 @@ In order to deploy and run this example, you'll need
9999

100100

101101
> [!WARNING]<br>
102-
> By default this sample will create an Azure Container App, and Azure Cognitive Search resource that have a monthly cost, as well as Form Recognizer resource that has cost per document page. You can switch them to free versions of each of them if you want to avoid this cost by changing the parameters file under the infra folder (though there are some limits to consider; for example, you can have up to 1 free Cognitive Search resource per subscription, and the free Form Recognizer resource only analyzes the first 2 pages of each document.)
102+
> By default this sample will create an Azure Container App, and Azure AI Search resource that have a monthly cost, as well as Form Recognizer resource that has cost per document page. You can switch them to free versions of each of them if you want to avoid this cost by changing the parameters file under the infra folder (though there are some limits to consider; for example, you can have up to 1 free Cognitive Search resource per subscription, and the free Form Recognizer resource only analyzes the first 2 pages of each document.)
103103
104104
### Cost estimation
105105

@@ -108,7 +108,7 @@ Pricing varies per region and usage, so it isn't possible to predict exact costs
108108
- [**Azure Container Apps**](https://azure.microsoft.com/pricing/details/container-apps/)
109109
- [**Azure OpenAI Service**](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/)
110110
- [**Azure Form Recognizer**](https://azure.microsoft.com/pricing/details/form-recognizer/)
111-
- [**Azure Cognitive Search**](https://azure.microsoft.com/pricing/details/search/)
111+
- [**Azure AI Search**](https://azure.microsoft.com/pricing/details/search/)
112112
- [**Azure Blob Storage**](https://azure.microsoft.com/pricing/details/storage/blobs/)
113113
- [**Azure Monitor**](https://azure.microsoft.com/pricing/details/monitor/)
114114

@@ -344,7 +344,7 @@ to production. Here are some things to consider:
344344

345345
* **OpenAI Capacity**: The default TPM (tokens per minute) is set to 30K. That is equivalent to approximately 30 conversations per minute (assuming 1K per user message/response). You can increase the capacity by changing the `chatGptDeploymentCapacity` and `embeddingDeploymentCapacity` parameters in `infra/main.bicep` to your account's maximum capacity. You can also view the Quotas tab in [Azure OpenAI studio](https://oai.azure.com/) to understand how much capacity you have.
346346
* **Azure Storage**: The default storage account uses the `Standard_LRS` SKU. To improve your resiliency, we recommend using `Standard_ZRS` for production deployments, which you can specify using the `sku` property under the `storage` module in `infra/main.bicep`.
347-
* **Azure Cognitive Search**: If you see errors about search service capacity being exceeded, you may find it helpful to increase the number of replicas by changing `replicaCount` in `infra/core/search/search-services.bicep` or manually scaling it from the Azure Portal.
347+
* **Azure AI Search**: If you see errors about search service capacity being exceeded, you may find it helpful to increase the number of replicas by changing `replicaCount` in `infra/core/search/search-services.bicep` or manually scaling it from the Azure Portal.
348348
* **Azure Container Apps**: By default, this application deploys containers with 0.5 CPU Cores and 1GB of memory. The minimum replicas is 1 and maximum 10. For this app, you can set values such as `containerCpuCoreCount`, `containerMaxReplicas `, `containerMemory`, `containerMinReplicas` in the `infra/core/host/container-app.bicep` file to fit your needs. You can use auto-scaling rules or scheduled scaling rules, and scale up the [maximum/minimum](https://learn.microsoft.com/azure/container-apps/scale-app) based on load.
349349
* **Authentication**: By default, the deployed app is publicly accessible. We recommend restricting access to authenticated users. See [Enabling authentication](#enabling-authentication) above for how to enable authentication.
350350
* **Networking**: We recommend deploying inside a Virtual Network. If the app is only for internal enterprise use, use a private DNS zone. Also consider using Azure API Management (APIM) for firewalls and other forms of protection. For more details, read [Azure OpenAI Landing Zone reference architecture](https://techcommunity.microsoft.com/t5/azure-architecture-blog/azure-openai-landing-zone-reference-architecture/ba-p/3882102).
@@ -353,7 +353,7 @@ to production. Here are some things to consider:
353353
## Resources
354354

355355
- [Revolutionize your Enterprise Data with ChatGPT: Next-gen Apps w/ Azure OpenAI and Cognitive Search](https://aka.ms/entgptsearchblog)
356-
- [Azure Cognitive Search](https://learn.microsoft.com/azure/search/search-what-is-azure-search)
356+
- [Azure AI Search](https://learn.microsoft.com/azure/search/search-what-is-azure-search)
357357
- [Azure OpenAI Service](https://learn.microsoft.com/azure/cognitive-services/openai/overview)
358358
- [`Azure.AI.OpenAI` NuGet package](https://www.nuget.org/packages/Azure.AI.OpenAI)
359359
- [Original Blazor App](https://github.com/IEvangelist/blazor-azure-openai)
@@ -363,6 +363,6 @@ to production. Here are some things to consider:
363363
364364
### FAQ
365365

366-
**_Question_**: Why do we need to break up the PDFs into chunks when Azure Cognitive Search supports searching large documents?
366+
**_Question_**: Why do we need to break up the PDFs into chunks when Azure AI Search supports searching large documents?
367367

368368
**_Answer_**: Chunking allows us to limit the amount of information we send to OpenAI due to token limits. By breaking up the content, it allows us to easily find potential chunks of text that we can inject into OpenAI. The method of chunking we use leverages a sliding window of text such that sentences that end one chunk will start the next. This allows us to reduce the chance of losing the context of the text.

app/prepdocs/PrepareDocs/Program.Options.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ internal static partial class Program
2121
new(name: "--tenantid", description: "Optional. Use this to define the Azure directory where to authenticate)");
2222

2323
private static readonly Option<string> s_searchService =
24-
new(name: "--searchendpoint", description: "The Azure Cognitive Search service endpoint where content should be indexed (must exist already)");
24+
new(name: "--searchendpoint", description: "The Azure AI Search service endpoint where content should be indexed (must exist already)");
2525

2626
private static readonly Option<string> s_searchIndexName =
27-
new(name: "--searchindex", description: "Name of the Azure Cognitive Search index where content should be indexed (will be created if it doesn't exist)");
27+
new(name: "--searchindex", description: "Name of the Azure AI Search index where content should be indexed (will be created if it doesn't exist)");
2828

2929
private static readonly Option<string> s_azureOpenAIService =
3030
new(name: "--openaiendpoint", description: "Optional. The Azure OpenAI service endpoint which will be used to extract text, tables and layout from the documents (must exist already)");
3131

3232
private static readonly Option<string> s_embeddingModelName =
33-
new(name: "--embeddingmodel", description: "Optional. Name of the Azure Cognitive Search embedding model to use for embedding content in the search index (will be created if it doesn't exist)");
33+
new(name: "--embeddingmodel", description: "Optional. Name of the Azure AI Search embedding model to use for embedding content in the search index (will be created if it doesn't exist)");
3434

3535
private static readonly Option<bool> s_remove =
3636
new(name: "--remove", description: "Remove references to this document from blob storage and the search index");

app/shared/Shared/EmbeddingType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Shared;
55
public enum EmbeddingType
66
{
77
/// <summary>
8-
/// Embed using Azure Cognitive Search (Vector).
8+
/// Embed using Azure AI Search (Vector).
99
/// See <a href='https://learn.microsoft.com/azure/search/vector-search-overview'>https://learn.microsoft.com/azure/search/vector-search-overview</a>
1010
/// </summary>
1111
AzureSearch = 0,

docs/appcomponents-version-2.png

-140 KB
Binary file not shown.

docs/appcomponents-version-3.png

-84.5 KB
Binary file not shown.

docs/appcomponents-version-4.png

-53.2 KB
Binary file not shown.

docs/appcomponents.png

2.79 KB
Loading

infra/main.bicep

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,16 @@ param resourceGroupName string = ''
118118
@description('Name of the search index. Default: gptkbindex')
119119
param searchIndexName string = 'gptkbindex'
120120

121-
@description('Name of the Azure Cognitive Search service')
121+
@description('Name of the Azure AI Search service')
122122
param searchServiceName string = ''
123123

124-
@description('Location of the resource group for the Azure Cognitive Search service')
124+
@description('Location of the resource group for the Azure AI Search service')
125125
param searchServiceResourceGroupLocation string = location
126126

127-
@description('Name of the resource group for the Azure Cognitive Search service')
127+
@description('Name of the resource group for the Azure AI Search service')
128128
param searchServiceResourceGroupName string = ''
129129

130-
@description('SKU name for the Azure Cognitive Search service. Default: standard')
130+
@description('SKU name for the Azure AI Search service. Default: standard')
131131
param searchServiceSkuName string = 'standard'
132132

133133
@description('Name of the storage account')

0 commit comments

Comments
 (0)