Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
d45804d7
"src/vscode:/vscode.git/clone" did not exist on "be6cc1c53adcaac2261923c160a398ee1b1274df"
Commit
d45804d7
authored
May 12, 2024
by
Jun Siang Cheah
Browse files
feat: web search available is inferred from env vars
parent
9ed1a315
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
1 deletion
+13
-1
backend/config.py
backend/config.py
+7
-0
backend/main.py
backend/main.py
+2
-0
src/lib/components/chat/MessageInput.svelte
src/lib/components/chat/MessageInput.svelte
+1
-1
src/lib/stores/index.ts
src/lib/stores/index.ts
+1
-0
src/routes/(app)/+page.svelte
src/routes/(app)/+page.svelte
+1
-0
src/routes/(app)/c/[id]/+page.svelte
src/routes/(app)/c/[id]/+page.svelte
+1
-0
No files found.
backend/config.py
View file @
d45804d7
...
...
@@ -563,6 +563,13 @@ BRAVE_SEARCH_API_KEY = os.getenv("BRAVE_SEARCH_API_KEY", "")
SERPSTACK_API_KEY
=
os
.
getenv
(
"SERPSTACK_API_KEY"
,
""
)
SERPSTACK_HTTPS
=
os
.
getenv
(
"SERPSTACK_HTTPS"
,
"True"
).
lower
()
==
"true"
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_CONCURRENT_REQUESTS
=
int
(
os
.
getenv
(
"RAG_WEB_SEARCH_CONCURRENT_REQUESTS"
,
"10"
)
...
...
backend/main.py
View file @
d45804d7
...
...
@@ -58,6 +58,7 @@ from config import (
SRC_LOG_LEVELS
,
WEBHOOK_URL
,
ENABLE_ADMIN_EXPORT
,
RAG_WEB_SEARCH_ENABLED
,
)
from
constants
import
ERROR_MESSAGES
...
...
@@ -248,6 +249,7 @@ async def get_app_config():
"default_prompt_suggestions"
:
webui_app
.
state
.
DEFAULT_PROMPT_SUGGESTIONS
,
"trusted_header_auth"
:
bool
(
webui_app
.
state
.
AUTH_TRUSTED_EMAIL_HEADER
),
"admin_export_enabled"
:
ENABLE_ADMIN_EXPORT
,
"websearch"
:
RAG_WEB_SEARCH_ENABLED
,
}
...
...
src/lib/components/chat/MessageInput.svelte
View file @
d45804d7
...
...
@@ -47,7 +47,7 @@
export let fileUploadEnabled = true;
export let speechRecognitionEnabled = true;
export let webSearchAvailable =
true; // TODO: Default to
false
export let webSearchAvailable = false
;
export let useWebSearch = false;
export let prompt = '';
...
...
src/lib/stores/index.ts
View file @
d45804d7
...
...
@@ -129,6 +129,7 @@ type Config = {
default_models
?:
string
[];
default_prompt_suggestions
?:
PromptSuggestion
[];
trusted_header_auth
?:
boolean
;
websearch
?:
boolean
;
};
type
PromptSuggestion
=
{
...
...
src/routes/(app)/+page.svelte
View file @
d45804d7
...
...
@@ -977,4 +977,5 @@
{
messages
}
{
submitPrompt
}
{
stopResponse
}
webSearchAvailable
={$
config
.
websearch
??
false
}
/>
src/routes/(app)/c/[id]/+page.svelte
View file @
d45804d7
...
...
@@ -994,5 +994,6 @@
{
messages
}
{
submitPrompt
}
{
stopResponse
}
webSearchAvailable
={$
config
.
websearch
??
false
}
/>
{/
if
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment