Fix SSE route dependency and align architecture docs
This commit is contained in:
@@ -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"
|
||||
Reference in New Issue
Block a user