projectdavid 1.33.32__tar.gz → 1.34.0__tar.gz
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.
- {projectdavid-1.33.32 → projectdavid-1.34.0}/CHANGELOG.md +15 -0
- {projectdavid-1.33.32/src/projectdavid.egg-info → projectdavid-1.34.0}/PKG-INFO +2 -2
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/runs.md +4 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/pyproject.toml +4 -2
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/messages_client.py +6 -19
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/runs.py +136 -31
- {projectdavid-1.33.32 → projectdavid-1.34.0/src/projectdavid.egg-info}/PKG-INFO +2 -2
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid.egg-info/requires.txt +1 -1
- {projectdavid-1.33.32 → projectdavid-1.34.0}/LICENSE +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/MANIFEST.in +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/README.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/UPDATE-V133.23.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/assistants.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/code_interpretation.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/database.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/database_assistant_example.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/docker_comtainers.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/file_search.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/files.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/function_call_definition.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/function_calls.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/handling_function_calls.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/inference.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/messages.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/streams.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/threads.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/tools.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/users.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/vector_store.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/docs/versioning.md +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/setup.cfg +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/__init__.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/_version.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/actions_client.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/api_key_client.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/assistants_client.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/base_client.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/base_vector_store.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/event_handler.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/file_processor.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/file_search.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/files_client.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/inference_client.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/synchronous_inference_wrapper.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/threads_client.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/tools_client.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/users_client.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/vector_store_manager.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/vectors.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/vision-file_processor.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/vision_vectors.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/constants/platform.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/decorators.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/entity.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/events.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/serializers.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/services/logging_service.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/synthesis/__init__.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/synthesis/llm_synthesizer.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/synthesis/prompt.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/synthesis/reranker.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/synthesis/retriever.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/utils/__init__.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/utils/function_call_suppressor.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/utils/monitor_launcher.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/utils/peek_gate.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/utils/run_monitor.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/utils/vector_search_formatter.py +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid.egg-info/SOURCES.txt +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid.egg-info/dependency_links.txt +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid.egg-info/top_level.txt +0 -0
- {projectdavid-1.33.32 → projectdavid-1.34.0}/tests/test_clients.py +0 -0
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [1.34.0](https://github.com/frankie336/projectdavid/compare/v1.33.33...v1.34.0) (2025-08-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Adding runs list methods. ([61975b2](https://github.com/frankie336/projectdavid/commit/61975b2c8fa44de254b979160566bd8e89b6799b))
|
|
7
|
+
|
|
8
|
+
## [1.33.33](https://github.com/frankie336/projectdavid/compare/v1.33.32...v1.33.33) (2025-07-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* wrap delete_message in a return envelope ([7ed1815](https://github.com/frankie336/projectdavid/commit/7ed18155b85d39cbecf0354c16b2a8a20131b9e2))
|
|
14
|
+
* wrap delete_message in a return envelope ([3e9e6fb](https://github.com/frankie336/projectdavid/commit/3e9e6fbb93ec0670c0e9a39b7eb446bcb1e7df40))
|
|
15
|
+
|
|
1
16
|
## [1.33.32](https://github.com/frankie336/projectdavid/compare/v1.33.31...v1.33.32) (2025-07-09)
|
|
2
17
|
|
|
3
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: projectdavid
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.34.0
|
|
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.
|
|
23
|
+
Requires-Dist: projectdavid_common==0.17.12
|
|
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
|
|
@@ -36,14 +36,18 @@ run = client.run_service.create_run(thread_id='some_thread_id',
|
|
|
36
36
|
assistant_id='some_assistant_id')
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
|
|
40
|
+
|
|
39
41
|
```
|
|
40
42
|
---
|
|
41
43
|
|
|
42
44
|
**Retrieve a Run**
|
|
43
45
|
```python
|
|
44
46
|
print(get_run.dict())
|
|
47
|
+
|
|
45
48
|
id='run_t16pOsi0Y2a3PXuPjcrjko' assistant_id='user_2uMMGBpU4H7dcZieeOahNv' cancelled_at=None completed_at=None created_at=1726617356 expires_at=1726620956 failed_at=None incomplete_details=None instructions='' last_error=None max_completion_tokens=1000 max_prompt_tokens=500 meta_data={} model='gpt-4' object='run' parallel_tool_calls=False required_action=None response_format='text' started_at=None status='queued' thread_id='thread_Ww3UGvvKkrxFfHD1hNFQVX' tool_choice='none' tools=[] truncation_strategy={} usage=None temperature=1.0 top_p=1.0 tool_resources={} actions=[]
|
|
46
49
|
{'id': 'run_xsDpDica9weXH4eSfsRcPd', 'assistant_id': 'user_0D1D7j6UkZUsa9Gm7GdkU1', 'cancelled_at': None, 'completed_at': None, 'created_at': 1726620075, 'expires_at': 1726623675, 'failed_at': None, 'incomplete_details': None, 'instructions': '', 'last_error': None, 'max_completion_tokens': 1000, 'max_prompt_tokens': 500, 'meta_data': {}, 'model': 'gpt-4', 'object': 'run', 'parallel_tool_calls': False, 'required_action': None, 'response_format': 'text', 'started_at': None, 'status': 'queued', 'thread_id': 'thread_VaTTuMUa8EHtkr60hZGkju', 'tool_choice': 'none', 'tools': [], 'truncation_strategy': {}, 'usage': None, 'temperature': 1.0, 'top_p': 1.0, 'tool_resources': {}, 'actions': []}
|
|
50
|
+
|
|
47
51
|
```
|
|
48
52
|
---
|
|
49
53
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "projectdavid"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.34.0"
|
|
8
8
|
description = "Python SDK for interacting with the Entities Assistant API."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -20,7 +20,7 @@ dependencies = [
|
|
|
20
20
|
"python-dotenv>=1.0.1,<2.0",
|
|
21
21
|
"aiofiles>=23.2.1,<25.0",
|
|
22
22
|
"ollama>=0.4.4,<0.5.0",
|
|
23
|
-
"projectdavid_common==0.17.
|
|
23
|
+
"projectdavid_common==0.17.12",
|
|
24
24
|
"qdrant-client>=1.0.0,<2.0.0",
|
|
25
25
|
"pdfplumber>=0.11.0,<0.12.0",
|
|
26
26
|
"validators>=0.29.0,<0.35.0",
|
|
@@ -67,6 +67,7 @@ vision = [
|
|
|
67
67
|
"torchaudio>=2.2.1",
|
|
68
68
|
|
|
69
69
|
# OpenCLIP + captioning stack
|
|
70
|
+
|
|
70
71
|
"open_clip_torch>=2.24",
|
|
71
72
|
"pillow>=10.2",
|
|
72
73
|
"transformers>=4.41",
|
|
@@ -77,6 +78,7 @@ vision = [
|
|
|
77
78
|
|
|
78
79
|
# Geolocation package pending release (uncomment when available)
|
|
79
80
|
# "geoloc-regio-net>=0.2.0 ; extra == 'vision'",
|
|
81
|
+
|
|
80
82
|
]
|
|
81
83
|
|
|
82
84
|
[tool.isort]
|
|
@@ -292,32 +292,19 @@ class MessagesClient(BaseAPIClient):
|
|
|
292
292
|
logging_utility.error("An error occurred: %s", str(e))
|
|
293
293
|
raise RuntimeError(f"An error occurred: {str(e)}")
|
|
294
294
|
|
|
295
|
-
def delete_message(self, message_id: str) ->
|
|
296
|
-
"""
|
|
297
|
-
Delete a message by its ID.
|
|
298
|
-
|
|
299
|
-
Args:
|
|
300
|
-
message_id (str): The ID of the message.
|
|
301
|
-
|
|
302
|
-
Returns:
|
|
303
|
-
Dict[str, Any]: The deletion result.
|
|
304
|
-
"""
|
|
295
|
+
def delete_message(self, message_id: str) -> ent_validator.MessageDeleted:
|
|
296
|
+
"""Delete a message and return deletion envelope."""
|
|
305
297
|
logging_utility.info("Deleting message with id: %s", message_id)
|
|
306
298
|
try:
|
|
307
299
|
response = self.client.delete(f"/v1/messages/{message_id}")
|
|
308
300
|
response.raise_for_status()
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
return result
|
|
301
|
+
return ent_validator.MessageDeleted(**response.json())
|
|
302
|
+
|
|
312
303
|
except httpx.HTTPStatusError as e:
|
|
313
|
-
logging_utility.error(
|
|
314
|
-
"HTTP error occurred while deleting message: %s", str(e)
|
|
315
|
-
)
|
|
304
|
+
logging_utility.error("HTTP error while deleting message: %s", str(e))
|
|
316
305
|
raise
|
|
317
306
|
except Exception as e:
|
|
318
|
-
logging_utility.error(
|
|
319
|
-
"An error occurred while deleting message: %s", str(e)
|
|
320
|
-
)
|
|
307
|
+
logging_utility.error("Unexpected error while deleting message: %s", str(e))
|
|
321
308
|
raise
|
|
322
309
|
|
|
323
310
|
def save_assistant_message_chunk(
|
|
@@ -2,7 +2,7 @@ import json
|
|
|
2
2
|
import threading
|
|
3
3
|
import time
|
|
4
4
|
from enum import Enum
|
|
5
|
-
from typing import Any, Callable, Dict, List, Optional
|
|
5
|
+
from typing import Any, Callable, Dict, List, Optional, Tuple
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
import requests
|
|
@@ -190,36 +190,6 @@ class RunsClient(BaseAPIClient):
|
|
|
190
190
|
)
|
|
191
191
|
raise
|
|
192
192
|
|
|
193
|
-
def list_runs(self, limit: int = 20, order: str = "asc") -> List[ent_validator.Run]:
|
|
194
|
-
"""
|
|
195
|
-
List runs with the given limit and order.
|
|
196
|
-
|
|
197
|
-
Args:
|
|
198
|
-
limit (int): Maximum number of runs to retrieve.
|
|
199
|
-
order (str): 'asc' or 'desc' for ordering.
|
|
200
|
-
|
|
201
|
-
Returns:
|
|
202
|
-
List[Run]: A list of runs.
|
|
203
|
-
"""
|
|
204
|
-
logging_utility.info("Listing runs with limit: %d, order: %s", limit, order)
|
|
205
|
-
params = {"limit": limit, "order": order}
|
|
206
|
-
try:
|
|
207
|
-
response = self.client.get("/v1/runs", params=params)
|
|
208
|
-
response.raise_for_status()
|
|
209
|
-
runs = response.json()
|
|
210
|
-
validated_runs = [ent_validator.Run(**run) for run in runs]
|
|
211
|
-
logging_utility.info("Retrieved %d runs", len(validated_runs))
|
|
212
|
-
return validated_runs
|
|
213
|
-
except ValidationError as e:
|
|
214
|
-
logging_utility.error("Validation error: %s", e.json())
|
|
215
|
-
raise ValueError(f"Validation error: {e}")
|
|
216
|
-
except httpx.HTTPStatusError as e:
|
|
217
|
-
logging_utility.error("HTTP error occurred while listing runs: %s", str(e))
|
|
218
|
-
raise
|
|
219
|
-
except Exception as e:
|
|
220
|
-
logging_utility.error("An error occurred while listing runs: %s", str(e))
|
|
221
|
-
raise
|
|
222
|
-
|
|
223
193
|
def delete_run(self, run_id: str) -> Dict[str, Any]:
|
|
224
194
|
"""
|
|
225
195
|
Delete a run by its ID.
|
|
@@ -637,3 +607,138 @@ class RunsClient(BaseAPIClient):
|
|
|
637
607
|
t = threading.Thread(target=_listen_and_handle, daemon=True)
|
|
638
608
|
t.start()
|
|
639
609
|
t.join()
|
|
610
|
+
|
|
611
|
+
def list_runs(self, limit: int = 20, order: str = "asc") -> List[ent_validator.Run]:
|
|
612
|
+
|
|
613
|
+
logging_utility.info("Listing runs with limit: %d, order: %s", limit, order)
|
|
614
|
+
params = {"limit": limit, "order": order if order in ("asc", "desc") else "asc"}
|
|
615
|
+
try:
|
|
616
|
+
resp = self.client.get("/v1/runs", params=params)
|
|
617
|
+
resp.raise_for_status()
|
|
618
|
+
payload = resp.json()
|
|
619
|
+
|
|
620
|
+
# Preferred: envelope
|
|
621
|
+
if isinstance(payload, dict) and "data" in payload:
|
|
622
|
+
env = ent_validator.RunListResponse(**payload)
|
|
623
|
+
logging_utility.info("Retrieved %d runs", len(env.data))
|
|
624
|
+
return list(env.data)
|
|
625
|
+
|
|
626
|
+
# Legacy: raw list of dicts
|
|
627
|
+
runs = [ent_validator.Run(**item) for item in payload]
|
|
628
|
+
logging_utility.info("Retrieved %d runs (legacy)", len(runs))
|
|
629
|
+
return runs
|
|
630
|
+
|
|
631
|
+
except ValidationError as e:
|
|
632
|
+
logging_utility.error("Validation error: %s", e.json())
|
|
633
|
+
raise ValueError(f"Validation error: {e}")
|
|
634
|
+
except httpx.HTTPStatusError as e:
|
|
635
|
+
logging_utility.error("HTTP error occurred while listing runs: %s", str(e))
|
|
636
|
+
raise
|
|
637
|
+
except Exception as e:
|
|
638
|
+
logging_utility.error("An error occurred while listing runs: %s", str(e))
|
|
639
|
+
raise
|
|
640
|
+
|
|
641
|
+
def list_runs_with_meta(
|
|
642
|
+
self, limit: int = 20, order: str = "asc"
|
|
643
|
+
) -> Tuple[List[ent_validator.Run], Optional[str], Optional[str], bool]:
|
|
644
|
+
"""
|
|
645
|
+
Returns (runs, first_id, last_id, has_more).
|
|
646
|
+
"""
|
|
647
|
+
logging_utility.info("Listing runs (with meta) limit=%d order=%s", limit, order)
|
|
648
|
+
params = {"limit": limit, "order": order if order in ("asc", "desc") else "asc"}
|
|
649
|
+
try:
|
|
650
|
+
resp = self.client.get("/v1/runs", params=params)
|
|
651
|
+
resp.raise_for_status()
|
|
652
|
+
payload = resp.json()
|
|
653
|
+
|
|
654
|
+
if isinstance(payload, dict) and "data" in payload:
|
|
655
|
+
env = ent_validator.RunListResponse(**payload)
|
|
656
|
+
return list(env.data), env.first_id, env.last_id, env.has_more
|
|
657
|
+
|
|
658
|
+
# Legacy fallback: compute minimal meta
|
|
659
|
+
runs = [ent_validator.Run(**item) for item in payload]
|
|
660
|
+
first_id = runs[0].id if runs else None
|
|
661
|
+
last_id = runs[-1].id if runs else None
|
|
662
|
+
return runs, first_id, last_id, False
|
|
663
|
+
|
|
664
|
+
except ValidationError as e:
|
|
665
|
+
logging_utility.error("Validation error: %s", e.json())
|
|
666
|
+
raise ValueError(f"Validation error: {e}")
|
|
667
|
+
except httpx.HTTPStatusError as e:
|
|
668
|
+
logging_utility.error("HTTP error occurred while listing runs: %s", str(e))
|
|
669
|
+
raise
|
|
670
|
+
except Exception as e:
|
|
671
|
+
logging_utility.error("An error occurred while listing runs: %s", str(e))
|
|
672
|
+
raise
|
|
673
|
+
|
|
674
|
+
def list_runs_for_thread(
|
|
675
|
+
self, thread_id: str, limit: int = 20, order: str = "asc"
|
|
676
|
+
) -> List[ent_validator.Run]:
|
|
677
|
+
logging_utility.info(
|
|
678
|
+
"Listing runs for thread_id=%s (limit=%d, order=%s)",
|
|
679
|
+
thread_id,
|
|
680
|
+
limit,
|
|
681
|
+
order,
|
|
682
|
+
)
|
|
683
|
+
params = {"limit": limit, "order": order if order in ("asc", "desc") else "asc"}
|
|
684
|
+
try:
|
|
685
|
+
resp = self.client.get(f"/v1/threads/{thread_id}/runs", params=params)
|
|
686
|
+
resp.raise_for_status()
|
|
687
|
+
payload = resp.json()
|
|
688
|
+
|
|
689
|
+
if isinstance(payload, dict) and "data" in payload:
|
|
690
|
+
env = ent_validator.RunListResponse(**payload)
|
|
691
|
+
logging_utility.info(
|
|
692
|
+
"Retrieved %d runs for thread %s", len(env.data), thread_id
|
|
693
|
+
)
|
|
694
|
+
return list(env.data)
|
|
695
|
+
|
|
696
|
+
runs = [ent_validator.Run(**item) for item in payload]
|
|
697
|
+
logging_utility.info(
|
|
698
|
+
"Retrieved %d runs (legacy) for thread %s", len(runs), thread_id
|
|
699
|
+
)
|
|
700
|
+
return runs
|
|
701
|
+
|
|
702
|
+
except ValidationError as e:
|
|
703
|
+
logging_utility.error("Validation error: %s", e.json())
|
|
704
|
+
raise ValueError(f"Validation error: {e}")
|
|
705
|
+
except httpx.HTTPStatusError as e:
|
|
706
|
+
logging_utility.error("HTTP error listing runs for thread: %s", str(e))
|
|
707
|
+
raise
|
|
708
|
+
except Exception as e:
|
|
709
|
+
logging_utility.error("Error listing runs for thread: %s", str(e))
|
|
710
|
+
raise
|
|
711
|
+
|
|
712
|
+
def list_runs_for_thread_with_meta(
|
|
713
|
+
self, thread_id: str, limit: int = 20, order: str = "asc"
|
|
714
|
+
) -> Tuple[List[ent_validator.Run], Optional[str], Optional[str], bool]:
|
|
715
|
+
logging_utility.info(
|
|
716
|
+
"Listing runs for thread_id=%s (with meta) limit=%d order=%s",
|
|
717
|
+
thread_id,
|
|
718
|
+
limit,
|
|
719
|
+
order,
|
|
720
|
+
)
|
|
721
|
+
params = {"limit": limit, "order": order if order in ("asc", "desc") else "asc"}
|
|
722
|
+
try:
|
|
723
|
+
resp = self.client.get(f"/v1/threads/{thread_id}/runs", params=params)
|
|
724
|
+
resp.raise_for_status()
|
|
725
|
+
payload = resp.json()
|
|
726
|
+
|
|
727
|
+
if isinstance(payload, dict) and "data" in payload:
|
|
728
|
+
env = ent_validator.RunListResponse(**payload)
|
|
729
|
+
return list(env.data), env.first_id, env.last_id, env.has_more
|
|
730
|
+
|
|
731
|
+
runs = [ent_validator.Run(**item) for item in payload]
|
|
732
|
+
first_id = runs[0].id if runs else None
|
|
733
|
+
last_id = runs[-1].id if runs else None
|
|
734
|
+
return runs, first_id, last_id, False
|
|
735
|
+
|
|
736
|
+
except ValidationError as e:
|
|
737
|
+
logging_utility.error("Validation error: %s", e.json())
|
|
738
|
+
raise ValueError(f"Validation error: {e}")
|
|
739
|
+
except httpx.HTTPStatusError as e:
|
|
740
|
+
logging_utility.error("HTTP error listing runs for thread: %s", str(e))
|
|
741
|
+
raise
|
|
742
|
+
except Exception as e:
|
|
743
|
+
logging_utility.error("Error listing runs for thread: %s", str(e))
|
|
744
|
+
raise
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: projectdavid
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.34.0
|
|
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.
|
|
23
|
+
Requires-Dist: projectdavid_common==0.17.12
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/vector_store_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
{projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/clients/vision-file_processor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/utils/function_call_suppressor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{projectdavid-1.33.32 → projectdavid-1.34.0}/src/projectdavid/utils/vector_search_formatter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|