langgraph-api 0.1.20__py3-none-any.whl → 0.1.22__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.
langgraph_api/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.20"
1
+ __version__ = "0.1.22"
langgraph_api/api/ui.py CHANGED
@@ -53,13 +53,19 @@ async def handle_ui(request: ApiRequest) -> Response:
53
53
  basename = os.path.basename(filepath)
54
54
  ext = os.path.splitext(basename)[1]
55
55
 
56
+ # Use http:// protocol if accessing a localhost service
57
+ def is_host(needle: str) -> bool:
58
+ return host.startswith(needle + ":") or host == needle
59
+
60
+ protocol = "http:" if is_host("localhost") or is_host("127.0.0.1") else ""
61
+
56
62
  if ext == ".css":
57
63
  result.append(
58
- f'<link rel="stylesheet" href="//{host}/ui/{graph_id}/{basename}" />'
64
+ f'<link rel="stylesheet" href="{protocol}//{host}/ui/{graph_id}/{basename}" />'
59
65
  )
60
66
  elif ext == ".js":
61
67
  result.append(
62
- f'<script src="//{host}/ui/{graph_id}/{basename}" '
68
+ f'<script src="{protocol}//{host}/ui/{graph_id}/{basename}" '
63
69
  f"onload='__LGUI_{graph_id}.render({json.dumps(message['name'])}, \"{{{{shadowRootId}}}}\")'>"
64
70
  "</script>"
65
71
  )
@@ -99,7 +99,18 @@ function incrementNodes() {
99
99
  const version = await (async () => {
100
100
  try {
101
101
  const packageJson = await import("@langchain/langgraph/package.json");
102
- return packageJson["version"];
102
+
103
+ if (
104
+ "default" in packageJson &&
105
+ typeof packageJson.default === "object" &&
106
+ packageJson.default != null
107
+ ) {
108
+ return packageJson.default.version || undefined;
109
+ }
110
+
111
+ if ("version" in packageJson) {
112
+ return packageJson.version || undefined;
113
+ }
103
114
  } catch (error) {
104
115
  logger.error(error);
105
116
  }
@@ -250,6 +250,8 @@ class RemotePregel(BaseRemotePregel):
250
250
  item.get("createdAt"),
251
251
  item.get("parentConfig"),
252
252
  _convert_tasks(item.get("tasks", [])),
253
+ # TODO: add handling of interrupts when multiple resumes land in JS
254
+ tuple(),
253
255
  )
254
256
 
255
257
  async def aget_state(
@@ -1992,10 +1992,10 @@ it("dynamic graph", async () => {
1992
1992
  it("generative ui", async () => {
1993
1993
  const ui = await client["~ui"].getComponent("agent", "weather-component");
1994
1994
  expect(ui).toContain(
1995
- `<link rel="stylesheet" href="//localhost:9123/ui/agent/entrypoint.css" />`,
1995
+ `<link rel="stylesheet" href="http://localhost:9123/ui/agent/entrypoint.css" />`,
1996
1996
  );
1997
1997
  expect(ui).toContain(
1998
- `<script src="//localhost:9123/ui/agent/entrypoint.js" onload='__LGUI_agent.render("weather-component", "{{shadowRootId}}")'></script>`,
1998
+ `<script src="http://localhost:9123/ui/agent/entrypoint.js" onload='__LGUI_agent.render("weather-component", "{{shadowRootId}}")'></script>`,
1999
1999
  );
2000
2000
 
2001
2001
  const match = /src="(?<src>[^"]+)"/.exec(ui);
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: langgraph-api
3
- Version: 0.1.20
3
+ Version: 0.1.22
4
4
  Summary:
5
5
  License: Elastic-2.0
6
6
  Author: Nuno Campos
@@ -1,5 +1,5 @@
1
1
  LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
2
- langgraph_api/__init__.py,sha256=8XalsVoLEfXslFvdtUEmkNOuYShzOzYOcFbgmOz1oSk,23
2
+ langgraph_api/__init__.py,sha256=zmP2TRnzKPjZJ1eiBcT-cRInsji6FW-OVD3FafQFCc4,23
3
3
  langgraph_api/api/__init__.py,sha256=IKKMrC5gCHTzjprbg8jgZDrAJRuqJfSUgEkZAgh3l-M,5771
4
4
  langgraph_api/api/assistants.py,sha256=6oYFRKlvqheJQGbWjFhQOUnnSbvsbrdMYLRJP7WtSRo,14481
5
5
  langgraph_api/api/mcp.py,sha256=KbR19dtFCpJEiKYj3IfepAuJij8YZVELuVp7JY_yu_o,13754
@@ -8,7 +8,7 @@ langgraph_api/api/openapi.py,sha256=OGwzPpYO4e98iqtgL7UEfzI6jP4zXahJ1R-7VgOSZeg,
8
8
  langgraph_api/api/runs.py,sha256=dhHZ3xu7V0anftqzXaOYnhVEryJpVeqzu60MFiUw4u8,18010
9
9
  langgraph_api/api/store.py,sha256=G4Fm8hgFLlJUW5_ekLS_IOgCfpFy-TK9uq5r9QTOELQ,5447
10
10
  langgraph_api/api/threads.py,sha256=ogMKmEoiycuaV3fa5kpupDohJ7fwUOfVczt6-WSK4FE,9322
11
- langgraph_api/api/ui.py,sha256=kmXA270SX9JkF8_qrx1G_b3grc_SL6jEuCYpH1ZLPXE,2201
11
+ langgraph_api/api/ui.py,sha256=2nlipYV2nUGR4T9pceaAbgN1lS3-T2zPBh7Nv3j9eZQ,2479
12
12
  langgraph_api/asyncio.py,sha256=h0eZ7aoDGnJpoxnHLZABVlj1jQ78UxjgiHntTmAEWek,8613
13
13
  langgraph_api/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  langgraph_api/auth/custom.py,sha256=QR49PnIfPPQZ6ygWmnMkSuAzgOpBBUbbz5kJ2yVwGmQ,21934
@@ -31,11 +31,11 @@ langgraph_api/js/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
31
31
  langgraph_api/js/base.py,sha256=gjY6K8avI03OrI-Hy6a311fQ_EG5r_x8hUYlc7uqxdE,534
32
32
  langgraph_api/js/build.mts,sha256=ceHRr_Io_9otkDOSgHuKbGnOUu4AX2jPj8APTTa9UjM,2741
33
33
  langgraph_api/js/client.http.mts,sha256=AGA-p8J85IcNh2oXZjDxHQ4PnQdJmt-LPcpZp6j0Cws,4687
34
- langgraph_api/js/client.mts,sha256=YUna7um53zSiZHt0Dfmd7fBTTEPAZ2-hLNZ7m9nDsT8,30090
34
+ langgraph_api/js/client.mts,sha256=RZgkJk43CMOwnHXMXBbWIEhHh0W8WBwQ8Rm8GkJwvhM,30341
35
35
  langgraph_api/js/errors.py,sha256=Cm1TKWlUCwZReDC5AQ6SgNIVGD27Qov2xcgHyf8-GXo,361
36
36
  langgraph_api/js/global.d.ts,sha256=j4GhgtQSZ5_cHzjSPcHgMJ8tfBThxrH-pUOrrJGteOU,196
37
37
  langgraph_api/js/package.json,sha256=5gtQpj0mXh069X5fWJFWp-jt7Sb3RQUPVpe4m8Q0KHE,1289
38
- langgraph_api/js/remote.py,sha256=7n9JN6rLO3BcvLF76jSX6BHPM3vSrARqBeZGmsPANAI,35628
38
+ langgraph_api/js/remote.py,sha256=ipAITSDyh-kNau37nfRg-PSB-6Lbtax3UJap8-lLZdw,35729
39
39
  langgraph_api/js/schema.py,sha256=7idnv7URlYUdSNMBXQcw7E4SxaPxCq_Oxwnlml8q5ik,408
40
40
  langgraph_api/js/src/graph.mts,sha256=QVy2sUcwcG9WkPF6AXy9mh0dvaXccVIZNtv5rkUtUYc,3479
41
41
  langgraph_api/js/src/load.hooks.mjs,sha256=xNVHq75W0Lk6MUKl1pQYrx-wtQ8_neiUyI6SO-k0ecM,2235
@@ -49,7 +49,7 @@ langgraph_api/js/src/utils/importMap.mts,sha256=pX4TGOyUpuuWF82kXcxcv3-8mgusRezO
49
49
  langgraph_api/js/src/utils/pythonSchemas.mts,sha256=98IW7Z_VP7L_CHNRMb3_MsiV3BgLE2JsWQY_PQcRR3o,685
50
50
  langgraph_api/js/src/utils/serde.mts,sha256=OuyyO9btvwWd55rU_H4x91dFEJiaPxL-lL9O6Zgo908,742
51
51
  langgraph_api/js/sse.py,sha256=lsfp4nyJyA1COmlKG9e2gJnTttf_HGCB5wyH8OZBER8,4105
52
- langgraph_api/js/tests/api.test.mts,sha256=mQxM4Dbdnv_nIYpMg6VIkpmpU012I3D4dwRko3Cw-zI,68115
52
+ langgraph_api/js/tests/api.test.mts,sha256=qjHkSdgTDiBauhxRD4yNMufD5xfZh9BNZ7nD7hTgyzo,68125
53
53
  langgraph_api/js/tests/auth.test.mts,sha256=Aink9N0y3VCxp-Q0sLapAmdiUBYGzcwU8_3RXkRYN4c,21614
54
54
  langgraph_api/js/tests/compose-postgres.auth.yml,sha256=iPfJbCeYZdV6GiRLiDn_f7qgpG4TyyGaQ4lV-ZXr6Qk,1768
55
55
  langgraph_api/js/tests/compose-postgres.yml,sha256=w4B3YRS0QEnTcZH2-MY0DYvR_c5GcER0uDa1Ga_knf8,1960
@@ -101,8 +101,8 @@ langgraph_license/validation.py,sha256=ZKraAVJArAABKqrmHN-EN18ncoNUmRm500Yt1Sc7t
101
101
  langgraph_runtime/__init__.py,sha256=O4GgSmu33c-Pr8Xzxj_brcK5vkm70iNTcyxEjICFZxA,1075
102
102
  logging.json,sha256=3RNjSADZmDq38eHePMm1CbP6qZ71AmpBtLwCmKU9Zgo,379
103
103
  openapi.json,sha256=cjlQFtrH7TwXQ9GNe1jy2iBRhae_F6inFZhsaCQidBc,132770
104
- langgraph_api-0.1.20.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
105
- langgraph_api-0.1.20.dist-info/METADATA,sha256=VmXrHY0G8gs4WuohLP35c41gUw8MmQduRAfDsRaliK0,4236
106
- langgraph_api-0.1.20.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
107
- langgraph_api-0.1.20.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
108
- langgraph_api-0.1.20.dist-info/RECORD,,
104
+ langgraph_api-0.1.22.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
105
+ langgraph_api-0.1.22.dist-info/METADATA,sha256=qSqFSbO5n59F225UE3vait5mHBJxVkXnZpOx2Z6QWdA,4236
106
+ langgraph_api-0.1.22.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
107
+ langgraph_api-0.1.22.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
108
+ langgraph_api-0.1.22.dist-info/RECORD,,