From b14d971be1a9305ad9c76351967138d9f132ef74 Mon Sep 17 00:00:00 2001 From: Xiaoyun Zhang Date: Thu, 28 Sep 2023 13:51:32 -0700 Subject: [PATCH] Fix deployment by removing redis (#165) ## Purpose * ... Redis is blocking `azd up` to work, so removing redis from bicep temperorily before figuring out what's going wrong ## Does this introduce a breaking change? ``` [x] Yes [ ] No ``` ## Pull Request Type What kind of change does this Pull Request introduce? ``` [ ] Bugfix [ ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Documentation content changes [ ] Other... Please describe: ``` ## How to Test * Get the code ``` git clone [repo-address] cd [repo-name] git checkout [branch-name] npm install ``` * Test the code ``` ``` ## What to Check Verify that the following are valid * ... ## Other Information --- .../Services/ReadRetrieveReadChatService.cs | 5 ++-- infra/main.bicep | 29 ++++++++++--------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/app/backend/Services/ReadRetrieveReadChatService.cs b/app/backend/Services/ReadRetrieveReadChatService.cs index 6a4b544e..016dd357 100644 --- a/app/backend/Services/ReadRetrieveReadChatService.cs +++ b/app/backend/Services/ReadRetrieveReadChatService.cs @@ -87,9 +87,10 @@ standard plan AND dental AND employee benefit. if (string.IsNullOrEmpty(documentContents)) { - documentContents = "no source available"; + documentContents = "no source available."; } + Console.WriteLine(documentContents); // step 3 // put together related docs and conversation history to generate answer var answerChat = chat.CreateNewChat($@"You are a system assistant who helps the company employees with their healthcare plan questions, and questions about the employee handbook. Be brief in your answers"); @@ -111,7 +112,7 @@ standard plan AND dental AND employee benefit. You answer needs to be a json object with the following format. {{ - ""answer"": // the answer to the question, remember to reference the source for each fact you use in the response. e.g. Apple is a fruit[reference1.pdf]. If no source is provided, put the answer as I don't know. + ""answer"": // the answer to the question, add a source reference to the end of each sentence. e.g. Apple is a fruit [reference1.pdf]. If no source available, put the answer as I don't know. ""thoughts"": // brief thoughts on how you came up with the answer, e.g. what sources you used, what you thought about, etc. }}"); diff --git a/infra/main.bicep b/infra/main.bicep index 3a9e1ed8..2612acdb 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -248,23 +248,24 @@ module web './app/web.bicep' = { openAiEndpoint: openAi.outputs.endpoint openAiChatGptDeployment: chatGptDeploymentName openAiEmbeddingDeployment: embeddingDeploymentName - serviceBinds: [ redis.outputs.serviceBind ] + // serviceBinds: [ redis.outputs.serviceBind ] + serviceBinds: [] } } // this launches a redis instance inside of the ACA env -module redis 'core/host/container-app.bicep' = { - name: 'redis' - scope: resourceGroup - params: { - name: 'redis' - location: location - tags: updatedTags - containerAppsEnvironmentName: containerApps.outputs.environmentName - containerRegistryName: containerApps.outputs.registryName - serviceType: 'redis' - } -} +// module redis 'core/host/container-app.bicep' = { +// name: 'redis' +// scope: resourceGroup +// params: { +// name: 'redis' +// location: location +// tags: updatedTags +// containerAppsEnvironmentName: containerApps.outputs.environmentName +// containerRegistryName: containerApps.outputs.registryName +// serviceType: 'redis' +// } +// } // Monitor application with Azure Monitor module monitoring 'core/monitor/monitoring.bicep' = { @@ -496,7 +497,7 @@ output AZURE_OPENAI_EMBEDDING_DEPLOYMENT string = embeddingDeploymentName output AZURE_OPENAI_ENDPOINT string = openAi.outputs.endpoint output AZURE_OPENAI_RESOURCE_GROUP string = openAiResourceGroup.name output AZURE_OPENAI_SERVICE string = openAi.outputs.name -output AZURE_REDIS_CACHE string = redis.outputs.name +// output AZURE_REDIS_CACHE string = redis.outputs.name output AZURE_RESOURCE_GROUP string = resourceGroup.name output AZURE_SEARCH_INDEX string = searchIndexName output AZURE_SEARCH_SERVICE string = searchService.outputs.name