Merge branch 'dev' into feat/backend-web-search

This commit is contained in:
Jun Siang Cheah 2024-05-14 15:20:52 +08:00
commit 81a3c97069
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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,