feat(avatar): show multi-file knowledge upload progress

This commit is contained in:
stefanfeng
2026-09-04 16:40:16 +08:00
parent 97c4c73b58
commit 3edf92c7cc
9 changed files with 129 additions and 30 deletions
@@ -102,6 +102,8 @@ async def upload_doc(avatar_id: str, file: UploadFile = File(...), authorization
file_size=file_size,
file_url=f"/api/files/{avatar_id}/{stored}",
status="parsing",
index_stage="queued",
index_progress=0,
)
# Persist and acknowledge the upload first. Extraction and embeddings may take
@@ -134,6 +136,8 @@ def retry_doc(avatar_id: str, doc_id: str, authorization: str = Header(None), db
doc.chunk_count = 0
doc.vectorized_at = None
doc.error_message = ""
doc.index_stage = "queued"
doc.index_progress = 0
db.commit()
db.refresh(doc)
knowledge_vectorizer.enqueue(doc.id)