Skip to content

Commit

Permalink
search URL variable
Browse files Browse the repository at this point in the history
replace azure_search_name variable with azure_search_url variable to allow for use of both azure and azure government search service
  • Loading branch information
tsellie committed Nov 24, 2023
1 parent cc5944e commit 5943a4b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ You can deploy the application using one of the following options:
Click on the appropriate Deploy to Azure button to deploy the Azure resources for the application within an environment suitable for your use case.

[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://aka.ms/anzappazurechatgpt)
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FHJFMilMed%2Fscoopgpt%2Fmain%2Finfra%2Fmain.json)

[![Deploy to Azure Gov](https://aka.ms/deploytoazuregovbutton)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fazurechat%2Fmaster%2Fmain%2Finfra%2Fmain.json)
[![Deploy to Azure Gov](https://aka.ms/deploytoazuregovbutton)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FHJFMilMed%2Fscoopgpt%2Fmain%2Finfra%2Fmain.json)

## Setup Authentication

Expand Down
4 changes: 2 additions & 2 deletions docs/7-environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Below are the required environment variables, to be added to the Azure Portal or
| `ADMIN_EMAIL_ADDRESS` | | Comma separated list of email addresses of the admin users ID |
| **Azure Cognitive Search is optional. This is only required for chat over file feature.** |
| `AZURE_SEARCH_API_KEY` | | API Key of Azure Cognitive search |
| `AZURE_SEARCH_NAME` | `https://AZURE_SEARCH_NAME.search.azure.us` | The deployment name of your Azure Government Cognitive Search |
| `AZURE_SEARCH_URL` | `https://NAME.search.azure.us/` | The deployment name of your Azure Cognitive Search |
| `AZURE_SEARCH_INDEX_NAME` | | The index name with [vector search](https://learn.microsoft.com/en-us/azure/search/vector-search-overview) enabled |
| `AZURE_SEARCH_API_VERSION` | `2023-07-01-Preview` | API version which supports vector search `2023-07-01-Preview` |
| `AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT` | `https://NAME.cognitiveservices.azure.us` | Endpoint url of the Azure Government document intelligence. |
| `AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT` | `https://NAME.cognitiveservices.azure.us/` | Endpoint url of the Azure document intelligence. |
| `PUBLIC_SPEECH_ENABLED` | false | Whether speech should be enabled (microphone button appears). Must be "true" to enable, any other value (or blank) will disable. |
| `AZURE_SPEECH_REGION` | | Region of your Azure Speech service |
| `AZURE_SPEECH_KEY` | | API Key of Azure Speech service |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ export const embedDocuments = async (
};

const baseUrl = (): string => {
return `https://${process.env.AZURE_SEARCH_NAME}.search.azure.us/indexes`;
return `${process.env.AZURE_SEARCH_URL}/indexes`;
};

const baseIndexUrl = (): string => {
return `https://${process.env.AZURE_SEARCH_NAME}.search.azure.us/indexes/${process.env.AZURE_SEARCH_INDEX_NAME}`;
return `${process.env.AZURE_SEARCH_URL}/indexes/${process.env.AZURE_SEARCH_INDEX_NAME}`;
};

const fetcher = async (url: string, init?: RequestInit) => {
Expand Down
2 changes: 1 addition & 1 deletion src/features/chat/chat-services/chat-document-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const UpsertChatDocument = async (

export const ensureSearchIsConfigured = async () => {
var isSearchConfigured =
isNotNullOrEmpty(process.env.AZURE_SEARCH_NAME) &&
isNotNullOrEmpty(process.env.AZURE_SEARCH_URL) &&
isNotNullOrEmpty(process.env.AZURE_SEARCH_API_KEY) &&
isNotNullOrEmpty(process.env.AZURE_SEARCH_INDEX_NAME) &&
isNotNullOrEmpty(process.env.AZURE_SEARCH_API_VERSION);
Expand Down

0 comments on commit 5943a4b

Please sign in to comment.