langgraph-api 0.2.71__py3-none-any.whl → 0.2.72__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 langgraph-api might be problematic. Click here for more details.
- langgraph_api/__init__.py +1 -1
- langgraph_api/api/assistants.py +12 -2
- langgraph_api/sse.py +8 -11
- langgraph_api/worker.py +5 -4
- {langgraph_api-0.2.71.dist-info → langgraph_api-0.2.72.dist-info}/METADATA +1 -1
- {langgraph_api-0.2.71.dist-info → langgraph_api-0.2.72.dist-info}/RECORD +9 -9
- {langgraph_api-0.2.71.dist-info → langgraph_api-0.2.72.dist-info}/WHEEL +0 -0
- {langgraph_api-0.2.71.dist-info → langgraph_api-0.2.72.dist-info}/entry_points.txt +0 -0
- {langgraph_api-0.2.71.dist-info → langgraph_api-0.2.72.dist-info}/licenses/LICENSE +0 -0
langgraph_api/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.72"
|
langgraph_api/api/assistants.py
CHANGED
|
@@ -214,11 +214,21 @@ async def get_assistant_graph(
|
|
|
214
214
|
|
|
215
215
|
if isinstance(graph, BaseRemotePregel):
|
|
216
216
|
drawable_graph = await graph.fetch_graph(xray=xray)
|
|
217
|
-
|
|
217
|
+
json_graph = drawable_graph.to_json()
|
|
218
|
+
for node in json_graph.get("nodes", []):
|
|
219
|
+
if data := node.get("data"):
|
|
220
|
+
if isinstance(data, dict):
|
|
221
|
+
data.pop("id", None)
|
|
222
|
+
return ApiResponse(json_graph)
|
|
218
223
|
|
|
219
224
|
try:
|
|
220
225
|
drawable_graph = await graph.aget_graph(xray=xray)
|
|
221
|
-
|
|
226
|
+
json_graph = drawable_graph.to_json()
|
|
227
|
+
for node in json_graph.get("nodes", []):
|
|
228
|
+
if data := node.get("data"):
|
|
229
|
+
if isinstance(data, dict):
|
|
230
|
+
data.pop("id", None)
|
|
231
|
+
return ApiResponse(json_graph)
|
|
222
232
|
except NotImplementedError:
|
|
223
233
|
raise HTTPException(
|
|
224
234
|
422, detail="The graph does not support visualization"
|
langgraph_api/sse.py
CHANGED
|
@@ -63,9 +63,11 @@ class EventSourceResponse(sse_starlette.EventSourceResponse):
|
|
|
63
63
|
await send(
|
|
64
64
|
{
|
|
65
65
|
"type": "http.response.body",
|
|
66
|
-
"body":
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
"body": (
|
|
67
|
+
json_to_sse(*data)
|
|
68
|
+
if isinstance(data, tuple)
|
|
69
|
+
else data
|
|
70
|
+
),
|
|
69
71
|
"more_body": True,
|
|
70
72
|
}
|
|
71
73
|
)
|
|
@@ -90,14 +92,9 @@ class EventSourceResponse(sse_starlette.EventSourceResponse):
|
|
|
90
92
|
|
|
91
93
|
async def sse_heartbeat(send: Send) -> None:
|
|
92
94
|
payload = sse_starlette.ServerSentEvent(comment="heartbeat").encode()
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
await send(
|
|
97
|
-
{"type": "http.response.body", "body": payload, "more_body": True}
|
|
98
|
-
)
|
|
99
|
-
except asyncio.CancelledError:
|
|
100
|
-
pass
|
|
95
|
+
while True:
|
|
96
|
+
await asyncio.sleep(5)
|
|
97
|
+
await send({"type": "http.response.body", "body": payload, "more_body": True})
|
|
101
98
|
|
|
102
99
|
|
|
103
100
|
SEP = b"\r\n"
|
langgraph_api/worker.py
CHANGED
|
@@ -131,10 +131,11 @@ async def worker(
|
|
|
131
131
|
try:
|
|
132
132
|
await consume(stream, run_id, resumable)
|
|
133
133
|
except Exception as e:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
if not isinstance(e, UserRollback | UserInterrupt):
|
|
135
|
+
logger.error(
|
|
136
|
+
f"Run encountered an error in graph: {type(e)}({e})",
|
|
137
|
+
exc_info=e,
|
|
138
|
+
)
|
|
138
139
|
# TimeoutError is a special case where we rely on asyncio.wait_for to timeout runs
|
|
139
140
|
# Convert user TimeoutErrors to a custom class so we can distinguish and later convert back
|
|
140
141
|
if isinstance(e, TimeoutError):
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
langgraph_api/__init__.py,sha256=
|
|
1
|
+
langgraph_api/__init__.py,sha256=c7hAogCcGJv4p-Jen7YzVrMqWqmXOzFfJmuFoOBDLYU,23
|
|
2
2
|
langgraph_api/asgi_transport.py,sha256=eqifhHxNnxvI7jJqrY1_8RjL4Fp9NdN4prEub2FWBt8,5091
|
|
3
3
|
langgraph_api/asyncio.py,sha256=Odnc6mAJIGF3eFWT8Xcrg2Zam7FwzXkfCWEHaXfrzQQ,9371
|
|
4
4
|
langgraph_api/cli.py,sha256=13mKb-WT7fGx_yqcbWITPB9ICEHCrPzIP1ddZ5RbXbY,16015
|
|
@@ -16,7 +16,7 @@ langgraph_api/route.py,sha256=4VBkJMeusfiZtLzyUaKm1HwLHTq0g15y2CRiRhM6xyA,4773
|
|
|
16
16
|
langgraph_api/schema.py,sha256=a6it0h9ku4jrTXiW9MhnGok_wignyQ4cXBra67FiryM,5678
|
|
17
17
|
langgraph_api/serde.py,sha256=8fQXg7T7RVUqj_jgOoSOJrWVpQDW0qJKjAjSsEhPHo4,4803
|
|
18
18
|
langgraph_api/server.py,sha256=Z_VL-kIphybTRDWBIqHMfRhgCmAFyTRqAGlgnHQF0Zg,6973
|
|
19
|
-
langgraph_api/sse.py,sha256=
|
|
19
|
+
langgraph_api/sse.py,sha256=SLdtZmTdh5D8fbWrQjuY9HYLd2dg8Rmi6ZMmFMVc2iE,4204
|
|
20
20
|
langgraph_api/state.py,sha256=8jx4IoTCOjTJuwzuXJKKFwo1VseHjNnw_CCq4x1SW14,2284
|
|
21
21
|
langgraph_api/store.py,sha256=_xGhdwEIMoY1_hIy_oWwxZp4Y7FH833BNJfgFIhT80E,4640
|
|
22
22
|
langgraph_api/stream.py,sha256=UoJzqCzWhTVildxOlU87mX4NtZSUhtl1RGDeMFRYyNI,13660
|
|
@@ -24,9 +24,9 @@ langgraph_api/thread_ttl.py,sha256=-Ox8NFHqUH3wGNdEKMIfAXUubY5WGifIgCaJ7npqLgw,1
|
|
|
24
24
|
langgraph_api/utils.py,sha256=92mSti9GfGdMRRWyESKQW5yV-75Z9icGHnIrBYvdypU,3619
|
|
25
25
|
langgraph_api/validation.py,sha256=zMuKmwUEBjBgFMwAaeLZmatwGVijKv2sOYtYg7gfRtc,4950
|
|
26
26
|
langgraph_api/webhook.py,sha256=1ncwO0rIZcj-Df9sxSnFEzd1gP1bfS4okeZQS8NSRoE,1382
|
|
27
|
-
langgraph_api/worker.py,sha256=
|
|
27
|
+
langgraph_api/worker.py,sha256=fL0pNEW9FaldEREq_4L-ivkxTr2R_rEpmVMi-zRx__U,14226
|
|
28
28
|
langgraph_api/api/__init__.py,sha256=YVzpbn5IQotvuuLG9fhS9QMrxXfP4s4EpEMG0n4q3Nw,5625
|
|
29
|
-
langgraph_api/api/assistants.py,sha256=
|
|
29
|
+
langgraph_api/api/assistants.py,sha256=YdnLBMg_2k01n_OY3GT-vX41fMsWFS4sRbZd_irOYDY,16196
|
|
30
30
|
langgraph_api/api/mcp.py,sha256=RvRYgANqRzNQzSmgjNkq4RlKTtoEJYil04ot9lsmEtE,14352
|
|
31
31
|
langgraph_api/api/meta.py,sha256=MU9Ehdo2M8oaxGVBXVQFNRP6qSTXyrsGXFcndRlnvIE,3924
|
|
32
32
|
langgraph_api/api/openapi.py,sha256=362m6Ny8wOwZ6HrDK9JAVUzPkyLYWKeV1E71hPOaA0U,11278
|
|
@@ -86,8 +86,8 @@ langgraph_runtime/store.py,sha256=7mowndlsIroGHv3NpTSOZDJR0lCuaYMBoTnTrewjslw,11
|
|
|
86
86
|
LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
|
|
87
87
|
logging.json,sha256=3RNjSADZmDq38eHePMm1CbP6qZ71AmpBtLwCmKU9Zgo,379
|
|
88
88
|
openapi.json,sha256=NVgY0hdCu6v5anNus9I-CVYKKcrDLKd1qhILy-kQpq8,142590
|
|
89
|
-
langgraph_api-0.2.
|
|
90
|
-
langgraph_api-0.2.
|
|
91
|
-
langgraph_api-0.2.
|
|
92
|
-
langgraph_api-0.2.
|
|
93
|
-
langgraph_api-0.2.
|
|
89
|
+
langgraph_api-0.2.72.dist-info/METADATA,sha256=avTOLxcRvrv8RpORHCbAZBXMk7Le3PlSAvykaxIY33Q,3891
|
|
90
|
+
langgraph_api-0.2.72.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
91
|
+
langgraph_api-0.2.72.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
|
|
92
|
+
langgraph_api-0.2.72.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
|
|
93
|
+
langgraph_api-0.2.72.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|