fix: missing parameter

This commit is contained in:
Gabriel Ecegi 2024-12-30 17:36:34 +01:00
parent d94134ad2d
commit ba2964cb01
2 changed files with 9 additions and 2 deletions

View File

@ -520,6 +520,7 @@ async def reset_knowledge_by_id(id: str, user=Depends(get_verified_user)):
@router.post("/{id}/files/batch/add", response_model=Optional[KnowledgeFilesResponse]) @router.post("/{id}/files/batch/add", response_model=Optional[KnowledgeFilesResponse])
def add_files_to_knowledge_batch( def add_files_to_knowledge_batch(
request: Request,
id: str, id: str,
form_data: list[KnowledgeFileIdForm], form_data: list[KnowledgeFileIdForm],
user=Depends(get_verified_user), user=Depends(get_verified_user),
@ -555,7 +556,9 @@ def add_files_to_knowledge_batch(
# Process files # Process files
try: try:
result = process_files_batch( result = process_files_batch(
BatchProcessFilesForm(files=files, collection_name=id) request=request,
form_data=BatchProcessFilesForm(files=files, collection_name=id),
user=user
) )
except Exception as e: except Exception as e:
log.error( log.error(

View File

@ -1458,6 +1458,7 @@ class BatchProcessFilesResponse(BaseModel):
@router.post("/process/files/batch") @router.post("/process/files/batch")
def process_files_batch( def process_files_batch(
request: Request,
form_data: BatchProcessFilesForm, form_data: BatchProcessFilesForm,
user=Depends(get_verified_user), user=Depends(get_verified_user),
) -> BatchProcessFilesResponse: ) -> BatchProcessFilesResponse:
@ -1504,7 +1505,10 @@ def process_files_batch(
if all_docs: if all_docs:
try: try:
save_docs_to_vector_db( save_docs_to_vector_db(
docs=all_docs, collection_name=collection_name, add=True request=request,
docs=all_docs,
collection_name=collection_name,
add=True,
) )
# Update all files with collection name # Update all files with collection name