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:
parent
b93fc2e05b
commit
09f8cb7e6d
|
|
@ -0,0 +1,8 @@
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
|
||||||
|
class SourceMetadata(BaseModel):
|
||||||
|
filename: str
|
||||||
|
upload_date: str
|
||||||
|
content_summary: str
|
||||||
|
chunk_index: int
|
||||||
|
|
@ -1,27 +1,7 @@
|
||||||
from datetime import datetime
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
|
||||||
class SourceMetadata(BaseModel):
|
|
||||||
filename: str
|
|
||||||
upload_date: str
|
|
||||||
content_summary: str
|
|
||||||
chunk_index: int
|
|
||||||
|
|
||||||
|
|
||||||
class IngestResponse(BaseModel):
|
class IngestResponse(BaseModel):
|
||||||
document_id: str
|
document_id: str
|
||||||
chunk_count: int
|
chunk_count: int
|
||||||
filename: str
|
filename: str
|
||||||
|
|
||||||
|
|
||||||
class QueryRequest(BaseModel):
|
|
||||||
question: str
|
|
||||||
|
|
||||||
|
|
||||||
class QueryResponse(BaseModel):
|
|
||||||
keywords: List[str]
|
|
||||||
answer: str
|
|
||||||
sources: List[SourceMetadata]
|
|
||||||
|
|
|
||||||
|
|
@ -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]
|
||||||
Loading…
Reference in New Issue