projectdavid 1.33.30__py3-none-any.whl → 1.33.32__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.

Potentially problematic release.


This version of projectdavid might be problematic. Click here for more details.

@@ -153,18 +153,21 @@ class MessagesClient(BaseAPIClient):
153
153
  raise
154
154
 
155
155
  def list_messages(
156
- self, thread_id: str, limit: int = 20, order: str = "asc"
157
- ) -> List[Dict[str, Any]]:
156
+ self,
157
+ thread_id: str,
158
+ limit: int = 20,
159
+ order: str = "asc",
160
+ ) -> ent_validator.MessagesList:
158
161
  """
159
- List messages for a given thread.
162
+ Fetch messages for a thread and return an OpenAI-style envelope.
160
163
 
161
164
  Args:
162
- thread_id (str): The thread ID.
163
- limit (int): Maximum number of messages to retrieve.
164
- order (str): Order of messages ('asc' or 'desc').
165
+ thread_id (str): Target thread ID.
166
+ limit (int): Max messages to fetch.
167
+ order (str): 'asc' or 'desc'.
165
168
 
166
169
  Returns:
167
- List[Dict[str, Any]]: A list of messages as dictionaries.
170
+ MessagesList: Wrapper containing .data[], .first_id, .last_id, .has_more …
168
171
  """
169
172
  logging_utility.info(
170
173
  "Listing messages for thread_id: %s, limit: %d, order: %s",
@@ -178,24 +181,19 @@ class MessagesClient(BaseAPIClient):
178
181
  f"/v1/threads/{thread_id}/messages", params=params
179
182
  )
180
183
  response.raise_for_status()
181
- messages = response.json()
182
- validated_messages = [
183
- ent_validator.MessageRead(**message) for message in messages
184
- ]
185
- logging_utility.info("Retrieved %d messages", len(validated_messages))
186
- return [message.dict() for message in validated_messages]
184
+
185
+ envelope = ent_validator.MessagesList(**response.json())
186
+ logging_utility.info("Retrieved %d messages", len(envelope.data))
187
+ return envelope
188
+
187
189
  except ValidationError as e:
188
190
  logging_utility.error("Validation error: %s", e.json())
189
- raise ValueError(f"Validation error: {e}")
191
+ raise ValueError(f"Validation error: {e}") from e
190
192
  except httpx.HTTPStatusError as e:
191
- logging_utility.error(
192
- "HTTP error occurred while listing messages: %s", str(e)
193
- )
193
+ logging_utility.error("HTTP error while listing messages: %s", str(e))
194
194
  raise
195
195
  except Exception as e:
196
- logging_utility.error(
197
- "An error occurred while listing messages: %s", str(e)
198
- )
196
+ logging_utility.error("Unexpected error while listing messages: %s", str(e))
199
197
  raise
200
198
 
201
199
  def get_formatted_messages(
@@ -104,16 +104,30 @@ class ThreadsClient(BaseAPIClient):
104
104
  logging_utility.error("Unexpected error retrieving thread: %s", str(e))
105
105
  raise
106
106
 
107
- def update_thread(self, thread_id: str, **updates) -> validator.ThreadReadDetailed:
107
+ def update_thread(
108
+ self,
109
+ thread_id: str,
110
+ *,
111
+ participant_ids: Optional[List[str]] = None,
112
+ meta_data: Optional[Dict[str, Any]] = None,
113
+ tool_resources: Optional[Dict[str, Any]] = None,
114
+ ) -> validator.ThreadReadDetailed:
108
115
  logging_utility.info("Updating thread with id: %s", thread_id)
109
116
  try:
110
- validated_updates = validator.ThreadUpdate(**updates)
111
- response = self.client.post(
112
- f"/v1/threads/{thread_id}", json=validated_updates.model_dump()
117
+ validated_updates = validator.ThreadUpdate(
118
+ participant_ids=participant_ids,
119
+ meta_data=meta_data,
120
+ tool_resources=tool_resources,
121
+ )
122
+
123
+ response = self.client.put(
124
+ f"/v1/threads/{thread_id}",
125
+ json=validated_updates.model_dump(),
113
126
  )
114
127
  response.raise_for_status()
115
128
  updated_thread = response.json()
116
129
  return validator.ThreadReadDetailed(**updated_thread)
130
+
117
131
  except httpx.HTTPStatusError as e:
118
132
  logging_utility.error("HTTP error updating thread: %s", str(e))
119
133
  raise
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: projectdavid
3
- Version: 1.33.30
3
+ Version: 1.33.32
4
4
  Summary: Python SDK for interacting with the Entities Assistant API.
5
5
  Author-email: Francis Neequaye Armah <francis.neequaye@projectdavid.co.uk>
6
6
  License: PolyForm Noncommercial License 1.0.0
@@ -20,7 +20,7 @@ Requires-Dist: pydantic<3.0,>=2.0
20
20
  Requires-Dist: python-dotenv<2.0,>=1.0.1
21
21
  Requires-Dist: aiofiles<25.0,>=23.2.1
22
22
  Requires-Dist: ollama<0.5.0,>=0.4.4
23
- Requires-Dist: projectdavid_common==0.17.7
23
+ Requires-Dist: projectdavid_common==0.17.10
24
24
  Requires-Dist: qdrant-client<2.0.0,>=1.0.0
25
25
  Requires-Dist: pdfplumber<0.12.0,>=0.11.0
26
26
  Requires-Dist: validators<0.35.0,>=0.29.0
@@ -14,10 +14,10 @@ projectdavid/clients/file_processor.py,sha256=vstT-X-F-QI4mvSxpLfXJBLSol0PuPtPdS
14
14
  projectdavid/clients/file_search.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  projectdavid/clients/files_client.py,sha256=XkIDzbQFGDrd88taf0Kouc_4YJOPIYEHiIyWYLKDofI,15581
16
16
  projectdavid/clients/inference_client.py,sha256=xz4ACPv5Tkis604QxO5mJX1inH_TGDfQP-31geETYpE,6609
17
- projectdavid/clients/messages_client.py,sha256=467xeIt3VYs6cG8-bl-eDRi_auWOPmfd5tSJDmQSJUI,17232
17
+ projectdavid/clients/messages_client.py,sha256=W9_VWhmhgRsUjXVsMM2qu73iLlRX1x3c9VeLR4erNC0,17075
18
18
  projectdavid/clients/runs.py,sha256=-fXOq5L9w2efDPmZkNxb0s2yjl6oN0XN4_aLXqaeceo,25270
19
19
  projectdavid/clients/synchronous_inference_wrapper.py,sha256=qh94rtNlLqgIxiA_ZbQ1ncOwQTi9aBj5os3sMExLh4E,7070
20
- projectdavid/clients/threads_client.py,sha256=trGWq2SyWvN6MSVLvjaQXiURi-VROdcMXlYye8RJwH4,7052
20
+ projectdavid/clients/threads_client.py,sha256=9RshJD09kfYxfarTysQz_Bwbv4XxQaHQXhCLRMdaWcI,7392
21
21
  projectdavid/clients/tools_client.py,sha256=GkCVOmwpAoPqVt6aYmH0G1HIFha3iEwR9IIf9teR0j8,11487
22
22
  projectdavid/clients/users_client.py,sha256=eCuUb9qvyH1GUFhZu6TRL9zdoK-qzHSs8-Vmrk_0mmg,13729
23
23
  projectdavid/clients/vector_store_manager.py,sha256=A-L1rhURKwiRs0EDd1HOuIShOtaC9Hb1yHB4He456Zc,15943
@@ -37,8 +37,8 @@ projectdavid/utils/monitor_launcher.py,sha256=3YAgJdeuaUvq3JGvpA4ymqFsAnk29nH5q9
37
37
  projectdavid/utils/peek_gate.py,sha256=5whMRnDOQjATRpThWDJkvY9ScXuJ7Sd_-9rvGgXeTAQ,2532
38
38
  projectdavid/utils/run_monitor.py,sha256=F_WkqIP-qnWH-4llIbileWWLfRj2Q1Cg-ni23SR1rec,3786
39
39
  projectdavid/utils/vector_search_formatter.py,sha256=YTe3HPGec26qGY7uxY8_GS8lc4QaN6aNXMzkl29nZpI,1735
40
- projectdavid-1.33.30.dist-info/licenses/LICENSE,sha256=_8yjiEGttpS284BkfhXxfERqTRZW_tUaHiBB0GTJTMg,4563
41
- projectdavid-1.33.30.dist-info/METADATA,sha256=si-JQPG86oBZfZCjHfE8zDZbxMWWW_KeAZm8ZBhq4Ow,11555
42
- projectdavid-1.33.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
- projectdavid-1.33.30.dist-info/top_level.txt,sha256=kil8GU4s7qYRfNnzGnFHhZnSNRSxgNG-J4HLgQMmMtw,13
44
- projectdavid-1.33.30.dist-info/RECORD,,
40
+ projectdavid-1.33.32.dist-info/licenses/LICENSE,sha256=_8yjiEGttpS284BkfhXxfERqTRZW_tUaHiBB0GTJTMg,4563
41
+ projectdavid-1.33.32.dist-info/METADATA,sha256=VlT4avKRXBYefy_Oz5CmMzXQZugt0R6ONR4Y6CISAlw,11556
42
+ projectdavid-1.33.32.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
+ projectdavid-1.33.32.dist-info/top_level.txt,sha256=kil8GU4s7qYRfNnzGnFHhZnSNRSxgNG-J4HLgQMmMtw,13
44
+ projectdavid-1.33.32.dist-info/RECORD,,