Spaces:
Running
Running
Download models/messaging.py from CosmicMagnetar/OpenTriage_AI: direct link, hf CLI and curl.
- Browser
- Download file 506 Bytes
-
https://huggingface.co/spaces/CosmicMagnetar/OpenTriage_AI/resolve/main/models/messaging.py
- Command line
-
hf download hf://spaces/CosmicMagnetar/OpenTriage_AI/models/messaging.py
-
curl -L -o messaging.py https://huggingface.co/spaces/CosmicMagnetar/OpenTriage_AI/resolve/main/models/messaging.py
506 Bytes
| from pydantic import BaseModel, Field, ConfigDict | |
| from datetime import datetime, timezone | |
| from typing import Optional | |
| import uuid | |
| class Message(BaseModel): | |
| model_config = ConfigDict(extra="ignore") | |
| id: str = Field(default_factory=lambda: str(uuid.uuid4())) | |
| sender_id: str | |
| receiver_id: str | |
| content: str | |
| read: bool = False | |
| timestamp: datetime = Field(default_factory=lambda: datetime.now(timezone.utc)) | |
| class SendMessageRequest(BaseModel): | |
| receiver_id: str | |
| content: str | |