Fix SSE route dependency and align architecture docs

This commit is contained in:
ash66
2026-05-18 16:32:42 +08:00
parent 86b9ac806a
commit 3f69cad404
149 changed files with 4786 additions and 5957 deletions

View File

@@ -1,9 +1,14 @@
"""Define schema models for doc."""
from pydantic import BaseModel
from typing import Optional
from datetime import datetime
# Group related schema definitions so validation rules stay consistent.
class DocumentUploadResponse(BaseModel):
"""Define the Document Upload Response API model."""
doc_id: str
filename: str
size: int
@@ -11,6 +16,7 @@ class DocumentUploadResponse(BaseModel):
class DocumentInfo(BaseModel):
"""Define the Document Info API model."""
id: str
name: str
chunks: int
@@ -19,10 +25,12 @@ class DocumentInfo(BaseModel):
class DocumentListResponse(BaseModel):
"""Define the Document List Response API model."""
docs: list[DocumentInfo]
class ChunkInfo(BaseModel):
"""Define the Chunk Info API model."""
chunk_id: str
doc_name: str
clause_id: Optional[str] = None
@@ -33,12 +41,14 @@ class ChunkInfo(BaseModel):
class ParseResponse(BaseModel):
"""Define the Parse Response API model."""
doc_id: str
chunks: int
status: str = "parsed"
class EmbedResponse(BaseModel):
"""Define the Embed Response API model."""
doc_id: str
vectors: int
status: str = "embedded"