Download src/models/conversation.py from umarwaqar/phase-iii: direct link, hf CLI and curl.
- Browser
- Download file 847 Bytes
-
https://huggingface.co/spaces/umarwaqar/phase-iii/resolve/main/src/models/conversation.py
- Command line
-
hf download hf://spaces/umarwaqar/phase-iii/src/models/conversation.py
-
curl -L -o conversation.py https://huggingface.co/spaces/umarwaqar/phase-iii/resolve/main/src/models/conversation.py
847 Bytes
| from sqlmodel import SQLModel, Field | |
| from typing import Optional | |
| from datetime import datetime | |
| import uuid | |
| class Conversation(SQLModel, table=True): | |
| """SQLModel for Conversation entity""" | |
| __tablename__ = "conversations" | |
| id: str = Field(default_factory=lambda: str(uuid.uuid4()), primary_key=True) | |
| user_id: str = Field(index=True) # References Better Auth user | |
| created_at: datetime = Field(default_factory=datetime.utcnow, index=True) | |
| updated_at: datetime = Field(default_factory=datetime.utcnow) | |
| class ConversationCreate(SQLModel): | |
| """Schema for creating a new conversation""" | |
| # user_id will be extracted from JWT, not provided by client | |
| pass | |
| class ConversationResponse(SQLModel): | |
| """Schema for conversation response""" | |
| id: str | |
| user_id: str | |
| created_at: datetime | |
| updated_at: datetime | |