langgraph-api 0.0.17__py3-none-any.whl → 0.0.18__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/config.py CHANGED
@@ -6,6 +6,16 @@ from starlette.datastructures import CommaSeparatedStrings
6
6
 
7
7
  env = Config()
8
8
 
9
+
10
+ def _parse_json(json: str | None) -> dict | None:
11
+ if not json:
12
+ return None
13
+ parsed = orjson.loads(json)
14
+ if not parsed:
15
+ return None
16
+ return parsed
17
+
18
+
9
19
  STATS_INTERVAL_SECS = env("STATS_INTERVAL_SECS", cast=int, default=60)
10
20
  HTTP_CONCURRENCY = env("HTTP_CONCURRENCY", cast=int, default=10)
11
21
 
@@ -21,6 +31,48 @@ REDIS_MAX_CONNECTIONS = env("REDIS_MAX_CONNECTIONS", cast=int, default=500)
21
31
  # server
22
32
 
23
33
  CORS_ALLOW_ORIGINS = env("CORS_ALLOW_ORIGINS", cast=CommaSeparatedStrings, default="*")
34
+ CORS_CONFIG = env("CORS_CONFIG", cast=_parse_json, default=None)
35
+ """
36
+ {
37
+ "type": "object",
38
+ "properties": {
39
+ "allow_origins": {
40
+ "type": "array",
41
+ "items": {"type": "string"},
42
+ "default": []
43
+ },
44
+ "allow_methods": {
45
+ "type": "array",
46
+ "items": {"type": "string"},
47
+ "default": ["GET"]
48
+ },
49
+ "allow_headers": {
50
+ "type": "array",
51
+ "items": {"type": "string"},
52
+ "default": []
53
+ },
54
+ "allow_credentials": {
55
+ "type": "boolean",
56
+ "default": false
57
+ },
58
+ "allow_origin_regex": {
59
+ "type": ["string", "null"],
60
+ "default": null
61
+ },
62
+ "expose_headers": {
63
+ "type": "array",
64
+ "items": {"type": "string"},
65
+ "default": []
66
+ },
67
+ "max_age": {
68
+ "type": "integer",
69
+ "default": 600
70
+ }
71
+ }
72
+ }
73
+ """
74
+ if CORS_CONFIG is not None and CORS_ALLOW_ORIGINS != "*":
75
+ raise ValueError("CORS_CONFIG and CORS_ALLOW_ORIGINS cannot be set together")
24
76
 
25
77
  # queue
26
78
 
@@ -38,18 +90,7 @@ FF_JS_ZEROMQ_ENABLED = env("FF_JS_ZEROMQ_ENABLED", cast=bool, default=False)
38
90
  # auth
39
91
 
40
92
  LANGGRAPH_AUTH_TYPE = env("LANGGRAPH_AUTH_TYPE", cast=str, default="noop")
41
-
42
-
43
- def _parse_auth(auth: str | None) -> dict | None:
44
- if not auth:
45
- return None
46
- parsed = orjson.loads(auth)
47
- if not parsed:
48
- return None
49
- return parsed
50
-
51
-
52
- LANGGRAPH_AUTH = env("LANGGRAPH_AUTH", cast=_parse_auth, default=None)
93
+ LANGGRAPH_AUTH = env("LANGGRAPH_AUTH", cast=_parse_json, default=None)
53
94
  LANGSMITH_TENANT_ID = env("LANGSMITH_TENANT_ID", cast=str, default=None)
54
95
  LANGSMITH_AUTH_VERIFY_TENANT_ID = env(
55
96
  "LANGSMITH_AUTH_VERIFY_TENANT_ID",
@@ -57,7 +98,6 @@ LANGSMITH_AUTH_VERIFY_TENANT_ID = env(
57
98
  default=LANGSMITH_TENANT_ID is not None,
58
99
  )
59
100
 
60
-
61
101
  if LANGGRAPH_AUTH_TYPE == "langsmith":
62
102
  LANGSMITH_AUTH_ENDPOINT = env("LANGSMITH_AUTH_ENDPOINT", cast=str)
63
103
  LANGSMITH_TENANT_ID = env("LANGSMITH_TENANT_ID", cast=str)
langgraph_api/server.py CHANGED
@@ -33,6 +33,11 @@ app = Starlette(
33
33
  allow_credentials=True,
34
34
  allow_methods=["*"],
35
35
  allow_headers=["*"],
36
+ )
37
+ if config.CORS_CONFIG is None
38
+ else Middleware(
39
+ CORSMiddleware,
40
+ **config.CORS_CONFIG,
36
41
  ),
37
42
  Middleware(LicenseValidationMiddleware),
38
43
  Middleware(AccessLoggerMiddleware, logger=logger),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langgraph-api
3
- Version: 0.0.17
3
+ Version: 0.0.18
4
4
  Summary:
5
5
  License: Elastic-2.0
6
6
  Author: Nuno Campos
@@ -17,7 +17,7 @@ langgraph_api/auth/middleware.py,sha256=qc7SbaFoeWaqxS1wbjZ2PPQ4iI2p9T0shWL7c6g0
17
17
  langgraph_api/auth/noop.py,sha256=Bk6Nf3p8D_iMVy_OyfPlyiJp_aEwzL-sHrbxoXpCbac,586
18
18
  langgraph_api/auth/studio_user.py,sha256=FzFQRROKDlA9JjtBuwyZvk6Mbwno5M9RVYjDO6FU3F8,186
19
19
  langgraph_api/cli.py,sha256=7vQQiD3F50r-8KkbuFjwIz8LLbdKUTd4xZGUJPiO3yQ,11688
20
- langgraph_api/config.py,sha256=sJuzbE08y87bdg8SDJbBxlhfh6dUhwVEH15irsXbPig,2926
20
+ langgraph_api/config.py,sha256=YDGkyZQRdG2QRYwSwPKC9J3UOhq7Diy_ZdypAL-vbrw,4034
21
21
  langgraph_api/cron_scheduler.py,sha256=MW41-TSGUe5OuXycFTy7Ax7ypxHVAv-0ImLonRT8h8o,2629
22
22
  langgraph_api/errors.py,sha256=Bu_i5drgNTyJcLiyrwVE_6-XrSU50BHf9TDpttki9wQ,1690
23
23
  langgraph_api/graph.py,sha256=FombjYQkqj8jrXJFEVkl3m2UyFcq5nSVNswR2HoRsQY,16385
@@ -69,7 +69,7 @@ langgraph_api/queue.py,sha256=qRuM09mz8o7CkrBIwg-9lV3SW0TehdVGgeXvHc_adYk,13647
69
69
  langgraph_api/route.py,sha256=fM4qYCGbmH0a3_cV8uKocb1sLklehxO6HhdRXqLK6OM,4421
70
70
  langgraph_api/schema.py,sha256=4aZCFY-dxd_nTot71bdcd9S8QCIgKajuRyj0p2QfgJ4,5291
71
71
  langgraph_api/serde.py,sha256=VoJ7Z1IuqrQGXFzEP1qijAITtWCrmjtVqlCRuScjXJI,3533
72
- langgraph_api/server.py,sha256=afHDnL6b_fAIu_q4icnK60a74lHTTZOMIe1egdhRXIk,1522
72
+ langgraph_api/server.py,sha256=OrFCbFMIL7L7K8Id4lNEI6soFBwCdcIN4maSwSfsj1o,1657
73
73
  langgraph_api/sse.py,sha256=2wNodCOP2eg7a9mpSu0S3FQ0CHk2BBV_vv0UtIgJIcc,4034
74
74
  langgraph_api/state.py,sha256=8jx4IoTCOjTJuwzuXJKKFwo1VseHjNnw_CCq4x1SW14,2284
75
75
  langgraph_api/stream.py,sha256=MUYYNgwtLs1Mhq1dm12zda7j8uFYir49umigK6CnuXU,11944
@@ -87,9 +87,9 @@ langgraph_storage/retry.py,sha256=uvYFuXJ-T6S1QY1ZwkZHyZQbsvS-Ab68LSbzbUUSI2E,69
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
- openapi.json,sha256=qf2Rw3ieawlAcSJu4mGonh9mNOb6solBD70CGL3w24A,124699
91
- langgraph_api-0.0.17.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
92
- langgraph_api-0.0.17.dist-info/METADATA,sha256=skjkW8xJ9LfwIyCYABDSreC2ZCXUqktWWekfxrK8AZY,4041
93
- langgraph_api-0.0.17.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
94
- langgraph_api-0.0.17.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
95
- langgraph_api-0.0.17.dist-info/RECORD,,
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,,
openapi.json CHANGED
@@ -3317,6 +3317,18 @@
3317
3317
  {
3318
3318
  "type": "object"
3319
3319
  },
3320
+ {
3321
+ "type": "array"
3322
+ },
3323
+ {
3324
+ "type": "string"
3325
+ },
3326
+ {
3327
+ "type": "number"
3328
+ },
3329
+ {
3330
+ "type": "boolean"
3331
+ },
3320
3332
  {
3321
3333
  "type": "null"
3322
3334
  }
@@ -3532,6 +3544,18 @@
3532
3544
  {
3533
3545
  "type": "object"
3534
3546
  },
3547
+ {
3548
+ "type": "array"
3549
+ },
3550
+ {
3551
+ "type": "string"
3552
+ },
3553
+ {
3554
+ "type": "number"
3555
+ },
3556
+ {
3557
+ "type": "boolean"
3558
+ },
3535
3559
  {
3536
3560
  "type": "null"
3537
3561
  }