Fix process/files/batch

This commit is contained in:
Gabriel Ecegi
2024-12-14 10:45:27 +01:00
parent f2e2b59c18
commit 440894f8d3
2 changed files with 18 additions and 18 deletions

View File

@@ -548,10 +548,17 @@ def add_files_to_knowledge_batch(
files.append(file)
# Process files
result = process_files_batch(BatchProcessFilesForm(
files=files,
collection_name=id
))
try:
result = process_files_batch(BatchProcessFilesForm(
files=files,
collection_name=id
))
except Exception as e:
log.error(f"add_files_to_knowledge_batch: Exception occurred: {e}", exc_info=True)
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=str(e)
)
# Add successful files to knowledge base
data = knowledge.data or {}