projectdavid 1.34.1__py3-none-any.whl → 1.34.3__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.
- projectdavid/clients/runs.py +37 -129
- {projectdavid-1.34.1.dist-info → projectdavid-1.34.3.dist-info}/METADATA +1 -1
- {projectdavid-1.34.1.dist-info → projectdavid-1.34.3.dist-info}/RECORD +6 -6
- {projectdavid-1.34.1.dist-info → projectdavid-1.34.3.dist-info}/WHEEL +0 -0
- {projectdavid-1.34.1.dist-info → projectdavid-1.34.3.dist-info}/licenses/LICENSE +0 -0
- {projectdavid-1.34.1.dist-info → projectdavid-1.34.3.dist-info}/top_level.txt +0 -0
projectdavid/clients/runs.py
CHANGED
|
@@ -608,137 +608,45 @@ class RunsClient(BaseAPIClient):
|
|
|
608
608
|
t.start()
|
|
609
609
|
t.join()
|
|
610
610
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
611
|
+
# ------------------------------------------------------------
|
|
612
|
+
# List all runs by thread_id
|
|
613
|
+
# ------------------------------------------------------------
|
|
614
|
+
def list_runs(
|
|
615
|
+
self, thread_id: str, limit: int = 20, order: str = "asc"
|
|
616
|
+
) -> ent_validator.RunListResponse:
|
|
614
617
|
params = {"limit": limit, "order": order if order in ("asc", "desc") else "asc"}
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
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
|
|
618
|
+
resp = self.client.get(f"/v1/threads/{thread_id}/runs", params=params)
|
|
619
|
+
resp.raise_for_status()
|
|
620
|
+
payload = resp.json()
|
|
621
|
+
if isinstance(payload, dict) and "data" in payload:
|
|
622
|
+
return ent_validator.RunListResponse(**payload)
|
|
623
|
+
runs = [ent_validator.Run(**item) for item in payload]
|
|
624
|
+
return ent_validator.RunListResponse(
|
|
625
|
+
object="list",
|
|
626
|
+
data=runs,
|
|
627
|
+
first_id=runs[0].id if runs else None,
|
|
628
|
+
last_id=runs[-1].id if runs else None,
|
|
629
|
+
has_more=False,
|
|
630
|
+
)
|
|
640
631
|
|
|
641
|
-
|
|
632
|
+
# ------------------------------------------------------------
|
|
633
|
+
# List all runs by user
|
|
634
|
+
# ------------------------------------------------------------
|
|
635
|
+
def list_all_runs(
|
|
642
636
|
self, limit: int = 20, order: str = "asc"
|
|
643
|
-
) ->
|
|
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
|
-
)
|
|
637
|
+
) -> ent_validator.RunListResponse:
|
|
683
638
|
params = {"limit": limit, "order": order if order in ("asc", "desc") else "asc"}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
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,
|
|
639
|
+
resp = self.client.get("/v1/runs", params=params)
|
|
640
|
+
resp.raise_for_status()
|
|
641
|
+
payload = resp.json()
|
|
642
|
+
if isinstance(payload, dict) and "data" in payload:
|
|
643
|
+
return ent_validator.RunListResponse(**payload)
|
|
644
|
+
# legacy fallback: wrap raw list
|
|
645
|
+
runs = [ent_validator.Run(**item) for item in payload]
|
|
646
|
+
return ent_validator.RunListResponse(
|
|
647
|
+
object="list",
|
|
648
|
+
data=runs,
|
|
649
|
+
first_id=runs[0].id if runs else None,
|
|
650
|
+
last_id=runs[-1].id if runs else None,
|
|
651
|
+
has_more=False,
|
|
720
652
|
)
|
|
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.34.
|
|
3
|
+
Version: 1.34.3
|
|
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
|
|
@@ -15,7 +15,7 @@ projectdavid/clients/file_search.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
|
15
15
|
projectdavid/clients/files_client.py,sha256=XkIDzbQFGDrd88taf0Kouc_4YJOPIYEHiIyWYLKDofI,15581
|
|
16
16
|
projectdavid/clients/inference_client.py,sha256=xz4ACPv5Tkis604QxO5mJX1inH_TGDfQP-31geETYpE,6609
|
|
17
17
|
projectdavid/clients/messages_client.py,sha256=-tUubr5f62nLER6BxVY3ihp3vn3pnZH-ceigvQRSlYs,16825
|
|
18
|
-
projectdavid/clients/runs.py,sha256=
|
|
18
|
+
projectdavid/clients/runs.py,sha256=45QKXq6-uihdfjY5ubhTYoxephPQk7X6HVtZ5Kd6CcU,25898
|
|
19
19
|
projectdavid/clients/synchronous_inference_wrapper.py,sha256=qh94rtNlLqgIxiA_ZbQ1ncOwQTi9aBj5os3sMExLh4E,7070
|
|
20
20
|
projectdavid/clients/threads_client.py,sha256=9RshJD09kfYxfarTysQz_Bwbv4XxQaHQXhCLRMdaWcI,7392
|
|
21
21
|
projectdavid/clients/tools_client.py,sha256=GkCVOmwpAoPqVt6aYmH0G1HIFha3iEwR9IIf9teR0j8,11487
|
|
@@ -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.34.
|
|
41
|
-
projectdavid-1.34.
|
|
42
|
-
projectdavid-1.34.
|
|
43
|
-
projectdavid-1.34.
|
|
44
|
-
projectdavid-1.34.
|
|
40
|
+
projectdavid-1.34.3.dist-info/licenses/LICENSE,sha256=_8yjiEGttpS284BkfhXxfERqTRZW_tUaHiBB0GTJTMg,4563
|
|
41
|
+
projectdavid-1.34.3.dist-info/METADATA,sha256=waff-sfLJMu9upYWBa2IcU_0s1bX7Br9mJIq7ijmPtM,11555
|
|
42
|
+
projectdavid-1.34.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
43
|
+
projectdavid-1.34.3.dist-info/top_level.txt,sha256=kil8GU4s7qYRfNnzGnFHhZnSNRSxgNG-J4HLgQMmMtw,13
|
|
44
|
+
projectdavid-1.34.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|