refactor(backend): update Pydantic models for ingestion and query

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Woody 2026-04-23 13:26:20 +08:00
parent b93fc2e05b
commit 09f8cb7e6d
3 changed files with 23 additions and 20 deletions

View File

@ -0,0 +1,8 @@
from pydantic import BaseModel
class SourceMetadata(BaseModel):
filename: str
upload_date: str
content_summary: str
chunk_index: int

View File

@ -1,27 +1,7 @@
from datetime import datetime
from typing import List
from pydantic import BaseModel
class SourceMetadata(BaseModel):
filename: str
upload_date: str
content_summary: str
chunk_index: int
class IngestResponse(BaseModel):
document_id: str
chunk_count: int
filename: str
class QueryRequest(BaseModel):
question: str
class QueryResponse(BaseModel):
keywords: List[str]
answer: str
sources: List[SourceMetadata]

View File

@ -0,0 +1,15 @@
from typing import List
from pydantic import BaseModel
from app.models.common import SourceMetadata
class QueryRequest(BaseModel):
question: str
class QueryResponse(BaseModel):
keywords: List[str]
answer: str
sources: List[SourceMetadata]