projectdavid-common 0.16.1__py3-none-any.whl → 0.17.0__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.
- projectdavid_common/constants/tools.py +1 -0
- projectdavid_common/schemas/runs_schema.py +45 -16
- {projectdavid_common-0.16.1.dist-info → projectdavid_common-0.17.0.dist-info}/METADATA +1 -1
- {projectdavid_common-0.16.1.dist-info → projectdavid_common-0.17.0.dist-info}/RECORD +7 -7
- {projectdavid_common-0.16.1.dist-info → projectdavid_common-0.17.0.dist-info}/WHEEL +1 -1
- {projectdavid_common-0.16.1.dist-info → projectdavid_common-0.17.0.dist-info}/entry_points.txt +0 -0
- {projectdavid_common-0.16.1.dist-info → projectdavid_common-0.17.0.dist-info}/top_level.txt +0 -0
|
@@ -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,28 @@ 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: str # ← NEW
|
|
13
38
|
assistant_id: str
|
|
14
39
|
cancelled_at: Optional[int]
|
|
15
40
|
completed_at: Optional[int]
|
|
@@ -28,7 +53,7 @@ class Run(BaseModel):
|
|
|
28
53
|
required_action: Optional[str]
|
|
29
54
|
response_format: str
|
|
30
55
|
started_at: Optional[int]
|
|
31
|
-
status: str
|
|
56
|
+
status: RunStatus | str # accepts Enum or raw str
|
|
32
57
|
thread_id: str
|
|
33
58
|
tool_choice: str
|
|
34
59
|
tools: List[Tool]
|
|
@@ -41,9 +66,19 @@ class Run(BaseModel):
|
|
|
41
66
|
model_config = ConfigDict(from_attributes=True)
|
|
42
67
|
|
|
43
68
|
|
|
69
|
+
# --------------------------------------------------------------------------- #
|
|
70
|
+
# Payload used by SDK / tests when creating runs
|
|
71
|
+
# user_id is optional ‑ server overwrites it from auth context
|
|
72
|
+
# --------------------------------------------------------------------------- #
|
|
44
73
|
class RunCreate(BaseModel):
|
|
45
74
|
id: str
|
|
46
75
|
assistant_id: str
|
|
76
|
+
# ── NEW optional user_id (ignored by server if provided) ───────────── #
|
|
77
|
+
user_id: Optional[str] = Field(
|
|
78
|
+
default=None,
|
|
79
|
+
json_schema_extra={"readOnly": True}, # treated as server‑generated
|
|
80
|
+
)
|
|
81
|
+
# ───────────────────────────────────────────────────────────────────── #
|
|
47
82
|
cancelled_at: Optional[int] = None
|
|
48
83
|
completed_at: Optional[int] = None
|
|
49
84
|
created_at: int
|
|
@@ -61,7 +96,7 @@ class RunCreate(BaseModel):
|
|
|
61
96
|
required_action: Optional[str] = None
|
|
62
97
|
response_format: str = "text"
|
|
63
98
|
started_at: Optional[int] = None
|
|
64
|
-
status: str =
|
|
99
|
+
status: RunStatus | str = RunStatus.pending
|
|
65
100
|
thread_id: str
|
|
66
101
|
tool_choice: str = "none"
|
|
67
102
|
tools: List[Tool] = Field(default_factory=list)
|
|
@@ -74,8 +109,12 @@ class RunCreate(BaseModel):
|
|
|
74
109
|
model_config = ConfigDict(from_attributes=True)
|
|
75
110
|
|
|
76
111
|
|
|
112
|
+
# --------------------------------------------------------------------------- #
|
|
113
|
+
# Rich read model with actions attached
|
|
114
|
+
# --------------------------------------------------------------------------- #
|
|
77
115
|
class RunReadDetailed(BaseModel):
|
|
78
116
|
id: str
|
|
117
|
+
user_id: str # ← NEW
|
|
79
118
|
assistant_id: str
|
|
80
119
|
cancelled_at: Optional[datetime] = None
|
|
81
120
|
completed_at: Optional[datetime] = None
|
|
@@ -94,7 +133,7 @@ class RunReadDetailed(BaseModel):
|
|
|
94
133
|
required_action: Optional[str] = None
|
|
95
134
|
response_format: str
|
|
96
135
|
started_at: Optional[int] = None
|
|
97
|
-
status: str
|
|
136
|
+
status: RunStatus | str
|
|
98
137
|
thread_id: str
|
|
99
138
|
tool_choice: str
|
|
100
139
|
tools: List[ToolRead]
|
|
@@ -108,18 +147,8 @@ class RunReadDetailed(BaseModel):
|
|
|
108
147
|
model_config = ConfigDict(from_attributes=True)
|
|
109
148
|
|
|
110
149
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
|
|
150
|
+
# --------------------------------------------------------------------------- #
|
|
151
|
+
# Small helper for the status‑only update endpoint
|
|
152
|
+
# --------------------------------------------------------------------------- #
|
|
124
153
|
class RunStatusUpdate(BaseModel):
|
|
125
154
|
status: RunStatus
|
|
@@ -7,7 +7,7 @@ projectdavid_common/constants/assistant_map.py,sha256=sKCC5Rxm5HnsrkzlbLystRJUOV
|
|
|
7
7
|
projectdavid_common/constants/mime_types.py,sha256=vvuCYP_oreoRkP1D80eRgv8mQTNsQ_huoqO3fLUSviA,1729
|
|
8
8
|
projectdavid_common/constants/platform.py,sha256=ATXfVuEigWmhl0WRXLhObFlUegNPKdNHGLp4zBjKs04,2679
|
|
9
9
|
projectdavid_common/constants/timeouts.py,sha256=0kPHYVzSon29NfA8CPWZ-r4gf9nlzxO0TGhvMP60WLM,144
|
|
10
|
-
projectdavid_common/constants/tools.py,sha256=
|
|
10
|
+
projectdavid_common/constants/tools.py,sha256=FOsrnmwccklDrxRP1OUr22Xx5Uswg80LFaPHRTVdk7I,417
|
|
11
11
|
projectdavid_common/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
projectdavid_common/schemas/actions_schema.py,sha256=fJPZoY9hoL0-e6Lp_NqpjVhSIr_qrNLjmQycJf5gmN0,2985
|
|
13
13
|
projectdavid_common/schemas/api_key_schemas.py,sha256=PM6WOlzE-Y06v5YXLYXH5B2EmttMc8oiWbHd4Su81p4,4031
|
|
@@ -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=
|
|
19
|
+
projectdavid_common/schemas/runs_schema.py,sha256=CfX7w8SeuZ5Sd_kmz4QVw60NmQZDc_tgDBcyspH0yM0,5337
|
|
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.
|
|
30
|
-
projectdavid_common-0.
|
|
31
|
-
projectdavid_common-0.
|
|
32
|
-
projectdavid_common-0.
|
|
33
|
-
projectdavid_common-0.
|
|
29
|
+
projectdavid_common-0.17.0.dist-info/METADATA,sha256=-Zqu00MJsYaRiLGygmtN1RyCn8qyzDaYT5Rn6WBFYsU,1673
|
|
30
|
+
projectdavid_common-0.17.0.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
|
31
|
+
projectdavid_common-0.17.0.dist-info/entry_points.txt,sha256=Y8HAIUW0ifCKcAzAqR21wu1ATHNFWWWiUB33UYv095o,74
|
|
32
|
+
projectdavid_common-0.17.0.dist-info/top_level.txt,sha256=lJ-jkZ0n0jWktoMJFcw-DzLoMTY2juuw5fgMIqYu1UU,20
|
|
33
|
+
projectdavid_common-0.17.0.dist-info/RECORD,,
|
{projectdavid_common-0.16.1.dist-info → projectdavid_common-0.17.0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|