-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathinbox.py
More file actions
32 lines (23 loc) · 982 Bytes
/
inbox.py
File metadata and controls
32 lines (23 loc) · 982 Bytes
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
"""Inbox message models."""
from datetime import datetime
from enum import Enum
from typing import Literal
from pydantic import BaseModel, Field
OrchestrationType = Literal["send_message", "handoff", "assign"]
class MessageStatus(str, Enum):
"""Message status enumeration."""
PENDING = "pending"
DELIVERED = "delivered"
FAILED = "failed"
class InboxMessage(BaseModel):
"""Inbox message model."""
id: int = Field(..., description="Message ID")
sender_id: str = Field(..., description="Sender terminal ID")
receiver_id: str = Field(..., description="Receiver terminal ID")
message: str = Field(..., description="Message content")
orchestration_type: OrchestrationType = Field(
default="send_message",
description="The orchestration mode that caused the message delivery",
)
status: MessageStatus = Field(..., description="Message status")
created_at: datetime = Field(..., description="Creation timestamp")