|
69 | 69 | CONFIG_INGESTER, |
70 | 70 | CONFIG_LANGUAGE_PICKER_ENABLED, |
71 | 71 | CONFIG_OPENAI_CLIENT, |
| 72 | + CONFIG_QUERY_REWRITING_ENABLED, |
72 | 73 | CONFIG_SEARCH_CLIENT, |
73 | 74 | CONFIG_SEMANTIC_RANKER_DEPLOYED, |
74 | 75 | CONFIG_SPEECH_INPUT_ENABLED, |
@@ -291,6 +292,7 @@ def config(): |
291 | 292 | { |
292 | 293 | "showGPT4VOptions": current_app.config[CONFIG_GPT4V_DEPLOYED], |
293 | 294 | "showSemanticRankerOption": current_app.config[CONFIG_SEMANTIC_RANKER_DEPLOYED], |
| 295 | + "showQueryRewritingOption": current_app.config[CONFIG_QUERY_REWRITING_ENABLED], |
294 | 296 | "showVectorOption": current_app.config[CONFIG_VECTOR_SEARCH_ENABLED], |
295 | 297 | "showUserUpload": current_app.config[CONFIG_USER_UPLOAD_ENABLED], |
296 | 298 | "showLanguagePicker": current_app.config[CONFIG_LANGUAGE_PICKER_ENABLED], |
@@ -453,6 +455,7 @@ async def setup_clients(): |
453 | 455 | AZURE_SEARCH_QUERY_LANGUAGE = os.getenv("AZURE_SEARCH_QUERY_LANGUAGE") or "en-us" |
454 | 456 | AZURE_SEARCH_QUERY_SPELLER = os.getenv("AZURE_SEARCH_QUERY_SPELLER") or "lexicon" |
455 | 457 | AZURE_SEARCH_SEMANTIC_RANKER = os.getenv("AZURE_SEARCH_SEMANTIC_RANKER", "free").lower() |
| 458 | + AZURE_SEARCH_QUERY_REWRITING = os.getenv("AZURE_SEARCH_QUERY_REWRITING", "false").lower() |
456 | 459 |
|
457 | 460 | AZURE_SPEECH_SERVICE_ID = os.getenv("AZURE_SPEECH_SERVICE_ID") |
458 | 461 | AZURE_SPEECH_SERVICE_LOCATION = os.getenv("AZURE_SPEECH_SERVICE_LOCATION") |
@@ -634,6 +637,9 @@ async def setup_clients(): |
634 | 637 |
|
635 | 638 | current_app.config[CONFIG_GPT4V_DEPLOYED] = bool(USE_GPT4V) |
636 | 639 | current_app.config[CONFIG_SEMANTIC_RANKER_DEPLOYED] = AZURE_SEARCH_SEMANTIC_RANKER != "disabled" |
| 640 | + current_app.config[CONFIG_QUERY_REWRITING_ENABLED] = ( |
| 641 | + AZURE_SEARCH_QUERY_REWRITING == "true" and AZURE_SEARCH_SEMANTIC_RANKER != "disabled" |
| 642 | + ) |
637 | 643 | current_app.config[CONFIG_VECTOR_SEARCH_ENABLED] = os.getenv("USE_VECTORS", "").lower() != "false" |
638 | 644 | current_app.config[CONFIG_USER_UPLOAD_ENABLED] = bool(USE_USER_UPLOAD) |
639 | 645 | current_app.config[CONFIG_LANGUAGE_PICKER_ENABLED] = ENABLE_LANGUAGE_PICKER |
|
0 commit comments