Spaces:
Sleeping
Sleeping
File size: 1,020 Bytes
db7c1e8 | 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 | """
Document models for the AI Backend with RAG + Authentication
Pydantic models for document-related request/response validation
"""
from pydantic import BaseModel, Field
from typing import Optional, Dict, Any
from uuid import UUID
from datetime import datetime
class DocumentCreate(BaseModel):
title: str = Field(..., min_length=1, max_length=255, description="Document title")
content: str = Field(..., min_length=1, description="Document content")
file_path: Optional[str] = Field(None, max_length=500, description="Path if uploaded file")
metadata: Optional[Dict[str, Any]] = Field(None, description="Additional metadata")
class DocumentResponse(BaseModel):
document_id: UUID
success: bool
message: str
class DocumentUpdate(BaseModel):
title: Optional[str] = Field(None, min_length=1, max_length=255)
content: Optional[str] = Field(None, min_length=1)
metadata: Optional[Dict[str, Any]] = None
class DocumentListResponse(BaseModel):
documents: list
total: int |