Spaces:
Runtime error
Runtime error
File size: 749 Bytes
f3997d4 | 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 | 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
|