projectdavid-common 0.16.2__py3-none-any.whl → 0.17.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,8 @@
1
+ """
2
+ schemas/run_schema.py
3
+ Keeps client / server / SDK in sync with the new user_id column on runs.
4
+ """
5
+
1
6
  from datetime import datetime
2
7
  from enum import Enum
3
8
  from typing import Any, Dict, List, Optional
@@ -8,8 +13,31 @@ from projectdavid_common.schemas.actions_schema import ActionRead
8
13
  from projectdavid_common.schemas.tools_schema import Tool, ToolRead
9
14
 
10
15
 
16
+ # --------------------------------------------------------------------------- #
17
+ # Status enum (unchanged)
18
+ # --------------------------------------------------------------------------- #
19
+ class RunStatus(str, Enum):
20
+ queued = "queued"
21
+ in_progress = "in_progress"
22
+ pending_action = "action_required"
23
+ completed = "completed"
24
+ failed = "failed"
25
+ cancelled = "cancelled"
26
+ pending = "pending"
27
+ processing = "processing"
28
+ expired = "expired"
29
+ retrying = "retrying"
30
+
31
+
32
+ # --------------------------------------------------------------------------- #
33
+ # Base‑level model returned by most endpoints
34
+ # --------------------------------------------------------------------------- #
11
35
  class Run(BaseModel):
12
36
  id: str
37
+ user_id: Optional[str] = Field(
38
+ default=None,
39
+ json_schema_extra={"readOnly": True}, # ← Ensure this is set
40
+ )
13
41
  assistant_id: str
14
42
  cancelled_at: Optional[int]
15
43
  completed_at: Optional[int]
@@ -28,7 +56,7 @@ class Run(BaseModel):
28
56
  required_action: Optional[str]
29
57
  response_format: str
30
58
  started_at: Optional[int]
31
- status: str
59
+ status: RunStatus | str # accepts Enum or raw str
32
60
  thread_id: str
33
61
  tool_choice: str
34
62
  tools: List[Tool]
@@ -41,9 +69,19 @@ class Run(BaseModel):
41
69
  model_config = ConfigDict(from_attributes=True)
42
70
 
43
71
 
72
+ # --------------------------------------------------------------------------- #
73
+ # Payload used by SDK / tests when creating runs
74
+ # user_id is optional ‑ server overwrites it from auth context
75
+ # --------------------------------------------------------------------------- #
44
76
  class RunCreate(BaseModel):
45
77
  id: str
46
78
  assistant_id: str
79
+ # ── NEW optional user_id (ignored by server if provided) ───────────── #
80
+ user_id: Optional[str] = Field(
81
+ default=None,
82
+ json_schema_extra={"readOnly": True}, # treated as server‑generated
83
+ )
84
+ # ───────────────────────────────────────────────────────────────────── #
47
85
  cancelled_at: Optional[int] = None
48
86
  completed_at: Optional[int] = None
49
87
  created_at: int
@@ -61,7 +99,7 @@ class RunCreate(BaseModel):
61
99
  required_action: Optional[str] = None
62
100
  response_format: str = "text"
63
101
  started_at: Optional[int] = None
64
- status: str = "pending"
102
+ status: RunStatus | str = RunStatus.pending
65
103
  thread_id: str
66
104
  tool_choice: str = "none"
67
105
  tools: List[Tool] = Field(default_factory=list)
@@ -74,8 +112,12 @@ class RunCreate(BaseModel):
74
112
  model_config = ConfigDict(from_attributes=True)
75
113
 
76
114
 
115
+ # --------------------------------------------------------------------------- #
116
+ # Rich read model with actions attached
117
+ # --------------------------------------------------------------------------- #
77
118
  class RunReadDetailed(BaseModel):
78
119
  id: str
120
+ user_id: str # ← NEW
79
121
  assistant_id: str
80
122
  cancelled_at: Optional[datetime] = None
81
123
  completed_at: Optional[datetime] = None
@@ -94,7 +136,7 @@ class RunReadDetailed(BaseModel):
94
136
  required_action: Optional[str] = None
95
137
  response_format: str
96
138
  started_at: Optional[int] = None
97
- status: str
139
+ status: RunStatus | str
98
140
  thread_id: str
99
141
  tool_choice: str
100
142
  tools: List[ToolRead]
@@ -108,18 +150,8 @@ class RunReadDetailed(BaseModel):
108
150
  model_config = ConfigDict(from_attributes=True)
109
151
 
110
152
 
111
- class RunStatus(str, Enum):
112
- queued = "queued"
113
- in_progress = "in_progress"
114
- pending_action = "action_required"
115
- completed = "completed"
116
- failed = "failed"
117
- cancelled = "cancelled"
118
- pending = "pending"
119
- processing = "processing"
120
- expired = "expired"
121
- retrying = "retrying"
122
-
123
-
153
+ # --------------------------------------------------------------------------- #
154
+ # Small helper for the status‑only update endpoint
155
+ # --------------------------------------------------------------------------- #
124
156
  class RunStatusUpdate(BaseModel):
125
157
  status: RunStatus
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: projectdavid_common
3
- Version: 0.16.2
3
+ Version: 0.17.1
4
4
  Summary: Common shared custom packages
5
5
  Author-email: "Francis N." <francis.neequaye@projectdavid.co.uk>
6
6
  License: MIT
@@ -16,7 +16,7 @@ projectdavid_common/schemas/enums.py,sha256=1fyrH1pKvxXaOUwCGpr3TZovJZOolgezdOXv
16
16
  projectdavid_common/schemas/files_schema.py,sha256=hNMqVDRc5lsdhxyPWO79QjIpE7NKmKzdQ6hJG8L6LfA,3025
17
17
  projectdavid_common/schemas/inference_schema.py,sha256=LPjKDCq7jBPbQCgwlM97rxO477v3vWwb6RYh4DW0KIs,228
18
18
  projectdavid_common/schemas/messages_schema.py,sha256=HNGFO-3_xPBDl133CauL5lK3hhUXpLCM3LU9VylyIDg,2589
19
- projectdavid_common/schemas/runs_schema.py,sha256=l8w68QpEBSe3kGHQIj15Fr4gMkk3_ftlHYs0UpHURDg,3552
19
+ projectdavid_common/schemas/runs_schema.py,sha256=WBkNwqcXEnleEJiGhftqm1NNnM21do4aEtJQv31fs60,5445
20
20
  projectdavid_common/schemas/stream_schema.py,sha256=_0Op35E5TZ-XLM8j5b3xDRuUobGq2eh40oCx1RyGi_A,645
21
21
  projectdavid_common/schemas/threads_schema.py,sha256=DRqiVDoAdAvJ-ALhvjzyVoGkFVrewtA3GOGPVt0IG_0,1293
22
22
  projectdavid_common/schemas/tools_schema.py,sha256=RywLJk1a1-liPnqpf8s9IfTaMBG6uqj3YtV52H7U18g,1815
@@ -26,8 +26,8 @@ projectdavid_common/schemas/vectors_schema.py,sha256=KG4HSa6yVgBLe01iSdXKoU3UxRS
26
26
  projectdavid_common/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  projectdavid_common/utilities/identifier_service.py,sha256=7hL4_i7pGs6bibCSkXQIwpMSUCFASFE0VPm6gqMv4sk,2950
28
28
  projectdavid_common/utilities/logging_service.py,sha256=ONKy3PRjIrxIrTJ_X3iv7v9HA0wyejyw4WrQYlJy7Oc,2614
29
- projectdavid_common-0.16.2.dist-info/METADATA,sha256=K2Kb5kbGjHqZax05mOe5GxL7nXq-F5xyw6NXXhA_8ys,1673
30
- projectdavid_common-0.16.2.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
31
- projectdavid_common-0.16.2.dist-info/entry_points.txt,sha256=Y8HAIUW0ifCKcAzAqR21wu1ATHNFWWWiUB33UYv095o,74
32
- projectdavid_common-0.16.2.dist-info/top_level.txt,sha256=lJ-jkZ0n0jWktoMJFcw-DzLoMTY2juuw5fgMIqYu1UU,20
33
- projectdavid_common-0.16.2.dist-info/RECORD,,
29
+ projectdavid_common-0.17.1.dist-info/METADATA,sha256=wmRmu-GUl8dvZWjR-8In8PbZ0YWA_SFJe980d5X-mA8,1673
30
+ projectdavid_common-0.17.1.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
31
+ projectdavid_common-0.17.1.dist-info/entry_points.txt,sha256=Y8HAIUW0ifCKcAzAqR21wu1ATHNFWWWiUB33UYv095o,74
32
+ projectdavid_common-0.17.1.dist-info/top_level.txt,sha256=lJ-jkZ0n0jWktoMJFcw-DzLoMTY2juuw5fgMIqYu1UU,20
33
+ projectdavid_common-0.17.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: setuptools (80.4.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5