Spaces:
Runtime error
Runtime error
| from pydantic import BaseModel | |
| from typing import Optional | |
| from datetime import datetime | |
| class SessionCreate(BaseModel): | |
| """Schema for creating a session.""" | |
| title: Optional[str] = "New Conversation" | |
| class SessionUpdate(BaseModel): | |
| """Schema for updating a session.""" | |
| title: Optional[str] = None | |
| class SessionResponse(BaseModel): | |
| """Schema for session response.""" | |
| id: str | |
| user_id: Optional[str] | |
| title: str | |
| summary: Optional[str] | |
| created_at: datetime | |
| updated_at: datetime | |
| message_count: Optional[int] = 0 | |
| class Config: | |
| from_attributes = True | |
| class SessionListResponse(BaseModel): | |
| """Schema for session list response.""" | |
| sessions: list[SessionResponse] | |
| total: int | |