|
71 | 71 | CONFIG_OPENAI_CLIENT,
|
72 | 72 | CONFIG_SEARCH_CLIENT,
|
73 | 73 | CONFIG_SEMANTIC_RANKER_DEPLOYED,
|
| 74 | + CONFIG_QUERY_REWRITING_ENABLED, |
74 | 75 | CONFIG_SPEECH_INPUT_ENABLED,
|
75 | 76 | CONFIG_SPEECH_OUTPUT_AZURE_ENABLED,
|
76 | 77 | CONFIG_SPEECH_OUTPUT_BROWSER_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,7 @@ 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] = AZURE_SEARCH_QUERY_REWRITING == "true" and AZURE_SEARCH_SEMANTIC_RANKER != "disabled" |
637 | 641 | current_app.config[CONFIG_VECTOR_SEARCH_ENABLED] = os.getenv("USE_VECTORS", "").lower() != "false"
|
638 | 642 | current_app.config[CONFIG_USER_UPLOAD_ENABLED] = bool(USE_USER_UPLOAD)
|
639 | 643 | current_app.config[CONFIG_LANGUAGE_PICKER_ENABLED] = ENABLE_LANGUAGE_PICKER
|
|
0 commit comments