diff --git a/backend/apps/openai/main.py b/backend/apps/openai/main.py index c97fd99ce..65ed25f1c 100644 --- a/backend/apps/openai/main.py +++ b/backend/apps/openai/main.py @@ -119,7 +119,7 @@ async def speech(request: Request, user=Depends(get_verified_user)): headers = {} headers["Authorization"] = f"Bearer {app.state.config.OPENAI_API_KEYS[idx]}" headers["Content-Type"] = "application/json" - if "openrouter.ai" in app.state.OPENAI_API_BASE_URLS[idx]: + if "openrouter.ai" in app.state.config.OPENAI_API_BASE_URLS[idx]: headers["HTTP-Referer"] = "https://openwebui.com/" headers["X-Title"] = "Open WebUI" r = None diff --git a/backend/main.py b/backend/main.py index 3fc83949f..5b37adb3a 100644 --- a/backend/main.py +++ b/backend/main.py @@ -147,7 +147,7 @@ class RAGMiddleware(BaseHTTPMiddleware): messages=data["messages"], template=rag_app.state.config.RAG_TEMPLATE, embedding_function=rag_app.state.EMBEDDING_FUNCTION, - k=rag_app.state.TOP_K, + k=rag_app.state.config.TOP_K, reranking_function=rag_app.state.sentence_transformer_rf, r=rag_app.state.config.RELEVANCE_THRESHOLD, hybrid_search=rag_app.state.config.ENABLE_RAG_HYBRID_SEARCH,