Azure-Samples / chat-with-your-data-solution-accelerator

A Solution Accelerator for the RAG pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences. This includes most common requirements and best practices.
https://azure.microsoft.com/products/search
MIT License
651 stars 324 forks source link

fix: Cache the Config #933

Closed ross-p-smith closed 1 month ago

ross-p-smith commented 1 month ago

Purpose

Fixes #647

We use the higher-order functions to decorate the get_active_config_or_default method with a cache. We also invalidate the cache when we save the config.

However, because there are 2 applications, we display some text to tell the user that they will need to restart the Chat App to invalidate the cache

github-actions[bot] commented 1 month ago

Coverage

Coverage Report •
FileStmtsMissCoverMissing
code/backend/batch/utilities/helpers/config
   config_helper.py1380100% 
code/backend/pages
   04_Configuration.py1351350%1–9, 11–12, 14, 21, 28, 30, 35–44, 47–48, 51–62, 64–65, 67–69, 73–74, 86–90, 93–94, 98–100, 103–104, 107–108, 111–112, 135, 137–138, 140–144, 146–149, 152–156, 163–164, 174–176, 178, 198–199, 201, 203, 209, 217, 225, 232–233, 240, 242–243, 247, 255, 261, 268, 286–290, 296–297, 316–317, 321, 323–324, 347, 381–382, 386–387, 390–391, 394–397, 399–400, 402–404, 406–409, 411–412
TOTAL243167272% 

Tests Skipped Failures Errors Time
206 0 :zzz: 0 :x: 0 :fire: 12.338s :stopwatch:
ross-p-smith commented 1 month ago

how much effort do you think it would be to add an endpoint to the chat app

I was actually thinking about this. However, I think the problem would be the dependency graph of the deployment. We would need the chat app deployed to be able to get the url (unless we did it by convention), but the backend is what is deployed last; and it would be the admin app calling the backend. But not saying no, let me give it a weekend thought!

adamdougal commented 1 month ago

how much effort do you think it would be to add an endpoint to the chat app

I was actually thinking about this. However, I think the problem would be the dependency graph of the deployment. We would need the chat app deployed to be able to get the url (unless we did it by convention), but the backend is what is deployed last; and it would be the admin app calling the backend. But not saying no, let me give it a weekend thought!

Ah good point! I guess another option could be to have a ttl on the cache, is that possible with func tools?