Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
shibbas authored Dec 4, 2023
2 parents e6b27f6 + c788464 commit 33b49e8
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ You may try the [Azure pricing calculator](https://azure.com/e/8ffbe5b1919c4c72a
- Azure Static Web Apps: Free Tier. [Pricing](https://azure.microsoft.com/pricing/details/app-service/static/)
- Azure OpenAI: Standard tier, ChatGPT and Ada models. Pricing per 1K tokens used, and at least 1K tokens are used per question. [Pricing](https://azure.microsoft.com/pricing/details/search/)
<!-- - Form Recognizer: SO (Standard) tier using pre-built layout. Pricing per document page, sample documents have 261 pages total. [Pricing](https://azure.microsoft.com/pricing/details/form-recognizer/) -->
- Azure AI Search: Standard tier, 1 replica, free level of semantic search*. Pricing per hour.[Pricing](https://azure.microsoft.com/pricing/details/search/) (_The pricing may vary or reflect an outdated tier model. Please visit the linked page for more accurate information_)
- Azure AI Search: Standard tier, 1 replica, free level of semantic search\*. Pricing per hour.[Pricing](https://azure.microsoft.com/pricing/details/search/) (_The pricing may vary or reflect an outdated tier model. Please visit the linked page for more accurate information_)
- Azure Blob Storage: Standard tier with ZRS (Zone-redundant storage). Pricing per storage and read operations. [Pricing](https://azure.microsoft.com/pricing/details/storage/blobs/)
- Azure Monitor: Pay-as-you-go tier. Costs based on data ingested. [Pricing](https://azure.microsoft.com/pricing/details/monitor/)

Expand Down Expand Up @@ -319,7 +319,7 @@ For more details, read [Azure OpenAI Landing Zone reference architecture](https:
## Resources
- [Revolutionize your Enterprise Data with ChatGPT: Next-gen Apps w/ Azure OpenAI and AI Search](https://aka.ms/entgptsearchblog)
- [Azure Cognitive Search](https://learn.microsoft.com/azure/search/search-what-is-azure-search)
- [Azure AI Search](https://learn.microsoft.com/azure/search/search-what-is-azure-search)
- [Azure OpenAI Service](https://learn.microsoft.com/azure/cognitive-services/openai/overview)
- [Building ChatGPT-Like Experiences with Azure: A Guide to Retrieval Augmented Generation for JavaScript applications](https://devblogs.microsoft.com/azure-sdk/building-chatgpt-like-experiences-with-azure-a-guide-to-retrieval-augmented-generation-for-javascript-applications/)
Expand Down
Binary file modified docs/app-architecture.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ param useApplicationInsights bool = false

param allowedOrigin string

// Allow to override the default backend
param backendUri string = ''

// Only needed for CD due to internal policies restrictions
param aliasTag string = ''
// Differentiates between automated and manual deployments
Expand Down Expand Up @@ -536,3 +539,4 @@ output SEARCH_API_URI string = searchApi.outputs.uri
output INDEXER_API_URI string = indexerApi.outputs.uri

output ALLOWED_ORIGINS string = join(allowedOrigins, ',')
output BACKEND_URI string = !empty(backendUri) ? backendUri : searchApi.outputs.uri
3 changes: 3 additions & 0 deletions infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
"allowedOrigin": {
"value": "${ALLOWED_ORIGIN=''}"
},
"backendUri": {
"value": "${BACKEND_URI}"
},
"aliasTag": {
"value": "${AZURE_ALIAS}"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure-search-openai-javascript",
"version": "1.0.0",
"description": "ChatGPT + Enterprise data with Azure OpenAI and Cognitive Search",
"description": "ChatGPT + Enterprise data with Azure OpenAI and AI Search",
"private": true,
"directories": {
"doc": "docs"
Expand Down
2 changes: 1 addition & 1 deletion packages/indexer/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ AZURE_OPENAI_EMBEDDING_DEPLOYMENT=
AZURE_OPENAI_EMBEDDING_MODEL=
AZURE_OPENAI_SERVICE=

# Azure Cognitive Search
# Azure AI Search
AZURE_SEARCH_INDEX=
AZURE_SEARCH_SERVICE=

Expand Down
2 changes: 1 addition & 1 deletion packages/indexer/src/plugins/azure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default fp(
async (fastify, _options) => {
const config = fastify.config;

// Use the current user identity to authenticate with Azure OpenAI, Cognitive Search and Blob Storage
// Use the current user identity to authenticate with Azure OpenAI, AI Search and Blob Storage
// (no secrets needed, just use 'az login' locally, and managed identity when deployed on Azure).
// If you need to use keys, use separate AzureKeyCredential instances with the keys for each service
const credential = new DefaultAzureCredential();
Expand Down
2 changes: 1 addition & 1 deletion packages/search/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ AZURE_OPENAI_EMBEDDING_DEPLOYMENT=
AZURE_OPENAI_EMBEDDING_MODEL=
AZURE_OPENAI_SERVICE=

# Azure Cognitive Search
# Azure AI Search
AZURE_SEARCH_INDEX=
AZURE_SEARCH_SERVICE=

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ info3.pdf: Once you've provided the necessary information, submit the report. Ou
const ANSWER = `If a guest breaks something, report the damage immediately through the platform [info1.txt]. Once you've provided the necessary information, submit the report. Our financial support team will investigate the matter and work to resolve it promptly [info3.pdf].`;

/**
* Simple retrieve-then-read implementation, using the Cognitive Search and OpenAI APIs directly.
* Simple retrieve-then-read implementation, using the AI Search and OpenAI APIs directly.
* It first retrieves top documents from search, then constructs a prompt with them, and then uses
* OpenAI to generate an completion (answer) with that prompt.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const QUERY_PROMPT_FEW_SHOTS: Message[] = [
];

/**
* Simple retrieve-then-read implementation, using the Cognitive Search and OpenAI APIs directly.
* Simple retrieve-then-read implementation, using the AI Search and OpenAI APIs directly.
* It first retrieves top documents from search, then constructs a prompt with them, and then uses
* OpenAI to generate an completion (answer) with that prompt.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/search/src/plugins/azure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default fp(
async (fastify, _options) => {
const config = fastify.config;

// Use the current user identity to authenticate with Azure OpenAI, Cognitive Search and Blob Storage
// Use the current user identity to authenticate with Azure OpenAI, AI Search and Blob Storage
// (no secrets needed, just use 'az login' locally, and managed identity when deployed on Azure).
// If you need to use keys, use separate AzureKeyCredential instances with the keys for each service
const credential = new DefaultAzureCredential();
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/pages/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Layout = () => {
</li>
</ul>
</nav>
<h4 className={styles.headerRightText}>Azure OpenAI + Cognitive Search</h4>
<h4 className={styles.headerRightText}>Azure OpenAI + AI Search</h4>
</div>
</header>

Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// Expose environment variables to the client
process.env.VITE_SEARCH_API_URI = process.env.SEARCH_API_URI ?? '';
process.env.VITE_SEARCH_API_URI = process.env.BACKEND_URI ?? '';
console.log(`Using search API base URL: "${process.env.VITE_SEARCH_API_URI}"`);

// https://vitejs.dev/config/
Expand Down

0 comments on commit 33b49e8

Please sign in to comment.