mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac
This commit is contained in:
@@ -642,8 +642,8 @@ def resolve_hostname(hostname):
|
||||
return ipv4_addresses, ipv6_addresses
|
||||
|
||||
|
||||
@app.post("/websearch")
|
||||
def store_websearch(form_data: SearchForm, user=Depends(get_current_user)):
|
||||
@app.post("/web/search")
|
||||
def store_web_search(form_data: SearchForm, user=Depends(get_current_user)):
|
||||
try:
|
||||
try:
|
||||
web_results = search_web(form_data.query)
|
||||
|
||||
@@ -574,6 +574,7 @@ ENABLE_COMMUNITY_SHARING = PersistentConfig(
|
||||
os.environ.get("ENABLE_COMMUNITY_SHARING", "True").lower() == "true",
|
||||
)
|
||||
|
||||
|
||||
class BannerModel(BaseModel):
|
||||
id: str
|
||||
type: str
|
||||
@@ -772,6 +773,8 @@ 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 != "")
|
||||
@@ -779,6 +782,7 @@ RAG_WEB_SEARCH_ENABLED = (
|
||||
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")
|
||||
|
||||
@@ -365,7 +365,7 @@ async def get_app_config():
|
||||
"auth": WEBUI_AUTH,
|
||||
"auth_trusted_header": bool(webui_app.state.AUTH_TRUSTED_EMAIL_HEADER),
|
||||
"enable_signup": webui_app.state.config.ENABLE_SIGNUP,
|
||||
"enable_websearch": RAG_WEB_SEARCH_ENABLED,
|
||||
"enable_web_search": RAG_WEB_SEARCH_ENABLED,
|
||||
"enable_image_generation": images_app.state.config.ENABLED,
|
||||
"enable_community_sharing": webui_app.state.config.ENABLE_COMMUNITY_SHARING,
|
||||
"enable_admin_export": ENABLE_ADMIN_EXPORT,
|
||||
|
||||
Reference in New Issue
Block a user