projectdavid-common 0.17.3__py3-none-any.whl → 0.17.4__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.
@@ -5,76 +5,52 @@ from pydantic import BaseModel, ConfigDict, Field, HttpUrl
5
5
  from projectdavid_common.schemas.vectors_schema import VectorStoreRead
6
6
 
7
7
 
8
- # ────────────────────────────────────────────────────────────────────────────
8
+ # ───────────────────────────────────────────────
9
9
  # ASSISTANT • CREATE
10
- # ────────────────────────────────────────────────────────────────────────────
10
+ # ───────────────────────────────────────────────
11
11
  class AssistantCreate(BaseModel):
12
- id: Optional[str] = Field(
13
- None,
14
- description="Optional pre-generated assistant ID (leave blank for auto).",
15
- )
12
+ id: Optional[str] = Field(None, description="Optional pre-generated assistant ID.")
13
+
14
+ # ─── core info ────────────────────────────
16
15
  name: str = Field(..., description="Assistant name")
17
16
  description: str = Field("", description="Brief description")
18
17
  model: str = Field(..., description="LLM model ID")
19
- instructions: str = Field("", description="System instructions / guidelines for the assistant")
18
+ instructions: str = Field("", description="System instructions")
20
19
 
21
- # ─── tool definitions ────────────────────────────────────────────
22
- tools: Optional[List[dict]] = Field(
23
- None, description="OpenAI-style tool specs (name, parameters …)"
24
- )
25
- tool_resources: Optional[Dict[str, Dict[str, Any]]] = Field(
26
- None,
27
- description=(
28
- "Per-tool resource map, keyed by tool type. Example:\n"
29
- "{\n"
30
- " 'code_interpreter': { 'file_ids': ['f_abc'] },\n"
31
- " 'file_search': { 'vector_store_ids': ['vs_123'] }\n"
32
- "}"
33
- ),
34
- )
20
+ # ─── tools & resources ────────────────────
21
+ tools: Optional[List[dict]] = Field(None, description="OpenAI-style tool specs (dicts).")
22
+ tool_resources: Optional[Dict[str, Dict[str, Any]]] = None
35
23
 
36
- # ─── misc settings ───────────────────────────────────────────────
37
- meta_data: Optional[dict] = Field(None, description="Free-form metadata")
38
- top_p: float = Field(1.0, ge=0, le=1, description="top-p sampling value")
39
- temperature: float = Field(1.0, ge=0, le=2, description="temperature value")
40
- response_format: str = Field("auto", description="Response format")
41
-
42
- # ─── webhook settings ────────────────────────────────────────────
43
- webhook_url: Optional[HttpUrl] = Field(
44
- None,
45
- description="Endpoint for run.action_required callbacks",
46
- examples=["https://myapp.com/webhooks/actions"],
47
- )
48
- webhook_secret: Optional[str] = Field(
49
- None,
50
- min_length=16,
51
- description="HMAC secret used to sign outgoing webhooks",
52
- examples=["whsec_ReplaceWithARealSecureSecret123"],
53
- )
24
+ # ─── misc settings ────────────────────────
25
+ meta_data: Optional[dict] = None
26
+ top_p: float = Field(1.0, ge=0, le=1)
27
+ temperature: float = Field(1.0, ge=0, le=2)
28
+ response_format: str = Field("auto")
29
+
30
+ # ─── webhooks ─────────────────────────────
31
+ webhook_url: Optional[HttpUrl] = None
32
+ webhook_secret: Optional[str] = Field(None, min_length=16)
54
33
 
55
34
  model_config = ConfigDict(
56
35
  json_schema_extra={
57
36
  "example": {
58
37
  "name": "Search Assistant",
59
- "description": "Assistant that can search company docs",
60
38
  "model": "gpt-4o-mini",
61
- "instructions": "Use tools when relevant.",
62
39
  "tool_resources": {"file_search": {"vector_store_ids": ["vs_docs"]}},
63
- "top_p": 0.9,
64
- "temperature": 0.7,
65
40
  }
66
41
  }
67
42
  )
68
43
 
69
44
 
70
- # ────────────────────────────────────────────────────────────────────────────
45
+ # ───────────────────────────────────────────────
71
46
  # ASSISTANT • READ
72
- # ────────────────────────────────────────────────────────────────────────────
47
+ # ───────────────────────────────────────────────
73
48
  class AssistantRead(BaseModel):
74
49
  id: str
75
50
  user_id: Optional[str] = None
76
51
  object: str
77
52
  created_at: int
53
+
78
54
  name: str
79
55
  description: Optional[str] = None
80
56
  model: str
@@ -91,50 +67,34 @@ class AssistantRead(BaseModel):
91
67
  vector_stores: List[VectorStoreRead] = Field(default_factory=list)
92
68
  webhook_url: Optional[HttpUrl] = None
93
69
 
94
- model_config = ConfigDict(
95
- from_attributes=True,
96
- json_schema_extra={
97
- "example": {
98
- "id": "asst_abc123",
99
- "user_id": "user_xyz",
100
- "object": "assistant",
101
- "created_at": 1710000000,
102
- "name": "Search Assistant",
103
- "model": "gpt-4o-mini",
104
- "tool_resources": {"file_search": {"vector_store_ids": ["vs_docs"]}},
105
- "top_p": 1.0,
106
- "temperature": 0.7,
107
- "response_format": "auto",
108
- }
109
- },
110
- )
70
+ model_config = ConfigDict(from_attributes=True)
111
71
 
112
72
 
113
- # ────────────────────────────────────────────────────────────────────────────
114
- # ASSISTANT • UPDATE
115
- # ────────────────────────────────────────────────────────────────────────────
73
+ # ───────────────────────────────────────────────
74
+ # ASSISTANT • UPDATE (patched)
75
+ # ───────────────────────────────────────────────
116
76
  class AssistantUpdate(BaseModel):
77
+ # ─── scalar fields ────────────────────────
117
78
  name: Optional[str] = None
118
79
  description: Optional[str] = None
119
80
  model: Optional[str] = None
120
81
  instructions: Optional[str] = None
121
-
122
- tools: Optional[List[Any]] = None
123
- tool_resources: Optional[Dict[str, Dict[str, Any]]] = None
124
-
125
82
  meta_data: Optional[Dict[str, Any]] = None
126
83
  top_p: Optional[float] = Field(None, ge=0, le=1)
127
84
  temperature: Optional[float] = Field(None, ge=0, le=2)
128
85
  response_format: Optional[str] = None
129
86
 
87
+ # ─── relationship IDs (lists of strings) ──
88
+ tools: Optional[List[str]] = None
89
+ users: Optional[List[str]] = None
90
+ vector_stores: Optional[List[str]] = None
91
+
92
+ # ─── JSON config ─────────────────────────
93
+ tool_resources: Optional[Dict[str, Dict[str, Any]]] = None
94
+
95
+ # ─── webhooks ─────────────────────────────
130
96
  webhook_url: Optional[HttpUrl] = None
131
97
  webhook_secret: Optional[str] = Field(None, min_length=16)
132
98
 
133
- model_config = ConfigDict(
134
- json_schema_extra={
135
- "example": {
136
- "name": "Updated name",
137
- "tool_resources": {"code_interpreter": {"file_ids": ["f_new_readme"]}},
138
- }
139
- }
140
- )
99
+ # forbid unknown keys so stray dicts can’t sneak in
100
+ model_config = ConfigDict(extra="forbid")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: projectdavid_common
3
- Version: 0.17.3
3
+ Version: 0.17.4
4
4
  Summary: Common shared custom packages
5
5
  Author-email: "Francis N." <francis.neequaye@projectdavid.co.uk>
6
6
  License: MIT
@@ -11,7 +11,7 @@ projectdavid_common/constants/tools.py,sha256=FOsrnmwccklDrxRP1OUr22Xx5Uswg80LFa
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
14
- projectdavid_common/schemas/assistants_schema.py,sha256=kOWnxT3yXVF1j2qU1G1tpgrxDBRYrTQ9Oeh2VDQVhZE,6229
14
+ projectdavid_common/schemas/assistants_schema.py,sha256=TMH50SM2ZPbTdnaY7_qmvLev2CES8xQtrQAcwnBH5tI,4401
15
15
  projectdavid_common/schemas/enums.py,sha256=pQdkz_hmfU_vcZdn4XOvcPOcQihaX_iuQIFk-yKTiaw,692
16
16
  projectdavid_common/schemas/files_schema.py,sha256=hNMqVDRc5lsdhxyPWO79QjIpE7NKmKzdQ6hJG8L6LfA,3025
17
17
  projectdavid_common/schemas/inference_schema.py,sha256=LPjKDCq7jBPbQCgwlM97rxO477v3vWwb6RYh4DW0KIs,228
@@ -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.17.3.dist-info/METADATA,sha256=v_Iqv7smnkymnUfQTgyfZYpxHZ3bFWpdAg-CreoyZWw,1673
30
- projectdavid_common-0.17.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
- projectdavid_common-0.17.3.dist-info/entry_points.txt,sha256=Y8HAIUW0ifCKcAzAqR21wu1ATHNFWWWiUB33UYv095o,74
32
- projectdavid_common-0.17.3.dist-info/top_level.txt,sha256=lJ-jkZ0n0jWktoMJFcw-DzLoMTY2juuw5fgMIqYu1UU,20
33
- projectdavid_common-0.17.3.dist-info/RECORD,,
29
+ projectdavid_common-0.17.4.dist-info/METADATA,sha256=nBPeZ6JUqPB14QVo7Qhf0YbIw7jC1e0kI6ObQqnbchA,1673
30
+ projectdavid_common-0.17.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
+ projectdavid_common-0.17.4.dist-info/entry_points.txt,sha256=Y8HAIUW0ifCKcAzAqR21wu1ATHNFWWWiUB33UYv095o,74
32
+ projectdavid_common-0.17.4.dist-info/top_level.txt,sha256=lJ-jkZ0n0jWktoMJFcw-DzLoMTY2juuw5fgMIqYu1UU,20
33
+ projectdavid_common-0.17.4.dist-info/RECORD,,