File size: 982 Bytes
4daad35
e9d730a
d161383
e9d730a
 
 
 
 
 
4daad35
e9d730a
 
 
 
 
 
 
 
 
 
 
 
d161383
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#  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]