agent-lab-sdk 0.1.43__py3-none-any.whl → 0.1.44__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 agent-lab-sdk might be problematic. Click here for more details.
- agent_lab_sdk/langgraph/checkpoint/agw_saver.py +29 -11
- {agent_lab_sdk-0.1.43.dist-info → agent_lab_sdk-0.1.44.dist-info}/METADATA +1 -1
- {agent_lab_sdk-0.1.43.dist-info → agent_lab_sdk-0.1.44.dist-info}/RECORD +6 -6
- {agent_lab_sdk-0.1.43.dist-info → agent_lab_sdk-0.1.44.dist-info}/WHEEL +0 -0
- {agent_lab_sdk-0.1.43.dist-info → agent_lab_sdk-0.1.44.dist-info}/licenses/LICENSE +0 -0
- {agent_lab_sdk-0.1.43.dist-info → agent_lab_sdk-0.1.44.dist-info}/top_level.txt +0 -0
|
@@ -550,6 +550,7 @@ class AsyncAGWCheckpointSaver(BaseCheckpointSaver):
|
|
|
550
550
|
path: str,
|
|
551
551
|
*,
|
|
552
552
|
ok_statuses: Iterable[int] | None = None,
|
|
553
|
+
label_path: str | None = None,
|
|
553
554
|
**kw,
|
|
554
555
|
) -> httpx.Response:
|
|
555
556
|
if "json" in kw:
|
|
@@ -558,6 +559,7 @@ class AsyncAGWCheckpointSaver(BaseCheckpointSaver):
|
|
|
558
559
|
logger.debug("AGW HTTP payload: %s", kw["data"].decode())
|
|
559
560
|
|
|
560
561
|
ok_set = set(ok_statuses) if ok_statuses is not None else set()
|
|
562
|
+
metric_path = label_path or path
|
|
561
563
|
|
|
562
564
|
attempt = 1
|
|
563
565
|
while True:
|
|
@@ -576,7 +578,7 @@ class AsyncAGWCheckpointSaver(BaseCheckpointSaver):
|
|
|
576
578
|
try:
|
|
577
579
|
resp = await client.request(method, path, **kw)
|
|
578
580
|
except httpx.RequestError as exc:
|
|
579
|
-
AGW_HTTP_ERROR.labels(method,
|
|
581
|
+
AGW_HTTP_ERROR.labels(method, metric_path).inc()
|
|
580
582
|
logger.warning(
|
|
581
583
|
"AGW request %s %s failed on attempt %d/%d: %s",
|
|
582
584
|
method,
|
|
@@ -586,7 +588,7 @@ class AsyncAGWCheckpointSaver(BaseCheckpointSaver):
|
|
|
586
588
|
exc,
|
|
587
589
|
)
|
|
588
590
|
if attempt >= self.retry_max_attempts:
|
|
589
|
-
AGW_HTTP_FINAL_ERROR.labels(method,
|
|
591
|
+
AGW_HTTP_FINAL_ERROR.labels(method, metric_path).inc()
|
|
590
592
|
if self._client is not None:
|
|
591
593
|
try:
|
|
592
594
|
await self._client.aclose()
|
|
@@ -619,16 +621,16 @@ class AsyncAGWCheckpointSaver(BaseCheckpointSaver):
|
|
|
619
621
|
|
|
620
622
|
status = resp.status_code
|
|
621
623
|
if status < 400 or status in ok_set:
|
|
622
|
-
AGW_HTTP_SUCCESS.labels(method,
|
|
624
|
+
AGW_HTTP_SUCCESS.labels(method, metric_path).inc()
|
|
623
625
|
return resp
|
|
624
626
|
|
|
625
|
-
AGW_HTTP_ERROR.labels(method,
|
|
627
|
+
AGW_HTTP_ERROR.labels(method, metric_path).inc()
|
|
626
628
|
if status in (404, 406):
|
|
627
|
-
AGW_HTTP_FINAL_ERROR.labels(method,
|
|
629
|
+
AGW_HTTP_FINAL_ERROR.labels(method, metric_path).inc()
|
|
628
630
|
return resp
|
|
629
631
|
|
|
630
632
|
if attempt >= self.retry_max_attempts:
|
|
631
|
-
AGW_HTTP_FINAL_ERROR.labels(method,
|
|
633
|
+
AGW_HTTP_FINAL_ERROR.labels(method, metric_path).inc()
|
|
632
634
|
return resp
|
|
633
635
|
|
|
634
636
|
try:
|
|
@@ -693,13 +695,15 @@ class AsyncAGWCheckpointSaver(BaseCheckpointSaver):
|
|
|
693
695
|
tid = api_cfg["threadId"]
|
|
694
696
|
|
|
695
697
|
if cid:
|
|
698
|
+
path_template = "/checkpoint/{threadId}/{checkpointId}"
|
|
696
699
|
path = f"/checkpoint/{tid}/{cid}"
|
|
697
700
|
params = {"checkpointNs": api_cfg.get("checkpointNs", "")}
|
|
698
701
|
else:
|
|
702
|
+
path_template = "/checkpoint/{threadId}"
|
|
699
703
|
path = f"/checkpoint/{tid}"
|
|
700
704
|
params = None
|
|
701
705
|
|
|
702
|
-
resp = await self._http("GET", path, params=params)
|
|
706
|
+
resp = await self._http("GET", path, params=params, label_path=path_template)
|
|
703
707
|
logger.debug("AGW aget_tuple response: %s", resp.text)
|
|
704
708
|
|
|
705
709
|
if not resp.text:
|
|
@@ -723,7 +727,12 @@ class AsyncAGWCheckpointSaver(BaseCheckpointSaver):
|
|
|
723
727
|
"before": self._to_api_config(before) if before else None,
|
|
724
728
|
"limit": limit,
|
|
725
729
|
}
|
|
726
|
-
resp = await self._http(
|
|
730
|
+
resp = await self._http(
|
|
731
|
+
"POST",
|
|
732
|
+
"/checkpoint/list",
|
|
733
|
+
json=payload,
|
|
734
|
+
label_path="/checkpoint/list",
|
|
735
|
+
)
|
|
727
736
|
logger.debug("AGW alist response: %s", resp.text)
|
|
728
737
|
resp.raise_for_status()
|
|
729
738
|
for item in resp.json():
|
|
@@ -742,7 +751,7 @@ class AsyncAGWCheckpointSaver(BaseCheckpointSaver):
|
|
|
742
751
|
"metadata": self._enc_meta(get_checkpoint_metadata(cfg, metadata)),
|
|
743
752
|
"newVersions": new_versions,
|
|
744
753
|
}
|
|
745
|
-
resp = await self._http("POST", "/checkpoint", json=payload)
|
|
754
|
+
resp = await self._http("POST", "/checkpoint", json=payload, label_path="/checkpoint")
|
|
746
755
|
logger.debug("AGW aput response: %s", resp.text)
|
|
747
756
|
resp.raise_for_status()
|
|
748
757
|
return resp.json()["config"]
|
|
@@ -761,12 +770,21 @@ class AsyncAGWCheckpointSaver(BaseCheckpointSaver):
|
|
|
761
770
|
"taskId": task_id,
|
|
762
771
|
"taskPath": task_path,
|
|
763
772
|
}
|
|
764
|
-
resp = await self._http(
|
|
773
|
+
resp = await self._http(
|
|
774
|
+
"POST",
|
|
775
|
+
"/checkpoint/writes",
|
|
776
|
+
json=payload,
|
|
777
|
+
label_path="/checkpoint/writes",
|
|
778
|
+
)
|
|
765
779
|
logger.debug("AGW aput_writes response: %s", resp.text)
|
|
766
780
|
resp.raise_for_status()
|
|
767
781
|
|
|
768
782
|
async def adelete_thread(self, thread_id: str) -> None:
|
|
769
|
-
resp = await self._http(
|
|
783
|
+
resp = await self._http(
|
|
784
|
+
"DELETE",
|
|
785
|
+
f"/checkpoint/{thread_id}",
|
|
786
|
+
label_path="/checkpoint/{threadId}",
|
|
787
|
+
)
|
|
770
788
|
resp.raise_for_status()
|
|
771
789
|
|
|
772
790
|
# =================================================================
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
agent_lab_sdk/__init__.py,sha256=1Dlmv-wuz1QuciymKtYtX7jXzr_fkeGTe7aENfEDl3E,108
|
|
2
2
|
agent_lab_sdk/langgraph/checkpoint/__init__.py,sha256=DnKwR1LwbaQ3qhb124lE-tnojrUIVcCdNzHEHwgpL5M,86
|
|
3
|
-
agent_lab_sdk/langgraph/checkpoint/agw_saver.py,sha256=
|
|
3
|
+
agent_lab_sdk/langgraph/checkpoint/agw_saver.py,sha256=21IkZ7aZrmYUpd3fmMuc4IhfQaDntoSWbRKnYlFjieY,32721
|
|
4
4
|
agent_lab_sdk/langgraph/checkpoint/serde.py,sha256=UTSYbTbhBeL1CAr-XMbaH3SSIx9TeiC7ak22duXvqkw,5175
|
|
5
5
|
agent_lab_sdk/llm/__init__.py,sha256=Yo9MbYdHS1iX05A9XiJGwWN1Hm4IARGav9mNFPrtDeA,376
|
|
6
6
|
agent_lab_sdk/llm/agw_token_manager.py,sha256=_bPPI8muaEa6H01P8hHQOJHiiivaLd8N_d3OT9UT_80,4787
|
|
@@ -15,8 +15,8 @@ agent_lab_sdk/schema/log_message.py,sha256=nadi6lZGRuDSPmfbYs9QPpRJUT9Pfy8Y7pGCv
|
|
|
15
15
|
agent_lab_sdk/storage/__init__.py,sha256=HAtUoqg3k0irqPMewayadVA9aXJOmYSxRr6a5J1scT0,174
|
|
16
16
|
agent_lab_sdk/storage/storage.py,sha256=ELpt7GRwFD-aWa6ctinfA_QwcvzWLvKS0Wz8FlxVqAs,2075
|
|
17
17
|
agent_lab_sdk/storage/storage_v2.py,sha256=ONseynX59xzWK17dfzxZvnii2rpz3Oo2Zo9Ck-lcGnw,1997
|
|
18
|
-
agent_lab_sdk-0.1.
|
|
19
|
-
agent_lab_sdk-0.1.
|
|
20
|
-
agent_lab_sdk-0.1.
|
|
21
|
-
agent_lab_sdk-0.1.
|
|
22
|
-
agent_lab_sdk-0.1.
|
|
18
|
+
agent_lab_sdk-0.1.44.dist-info/licenses/LICENSE,sha256=_TRXHkF3S9ilWBPdZcHLI_S-PRjK0L_SeOb2pcPAdV4,417
|
|
19
|
+
agent_lab_sdk-0.1.44.dist-info/METADATA,sha256=gbWuS14rM1KtS4W8f6Jze8orWGmjzcWgqJpdnfE7NzY,20766
|
|
20
|
+
agent_lab_sdk-0.1.44.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
21
|
+
agent_lab_sdk-0.1.44.dist-info/top_level.txt,sha256=E1efqkJ89KNmPBWdLzdMHeVtH0dYyCo4fhnSb81_15I,14
|
|
22
|
+
agent_lab_sdk-0.1.44.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|