Spaces:
Runtime error
Runtime error
Download models/conversation.py from MaheenGhouri/fullstack_todo_app: direct link, hf CLI and curl.
- Browser
- Download file 903 Bytes
-
https://huggingface.co/spaces/MaheenGhouri/fullstack_todo_app/resolve/main/models/conversation.py
- Command line
-
hf download hf://spaces/MaheenGhouri/fullstack_todo_app/models/conversation.py
-
curl -L -o conversation.py https://huggingface.co/spaces/MaheenGhouri/fullstack_todo_app/resolve/main/models/conversation.py
903 Bytes
| from sqlmodel import SQLModel, Field | |
| from datetime import datetime | |
| from typing import Optional | |
| class ConversationBase(SQLModel): | |
| user_id: str = Field(nullable=False) | |
| class Conversation(ConversationBase, table=True): | |
| """ | |
| Represents a user's chat session with the AI agent | |
| """ | |
| id: Optional[int] = Field(default=None, primary_key=True) | |
| created_at: datetime = Field(default_factory=datetime.utcnow) | |
| updated_at: datetime = Field(default_factory=datetime.utcnow) | |
| class ConversationCreate(ConversationBase): | |
| """ | |
| Schema for creating a new conversation | |
| """ | |
| pass | |
| class ConversationRead(ConversationBase): | |
| """ | |
| Schema for returning conversation data | |
| """ | |
| id: int | |
| created_at: datetime | |
| updated_at: datetime | |
| class ConversationUpdate(SQLModel): | |
| """ | |
| Schema for updating an existing conversation | |
| """ | |
| user_id: Optional[str] = None |