-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmodels.py
More file actions
128 lines (98 loc) · 3.01 KB
/
models.py
File metadata and controls
128 lines (98 loc) · 3.01 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
"""
Pydantic models for the ShipBob Omi plugin.
"""
from datetime import datetime
from typing import List, Optional, Any, Dict
from pydantic import BaseModel, Field
# Omi Chat Tool Models
class ChatToolRequest(BaseModel):
"""Base request model for Omi chat tools."""
uid: str
app_id: str
tool_name: str
class ChatToolResponse(BaseModel):
"""Response model for Omi chat tools."""
result: Optional[str] = None
error: Optional[str] = None
# ShipBob Data Models
class ShipBobUser(BaseModel):
"""ShipBob user information."""
id: Optional[int] = None
email: Optional[str] = None
name: Optional[str] = None
class ShipBobChannel(BaseModel):
"""ShipBob channel information."""
id: int
name: str
class FulfillmentCenter(BaseModel):
"""ShipBob fulfillment center."""
id: int
name: str
class InventoryItem(BaseModel):
"""ShipBob inventory item."""
id: int
name: str
sku: Optional[str] = None
total_fulfillable_quantity: int = 0
total_onhand_quantity: int = 0
total_committed_quantity: int = 0
total_sellable_quantity: int = 0
total_awaiting_quantity: int = 0
total_exception_quantity: int = 0
class Product(BaseModel):
"""ShipBob product."""
id: int
reference_id: Optional[str] = None
name: str
sku: Optional[str] = None
inventory_id: Optional[int] = None
class BoxItem(BaseModel):
"""Box item for WRO."""
inventory_id: int
quantity: int
lot_number: Optional[str] = None
lot_date: Optional[str] = None
class WROBox(BaseModel):
"""Box for WRO."""
tracking_number: Optional[str] = None
box_items: List[BoxItem]
class WarehouseReceivingOrder(BaseModel):
"""ShipBob Warehouse Receiving Order."""
id: int
status: str
purchase_order_number: Optional[str] = None
expected_arrival_date: Optional[str] = None
fulfillment_center_id: Optional[int] = None
insert_date: Optional[str] = None
class Order(BaseModel):
"""ShipBob order."""
id: int
order_number: Optional[str] = None
status: str
created_date: Optional[str] = None
shipping_method: Optional[str] = None
# Omi Conversation Models (for future memory/webhook integrations)
class TranscriptSegment(BaseModel):
"""Transcript segment from Omi conversation."""
text: str
speaker: Optional[str] = "SPEAKER_00"
is_user: bool
start: float
end: float
class Structured(BaseModel):
"""Structured conversation data."""
title: str
overview: str
emoji: str = ""
category: str = "other"
class Conversation(BaseModel):
"""Omi conversation model."""
created_at: datetime
started_at: Optional[datetime] = None
finished_at: Optional[datetime] = None
transcript_segments: List[TranscriptSegment] = []
structured: Structured
discarded: bool
class EndpointResponse(BaseModel):
"""Standard endpoint response for Omi webhooks."""
message: str = Field(description="A short message to be sent as notification to the user, if needed.", default="")