projectdavid 1.33.33__tar.gz → 1.34.1__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.

Files changed (72) hide show
  1. {projectdavid-1.33.33 → projectdavid-1.34.1}/CHANGELOG.md +14 -0
  2. {projectdavid-1.33.33/src/projectdavid.egg-info → projectdavid-1.34.1}/PKG-INFO +2 -2
  3. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/runs.md +4 -0
  4. {projectdavid-1.33.33 → projectdavid-1.34.1}/pyproject.toml +2 -2
  5. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/runs.py +136 -31
  6. {projectdavid-1.33.33 → projectdavid-1.34.1/src/projectdavid.egg-info}/PKG-INFO +2 -2
  7. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid.egg-info/requires.txt +1 -1
  8. {projectdavid-1.33.33 → projectdavid-1.34.1}/LICENSE +0 -0
  9. {projectdavid-1.33.33 → projectdavid-1.34.1}/MANIFEST.in +0 -0
  10. {projectdavid-1.33.33 → projectdavid-1.34.1}/README.md +0 -0
  11. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/UPDATE-V133.23.md +0 -0
  12. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/assistants.md +0 -0
  13. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/code_interpretation.md +0 -0
  14. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/database.md +0 -0
  15. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/database_assistant_example.md +0 -0
  16. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/docker_comtainers.md +0 -0
  17. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/file_search.md +0 -0
  18. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/files.md +0 -0
  19. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/function_call_definition.md +0 -0
  20. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/function_calls.md +0 -0
  21. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/handling_function_calls.md +0 -0
  22. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/inference.md +0 -0
  23. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/messages.md +0 -0
  24. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/streams.md +0 -0
  25. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/threads.md +0 -0
  26. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/tools.md +0 -0
  27. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/users.md +0 -0
  28. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/vector_store.md +0 -0
  29. {projectdavid-1.33.33 → projectdavid-1.34.1}/docs/versioning.md +0 -0
  30. {projectdavid-1.33.33 → projectdavid-1.34.1}/setup.cfg +0 -0
  31. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/__init__.py +0 -0
  32. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/_version.py +0 -0
  33. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/actions_client.py +0 -0
  34. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/api_key_client.py +0 -0
  35. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/assistants_client.py +0 -0
  36. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/base_client.py +0 -0
  37. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/base_vector_store.py +0 -0
  38. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/event_handler.py +0 -0
  39. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/file_processor.py +0 -0
  40. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/file_search.py +0 -0
  41. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/files_client.py +0 -0
  42. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/inference_client.py +0 -0
  43. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/messages_client.py +0 -0
  44. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/synchronous_inference_wrapper.py +0 -0
  45. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/threads_client.py +0 -0
  46. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/tools_client.py +0 -0
  47. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/users_client.py +0 -0
  48. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/vector_store_manager.py +0 -0
  49. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/vectors.py +0 -0
  50. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/vision-file_processor.py +0 -0
  51. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/clients/vision_vectors.py +0 -0
  52. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/constants/platform.py +0 -0
  53. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/decorators.py +0 -0
  54. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/entity.py +0 -0
  55. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/events.py +0 -0
  56. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/serializers.py +0 -0
  57. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/services/logging_service.py +0 -0
  58. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/synthesis/__init__.py +0 -0
  59. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/synthesis/llm_synthesizer.py +0 -0
  60. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/synthesis/prompt.py +0 -0
  61. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/synthesis/reranker.py +0 -0
  62. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/synthesis/retriever.py +0 -0
  63. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/utils/__init__.py +0 -0
  64. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/utils/function_call_suppressor.py +0 -0
  65. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/utils/monitor_launcher.py +0 -0
  66. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/utils/peek_gate.py +0 -0
  67. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/utils/run_monitor.py +0 -0
  68. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid/utils/vector_search_formatter.py +0 -0
  69. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid.egg-info/SOURCES.txt +0 -0
  70. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid.egg-info/dependency_links.txt +0 -0
  71. {projectdavid-1.33.33 → projectdavid-1.34.1}/src/projectdavid.egg-info/top_level.txt +0 -0
  72. {projectdavid-1.33.33 → projectdavid-1.34.1}/tests/test_clients.py +0 -0
@@ -1,3 +1,17 @@
1
+ ## [1.34.1](https://github.com/frankie336/projectdavid/compare/v1.34.0...v1.34.1) (2025-08-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * correctly import RunListResponse ([7f923cc](https://github.com/frankie336/projectdavid/commit/7f923ccfcaac890f1eaf0b94406f5ee003b2cf4e))
7
+
8
+ # [1.34.0](https://github.com/frankie336/projectdavid/compare/v1.33.33...v1.34.0) (2025-08-12)
9
+
10
+
11
+ ### Features
12
+
13
+ * Adding runs list methods. ([61975b2](https://github.com/frankie336/projectdavid/commit/61975b2c8fa44de254b979160566bd8e89b6799b))
14
+
1
15
  ## [1.33.33](https://github.com/frankie336/projectdavid/compare/v1.33.32...v1.33.33) (2025-07-10)
2
16
 
3
17
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: projectdavid
3
- Version: 1.33.33
3
+ Version: 1.34.1
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.11
23
+ Requires-Dist: projectdavid_common==0.17.13
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.33.33"
7
+ version = "1.34.1"
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.11",
23
+ "projectdavid_common==0.17.13",
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",
@@ -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.33.33
3
+ Version: 1.34.1
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.11
23
+ Requires-Dist: projectdavid_common==0.17.13
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
@@ -3,7 +3,7 @@ pydantic<3.0,>=2.0
3
3
  python-dotenv<2.0,>=1.0.1
4
4
  aiofiles<25.0,>=23.2.1
5
5
  ollama<0.5.0,>=0.4.4
6
- projectdavid_common==0.17.11
6
+ projectdavid_common==0.17.13
7
7
  qdrant-client<2.0.0,>=1.0.0
8
8
  pdfplumber<0.12.0,>=0.11.0
9
9
  validators<0.35.0,>=0.29.0
File without changes
File without changes
File without changes