langgraph-api 0.0.18__py3-none-any.whl → 0.0.20__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.

@@ -78,8 +78,8 @@ async def handle_event(
78
78
  - Raises HTTPException(403) if any handler rejects the request
79
79
 
80
80
  Handlers are run in order from most specific to most general:
81
- 1. Resource+action specific handlers (e.g. "runs", "create")
82
- 2. Resource handlers (e.g. "runs", "*")
81
+ 1. Resource+action specific handlers (e.g. "threads", "create")
82
+ 2. Resource handlers (e.g. "threads", "*")
83
83
  3. Action handlers (e.g. "*", "create")
84
84
  4. Global handlers ("*", "*")
85
85
  """
@@ -4,6 +4,7 @@ import { z } from "zod";
4
4
  import * as fs from "node:fs/promises";
5
5
  import * as path from "node:path";
6
6
  import {
7
+ filterValidGraphSpecs,
7
8
  GraphSchema,
8
9
  resolveGraph,
9
10
  runGraphSchemaWorker,
@@ -12,15 +13,15 @@ import {
12
13
  const __dirname = new URL(".", import.meta.url).pathname;
13
14
 
14
15
  async function main() {
15
- const specs = z
16
- .record(z.string())
17
- .parse(JSON.parse(process.env.LANGSERVE_GRAPHS));
16
+ const specs = filterValidGraphSpecs(
17
+ z.record(z.string()).parse(JSON.parse(process.env.LANGSERVE_GRAPHS))
18
+ );
18
19
 
19
20
  const GRAPH_SCHEMAS: Record<string, Record<string, GraphSchema>> = {};
20
21
 
21
22
  try {
22
23
  await Promise.all(
23
- Object.entries(specs).map(async ([graphId, rawSpec]) => {
24
+ specs.map(async ([graphId, rawSpec]) => {
24
25
  console.info(`[${graphId}]: Checking for source file existence`);
25
26
  const { resolved, ...spec } = await resolveGraph(rawSpec, {
26
27
  onlyFilePresence: true,
@@ -41,6 +41,7 @@ import {
41
41
  GraphSchema,
42
42
  resolveGraph,
43
43
  GraphSpec,
44
+ filterValidGraphSpecs,
44
45
  } from "./src/graph.mts";
45
46
 
46
47
  const logger = createLogger({
@@ -725,9 +726,9 @@ async function main() {
725
726
  const checkpointer = new RemoteCheckpointer();
726
727
  const store = new RemoteStore();
727
728
 
728
- const specs = z
729
- .record(z.string())
730
- .parse(JSON.parse(process.env.LANGSERVE_GRAPHS ?? "{}"));
729
+ const specs = filterValidGraphSpecs(
730
+ z.record(z.string()).parse(JSON.parse(process.env.LANGSERVE_GRAPHS ?? "{}"))
731
+ );
731
732
 
732
733
  if (!process.argv.includes("--skip-schema-cache")) {
733
734
  try {
@@ -742,7 +743,7 @@ async function main() {
742
743
  }
743
744
 
744
745
  await Promise.all(
745
- Object.entries(specs).map(async ([graphId, rawSpec]) => {
746
+ specs.map(async ([graphId, rawSpec]) => {
746
747
  logger.info(`Resolving graph ${graphId}`);
747
748
  const { resolved, ...spec } = await resolveGraph(rawSpec);
748
749
 
@@ -37,6 +37,7 @@ import {
37
37
  GraphSchema,
38
38
  resolveGraph,
39
39
  GraphSpec,
40
+ filterValidGraphSpecs,
40
41
  } from "./src/graph.mts";
41
42
 
42
43
  const logger = createLogger({
@@ -784,9 +785,9 @@ async function main() {
784
785
  const checkpointer = new RemoteCheckpointer();
785
786
  const store = new RemoteStore();
786
787
 
787
- const specs = z
788
- .record(z.string())
789
- .parse(JSON.parse(process.env.LANGSERVE_GRAPHS ?? "{}"));
788
+ const specs = filterValidGraphSpecs(
789
+ z.record(z.string()).parse(JSON.parse(process.env.LANGSERVE_GRAPHS ?? "{}"))
790
+ );
790
791
 
791
792
  if (!process.argv.includes("--skip-schema-cache")) {
792
793
  try {
@@ -801,7 +802,7 @@ async function main() {
801
802
  }
802
803
 
803
804
  await Promise.all(
804
- Object.entries(specs).map(async ([graphId, rawSpec]) => {
805
+ specs.map(async ([graphId, rawSpec]) => {
805
806
  logger.info(`Resolving graph ${graphId}`);
806
807
  const { resolved, ...spec } = await resolveGraph(rawSpec);
807
808
 
@@ -20,6 +20,12 @@ export interface GraphSpec {
20
20
  exportSymbol: string;
21
21
  }
22
22
 
23
+ export function filterValidGraphSpecs(specs: Record<string, string>) {
24
+ return Object.entries(specs).filter(
25
+ ([_, spec]) => !spec.split(":")[0].endsWith(".py")
26
+ );
27
+ }
28
+
23
29
  export async function resolveGraph(
24
30
  spec: string,
25
31
  options?: { onlyFilePresence?: false }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langgraph-api
3
- Version: 0.0.18
3
+ Version: 0.0.20
4
4
  Summary:
5
5
  License: Elastic-2.0
6
6
  Author: Nuno Campos
@@ -23,7 +23,7 @@ Requires-Dist: pyjwt (>=2.9.0,<3.0.0)
23
23
  Requires-Dist: sse-starlette (>=2.1.0,<2.2.0)
24
24
  Requires-Dist: starlette (>=0.38.6)
25
25
  Requires-Dist: structlog (>=24.4.0,<25.0.0)
26
- Requires-Dist: tenacity (>=8.3.0,<9.0.0)
26
+ Requires-Dist: tenacity (>=8.3.0,<10)
27
27
  Requires-Dist: uvicorn (>=0.26.0)
28
28
  Requires-Dist: watchfiles (>=0.13)
29
29
  Description-Content-Type: text/markdown
@@ -9,7 +9,7 @@ langgraph_api/api/store.py,sha256=VzAJVOwO0IxosBB7km5TTf2rhlWGyPkVz_LpvbxetVY,54
9
9
  langgraph_api/api/threads.py,sha256=taU61XPcCEhBPCYPZcMDsgVDwwWUWJs8p-PrXFXWY48,8661
10
10
  langgraph_api/asyncio.py,sha256=2fOlx-cZvuj1gQ867Kw1R_wsBsl9jdHYHcUtK2a-x-U,6264
11
11
  langgraph_api/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- langgraph_api/auth/custom.py,sha256=juCwlVxjWnCzcWI6Amae_4NfIOFtY39kaJ_zPF5AJaw,21025
12
+ langgraph_api/auth/custom.py,sha256=ZFyR5Yf_n5KJrMxBOy30hA396itQVvU4ywcyPwTE0og,21031
13
13
  langgraph_api/auth/langsmith/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  langgraph_api/auth/langsmith/backend.py,sha256=InScaL-HYCnxYEauhxU198gRZV9pJn9SzzBoR9Edn7g,2654
15
15
  langgraph_api/auth/langsmith/client.py,sha256=eKchvAom7hdkUXauD8vHNceBDDUijrFgdTV8bKd7x4Q,3998
@@ -25,9 +25,9 @@ langgraph_api/http.py,sha256=XrbyxpjtfSvnaWWh5ZLGpgZmY83WoDCrP_1GPguNiXI,4712
25
25
  langgraph_api/http_logger.py,sha256=Sxo_q-65tElauRvkzVLt9lJojgNdgtcHGBYD0IRyX7M,3146
26
26
  langgraph_api/js/.gitignore,sha256=qAah3Fq0HWAlfRj5ktZyC6QRQIsAolGLRGcRukA1XJI,33
27
27
  langgraph_api/js/base.py,sha256=BpE8-xkUp8HFPRjSKx1tfUQubvoV4jYl6OwZdre3veI,209
28
- langgraph_api/js/build.mts,sha256=sAZXB3xVSoG8exJ1ZEytFyikRmEsXJ_0OlLjDDgD79o,1342
29
- langgraph_api/js/client.mts,sha256=yFc4aeV5wm7N_z_K8gIukVXo6pHUBnp2Mlryl9B-yrA,22654
30
- langgraph_api/js/client.new.mts,sha256=54n0xc9SSDnrJDPsN_JcUKcRJJyQVIYuUrkKw3XDcio,23628
28
+ langgraph_api/js/build.mts,sha256=43_LQDjmtEyV6Sj6IZo7Mp6Y8zrsBbMP_5sWXQ_xBsY,1372
29
+ langgraph_api/js/client.mts,sha256=AWDSJHAFFtCKU8JkSg0NEPt85jtovk64SYDesIALtW0,22684
30
+ langgraph_api/js/client.new.mts,sha256=FskIvfdS4MvzoD07fJuHMoz26Puh_Mkwh2Lh6jKFj60,23658
31
31
  langgraph_api/js/errors.py,sha256=Cm1TKWlUCwZReDC5AQ6SgNIVGD27Qov2xcgHyf8-GXo,361
32
32
  langgraph_api/js/global.d.ts,sha256=zR_zLYfpzyPfxpEFth5RgZoyfGulIXyZYPRf7cU0K0Y,106
33
33
  langgraph_api/js/package.json,sha256=i2wjOE0_u1DdUvlc7Ulgj-tg06kjKCsFL99nQKF7vQk,840
@@ -36,7 +36,7 @@ langgraph_api/js/remote_new.py,sha256=T_Vr8459bax1C9xxqz_ZYmGivq5Vhspg2Iu9TL0Qc-
36
36
  langgraph_api/js/remote_old.py,sha256=2a-3ooAYUZs8aPsfnXafbBd4pP7lRmokoU7TiO7P9Js,22546
37
37
  langgraph_api/js/schema.py,sha256=7idnv7URlYUdSNMBXQcw7E4SxaPxCq_Oxwnlml8q5ik,408
38
38
  langgraph_api/js/server_sent_events.py,sha256=DLgXOHauemt7706vnfDUCG1GI3TidKycSizccdz9KgA,3702
39
- langgraph_api/js/src/graph.mts,sha256=EO1ITYoKiUykzO_8V8mnQb6NYybooR1VXIovThZzywc,2998
39
+ langgraph_api/js/src/graph.mts,sha256=J-M-vYHj1G5tyonPUym3ePNGqGYtspPCrZOgr92xKb4,3171
40
40
  langgraph_api/js/src/hooks.mjs,sha256=XtktgmIHlls_DsknAuwib-z7TqCm0haRoTXvnkgzMuo,601
41
41
  langgraph_api/js/src/parser/parser.mts,sha256=wXre7teh8N8RYmGcyhZp4vMJd0kNnnFgoSGEyMVPzpQ,13007
42
42
  langgraph_api/js/src/parser/parser.worker.mjs,sha256=2K6D0GlUmkk7LE39I8mryB8VZVE3-N9Cblji-ArPhFo,386
@@ -81,15 +81,15 @@ langgraph_license/validation.py,sha256=Uu_G8UGO_WTlLsBEY0gTVWjRR4czYGfw5YAD3HLZo
81
81
  langgraph_storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
82
82
  langgraph_storage/checkpoint.py,sha256=V4t2GwYEJdPCHbhq_4Udhlv0TWKDzlMu_rlNPdTDc50,3589
83
83
  langgraph_storage/database.py,sha256=Nr5zE9Fur3-tESkqe7xNXMf2QlBuw3H0CUie7jVa6Q4,6003
84
- langgraph_storage/ops.py,sha256=7kmfm7EO7YbP_ItEjMvFPKPsM0a2X6RMhjaKof63HaQ,68206
84
+ langgraph_storage/ops.py,sha256=r0XBv3F1IPeAZSwmFYfeW92Fx-OelTLUAGnclwQiuZc,68238
85
85
  langgraph_storage/queue.py,sha256=6cTZ0ubHu3S1T43yxHMVOwsQsDaJupByiU0sTUFFls8,3261
86
86
  langgraph_storage/retry.py,sha256=uvYFuXJ-T6S1QY1ZwkZHyZQbsvS-Ab68LSbzbUUSI2E,696
87
87
  langgraph_storage/store.py,sha256=D-p3cWc_umamkKp-6Cz3cAriSACpvM5nxUIvND6PuxE,2710
88
88
  langgraph_storage/ttl_dict.py,sha256=FlpEY8EANeXWKo_G5nmIotPquABZGyIJyk6HD9u6vqY,1533
89
89
  logging.json,sha256=3RNjSADZmDq38eHePMm1CbP6qZ71AmpBtLwCmKU9Zgo,379
90
90
  openapi.json,sha256=L1Ap1o6oAg2vKqjWohq4gl1-GpxezjlddS_oZHjS-xE,125227
91
- langgraph_api-0.0.18.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
92
- langgraph_api-0.0.18.dist-info/METADATA,sha256=k6oxmbw-_QEHL7VOaAdecVtt7tkw7ccF6A4ywpGYYUk,4041
93
- langgraph_api-0.0.18.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
94
- langgraph_api-0.0.18.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
95
- langgraph_api-0.0.18.dist-info/RECORD,,
91
+ langgraph_api-0.0.20.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
92
+ langgraph_api-0.0.20.dist-info/METADATA,sha256=Uaqm1DLTcuJnTX6AY4zuGR-xMRzE6zJRxPKmXqhF1yY,4038
93
+ langgraph_api-0.0.20.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
94
+ langgraph_api-0.0.20.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
95
+ langgraph_api-0.0.20.dist-info/RECORD,,
langgraph_storage/ops.py CHANGED
@@ -1328,6 +1328,7 @@ class Runs(Authenticated):
1328
1328
  metadata={
1329
1329
  "graph_id": assistant["graph_id"],
1330
1330
  "assistant_id": str(assistant_id),
1331
+ **metadata,
1331
1332
  },
1332
1333
  config=Runs._merge_jsonb(
1333
1334
  assistant["config"],