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

@@ -285,7 +285,9 @@ def add_file_to_knowledge_by_id(
# Add content to the vector database
try:
process_file(
request, ProcessFileForm(file_id=form_data.file_id, collection_name=id)
request,
ProcessFileForm(file_id=form_data.file_id, collection_name=id),
user=user
)
except Exception as e:
log.debug(e)
@@ -363,7 +365,9 @@ def update_file_from_knowledge_by_id(
# Add content to the vector database
try:
process_file(
request, ProcessFileForm(file_id=form_data.file_id, collection_name=id)
request,
ProcessFileForm(file_id=form_data.file_id, collection_name=id),
user=user
)
except Exception as e:
raise HTTPException(