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
641 stars 315 forks source link

refactor: Make backend search, backend tools and remainder backend files PEP8 compliant #899

Closed gaurarpit closed 1 month ago

gaurarpit commented 1 month ago

Purpose

Does this introduce a breaking change?

How to Test


* Run the application locally and go to http://localhost:8502/Ingest_Data
* Verify all options work

![SCR-20240514-mdvv-2](https://github.com/Azure-Samples/chat-with-your-data-solution-accelerator/assets/4739534/3962e71a-c4aa-4b5a-ac0d-52b8ab9f195f)

![SCR-20240514-mdlu-2](https://github.com/Azure-Samples/chat-with-your-data-solution-accelerator/assets/4739534/bf0e0d86-18ed-4dbb-a61e-8c9bbeb7c7e3)

![SCR-20240514-mdof-2](https://github.com/Azure-Samples/chat-with-your-data-solution-accelerator/assets/4739534/79a9734e-4a28-4a92-9b12-6b433d1ce3c3)

![SCR-20240514-mdqf-2](https://github.com/Azure-Samples/chat-with-your-data-solution-accelerator/assets/4739534/22703e0d-ec06-4f62-b922-6548eeb2a367)

## What to Check

* Verify all options work
github-actions[bot] commented 1 month ago

Coverage

Coverage Report •
FileStmtsMissCoverMissing
code/backend
   admin.py21210%1–5, 7, 9–10, 12, 15–16, 18–19, 22, 29, 36, 39–41, 43, 45
code/backend/batch
   add_url_embeddings.py470100% 
   batch_push_results.py250100% 
   batch_start_processing.py260100% 
   function_app.py16160%1–8, 10, 12–13, 15, 18–21
   get_conversation_response.py320100% 
code/backend/batch/utilities/common
   answer.py24195%39
   source_document.py60591%44, 47, 51, 55, 128
code/backend/batch/utilities/document_chunking
   document_chunking_base.py10280%10, 16
   fixed_size_overlap.py190100% 
   layout.py190100% 
   page.py170100% 
   paragraph.py9277%9, 15
code/backend/batch/utilities/document_loading
   document_loading_base.py9188%13
   layout.py12558%9, 12–13, 16, 25
   read.py12558%9, 12–13, 16, 25
   web.py19194%23
   word_document.py251348%11–12, 22–24, 27, 30, 33–37, 45
code/backend/batch/utilities/helpers/embedders
   integrated_vectorization_embedder.py36488%20, 39–41
   push_embedder.py460100% 
code/backend/batch/utilities/integrated_vectorization
   azure_search_datasource.py190100% 
   azure_search_index.py350100% 
   azure_search_indexer.py230100% 
   azure_search_skillset.py220100% 
code/backend/batch/utilities/loggers
   conversation_logger.py362822%8, 11–12, 15–24, 27–30, 33–42, 46
code/backend/batch/utilities/orchestrator
   lang_chain_agent.py601968%21–24, 26, 61–62, 82–85, 102–103, 106–109, 116–117
   open_ai_functions.py543633%62, 64, 70–73, 75, 78, 85–89, 93–94, 96, 102–106, 110–112, 115, 118–119, 122, 127–129, 132–134, 137, 142
   orchestrator_base.py50884%33, 72–74, 81–83, 93
   semantic_kernel.py540100% 
code/backend/batch/utilities/parser
   output_parser_tool.py390100% 
   parser_base.py9277%9, 19
code/backend/batch/utilities/plugins
   chat_plugin.py150100% 
   post_answering_plugin.py80100% 
code/backend/batch/utilities/search
   azure_search_handler.py58296%24, 30
   integrated_vectorization_search_handler.py61395%35, 111, 120
   search.py13192%15
   search_handler_base.py361363%13–15, 18–20, 24, 28, 32, 36, 40, 44, 48
code/backend/batch/utilities/tools
   answer_processing_base.py8275%8, 12
   answering_tool_base.py9277%9, 15
   content_safety_checker.py412539%16, 18–19, 24, 30–32, 35–36, 42–43, 49–54, 57–59, 61, 65–67, 69
   post_prompt_tool.py221340%11, 14–15, 17–18, 22, 29, 36–37, 45, 51–52, 60
   question_answer_tool.py610100% 
   text_processing_tool.py16943%9, 12–15, 21, 23, 30, 37
code/backend/pages
   02_Explore_Data.py26260%1–7, 9–10, 12, 18, 25, 28, 36, 38–39, 41–44, 46–49, 52–53
   03_Delete_Data.py36360%1–7, 9–11, 13, 19, 26, 29, 37, 39–40, 42–45, 47, 49–50, 54, 58–62, 64, 67–68, 70–72
TOTAL231267370% 

Tests Skipped Failures Errors Time
183 0 :zzz: 0 :x: 0 :fire: 13.498s :stopwatch: