Spaces:
Running
Running
# src/models/document.py | |
from pydantic import BaseModel | |
from typing import Optional, List, Dict, Any | |
class DocumentInfo(BaseModel): | |
"""Document information model""" | |
original_filename: str | |
size: int | |
content_type: str | |
url_path: str | |
class DocumentResponse(BaseModel): | |
"""Response model for document processing""" | |
message: str | |
document_id: str | |
status: str | |
document_info: Optional[DocumentInfo] = None | |
class BatchUploadResponse(BaseModel): | |
"""Response model for batch document upload""" | |
message: str | |
processed_files: List[DocumentResponse] | |
failed_files: List[dict] | |
class StoredDocument(BaseModel): | |
"""Model for a document stored in the vector store""" | |
id: str | |
text: str | |
embedding: Optional[List[float]] = None | |
metadata: Optional[Dict[str, Any]] = None | |
class AllDocumentsResponse(BaseModel): | |
"""Response model for retrieving all documents""" | |
total_documents: int | |
documents: List[StoredDocument] |