mirror of
https://github.com/open-webui/open-webui
synced 2025-04-07 06:04:50 +00:00
feat: web search available is inferred from env vars
This commit is contained in:
parent
9ed1a31575
commit
d45804d7f4
@ -563,6 +563,13 @@ BRAVE_SEARCH_API_KEY = os.getenv("BRAVE_SEARCH_API_KEY", "")
|
|||||||
SERPSTACK_API_KEY = os.getenv("SERPSTACK_API_KEY", "")
|
SERPSTACK_API_KEY = os.getenv("SERPSTACK_API_KEY", "")
|
||||||
SERPSTACK_HTTPS = os.getenv("SERPSTACK_HTTPS", "True").lower() == "true"
|
SERPSTACK_HTTPS = os.getenv("SERPSTACK_HTTPS", "True").lower() == "true"
|
||||||
SERPER_API_KEY = os.getenv("SERPER_API_KEY", "")
|
SERPER_API_KEY = os.getenv("SERPER_API_KEY", "")
|
||||||
|
RAG_WEB_SEARCH_ENABLED = (
|
||||||
|
SEARXNG_QUERY_URL != ""
|
||||||
|
or (GOOGLE_PSE_API_KEY != "" and GOOGLE_PSE_ENGINE_ID != "")
|
||||||
|
or BRAVE_SEARCH_API_KEY != ""
|
||||||
|
or SERPSTACK_API_KEY != ""
|
||||||
|
or SERPER_API_KEY != ""
|
||||||
|
)
|
||||||
RAG_WEB_SEARCH_RESULT_COUNT = int(os.getenv("RAG_WEB_SEARCH_RESULT_COUNT", "10"))
|
RAG_WEB_SEARCH_RESULT_COUNT = int(os.getenv("RAG_WEB_SEARCH_RESULT_COUNT", "10"))
|
||||||
RAG_WEB_SEARCH_CONCURRENT_REQUESTS = int(
|
RAG_WEB_SEARCH_CONCURRENT_REQUESTS = int(
|
||||||
os.getenv("RAG_WEB_SEARCH_CONCURRENT_REQUESTS", "10")
|
os.getenv("RAG_WEB_SEARCH_CONCURRENT_REQUESTS", "10")
|
||||||
|
@ -58,6 +58,7 @@ from config import (
|
|||||||
SRC_LOG_LEVELS,
|
SRC_LOG_LEVELS,
|
||||||
WEBHOOK_URL,
|
WEBHOOK_URL,
|
||||||
ENABLE_ADMIN_EXPORT,
|
ENABLE_ADMIN_EXPORT,
|
||||||
|
RAG_WEB_SEARCH_ENABLED,
|
||||||
)
|
)
|
||||||
from constants import ERROR_MESSAGES
|
from constants import ERROR_MESSAGES
|
||||||
|
|
||||||
@ -248,6 +249,7 @@ async def get_app_config():
|
|||||||
"default_prompt_suggestions": webui_app.state.DEFAULT_PROMPT_SUGGESTIONS,
|
"default_prompt_suggestions": webui_app.state.DEFAULT_PROMPT_SUGGESTIONS,
|
||||||
"trusted_header_auth": bool(webui_app.state.AUTH_TRUSTED_EMAIL_HEADER),
|
"trusted_header_auth": bool(webui_app.state.AUTH_TRUSTED_EMAIL_HEADER),
|
||||||
"admin_export_enabled": ENABLE_ADMIN_EXPORT,
|
"admin_export_enabled": ENABLE_ADMIN_EXPORT,
|
||||||
|
"websearch": RAG_WEB_SEARCH_ENABLED,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
export let fileUploadEnabled = true;
|
export let fileUploadEnabled = true;
|
||||||
export let speechRecognitionEnabled = true;
|
export let speechRecognitionEnabled = true;
|
||||||
|
|
||||||
export let webSearchAvailable = true; // TODO: Default to false
|
export let webSearchAvailable = false;
|
||||||
export let useWebSearch = false;
|
export let useWebSearch = false;
|
||||||
|
|
||||||
export let prompt = '';
|
export let prompt = '';
|
||||||
|
@ -129,6 +129,7 @@ type Config = {
|
|||||||
default_models?: string[];
|
default_models?: string[];
|
||||||
default_prompt_suggestions?: PromptSuggestion[];
|
default_prompt_suggestions?: PromptSuggestion[];
|
||||||
trusted_header_auth?: boolean;
|
trusted_header_auth?: boolean;
|
||||||
|
websearch?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type PromptSuggestion = {
|
type PromptSuggestion = {
|
||||||
|
@ -977,4 +977,5 @@
|
|||||||
{messages}
|
{messages}
|
||||||
{submitPrompt}
|
{submitPrompt}
|
||||||
{stopResponse}
|
{stopResponse}
|
||||||
|
webSearchAvailable={$config.websearch ?? false}
|
||||||
/>
|
/>
|
||||||
|
@ -994,5 +994,6 @@
|
|||||||
{messages}
|
{messages}
|
||||||
{submitPrompt}
|
{submitPrompt}
|
||||||
{stopResponse}
|
{stopResponse}
|
||||||
|
webSearchAvailable={$config.websearch ?? false}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
Loading…
Reference in New Issue
Block a user