Add user related headers when calling an external embedding api

This commit is contained in:
Didier FOURNOUT
2025-01-29 10:55:52 +00:00
parent b72150c881
commit 6ca295ec59
6 changed files with 70 additions and 32 deletions

View File

@@ -630,7 +630,7 @@ async def chat_completion_files_handler(
lambda: get_sources_from_files(
files=files,
queries=queries,
embedding_function=request.app.state.EMBEDDING_FUNCTION,
embedding_function=lambda query: request.app.state.EMBEDDING_FUNCTION(query,user=user),
k=request.app.state.config.TOP_K,
reranking_function=request.app.state.rf,
r=request.app.state.config.RELEVANCE_THRESHOLD,