langgraph-api 0.11.0.dev8__py3-none-any.whl → 0.11.0.dev9__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.11.0.dev8"
1
+ __version__ = "0.11.0.dev9"
langgraph_api/cli.py CHANGED
@@ -109,7 +109,12 @@ def _find_open_port(host: str) -> int:
109
109
 
110
110
 
111
111
  def _resolve_server_url(
112
- host: str, port: int, *, mount_prefix: str | None, tunnel: bool
112
+ host: str,
113
+ port: int,
114
+ *,
115
+ mount_prefix: str | None,
116
+ tunnel: bool,
117
+ is_ssl: bool,
113
118
  ) -> str:
114
119
  """Return the public-facing base URL for the server.
115
120
 
@@ -119,11 +124,15 @@ def _resolve_server_url(
119
124
  """
120
125
  from langgraph_api.utils.network import format_hostport # noqa: PLC0415
121
126
 
122
- upstream_url = f"http://{format_hostport(host, port)}"
127
+ upstream_url = (
128
+ f"http://{format_hostport(host, port)}"
129
+ if not is_ssl
130
+ else f"https://{format_hostport(host, port)}"
131
+ )
123
132
  if mount_prefix:
124
133
  upstream_url += mount_prefix
125
134
 
126
- if not tunnel:
135
+ if not tunnel or is_ssl:
127
136
  return upstream_url
128
137
 
129
138
  logger.info("Starting Cloudflare Tunnel...")
@@ -185,6 +194,8 @@ def run_server(
185
194
  allow_blocking: bool = False,
186
195
  runtime_edition: Literal["inmem", "community", "postgres"] = "inmem",
187
196
  server_level: str = "WARNING",
197
+ ssl_certfile: str | pathlib.Path | None = None,
198
+ ssl_keyfile: str | pathlib.Path | None = None,
188
199
  __redis_uri__: str | None = "fake",
189
200
  __database_uri__: str | None = ":memory:",
190
201
  __migrations_path__: str | None = "__inmem",
@@ -282,8 +293,13 @@ def run_server(
282
293
  to_patch[k] = v
283
294
 
284
295
  with patch_environment(**to_patch):
296
+ is_ssl = ssl_certfile is not None and ssl_keyfile is not None
285
297
  local_url = _resolve_server_url(
286
- host, port, mount_prefix=mount_prefix, tunnel=tunnel
298
+ host,
299
+ port,
300
+ mount_prefix=mount_prefix,
301
+ tunnel=tunnel,
302
+ is_ssl=is_ssl,
287
303
  )
288
304
  os.environ["LANGGRAPH_API_URL"] = local_url
289
305
 
@@ -292,6 +308,7 @@ def run_server(
292
308
 
293
309
  def _open_browser():
294
310
  nonlocal studio_origin, full_studio_url
311
+ import ssl # noqa: PLC0415
295
312
  import webbrowser # noqa: PLC0415
296
313
 
297
314
  thread_logger = logging.getLogger("browser_opener")
@@ -302,10 +319,17 @@ def run_server(
302
319
 
303
320
  with ThreadPoolExecutor(max_workers=1) as executor:
304
321
  org_id_future = executor.submit(_get_org_id)
322
+ context = (
323
+ ssl._create_unverified_context()
324
+ if ssl_certfile and ssl_keyfile
325
+ else None
326
+ )
305
327
 
306
328
  while True:
307
329
  try:
308
- with urllib.request.urlopen(f"{local_url}/ok") as response:
330
+ with urllib.request.urlopen(
331
+ f"{local_url}/ok", context=context
332
+ ) as response:
309
333
  if response.status == 200:
310
334
  try:
311
335
  org_id = org_id_future.result(timeout=3.0)
@@ -373,6 +397,8 @@ For production use, please use LangSmith Deployment.
373
397
  access_log=False,
374
398
  reload_includes=list(reload_includes) if reload_includes else None,
375
399
  reload_excludes=list(reload_excludes) if reload_excludes else None,
400
+ ssl_certfile=ssl_certfile,
401
+ ssl_keyfile=ssl_keyfile,
376
402
  log_config={
377
403
  "version": 1,
378
404
  "incremental": False,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-api
3
- Version: 0.11.0.dev8
3
+ Version: 0.11.0.dev9
4
4
  Author-email: Will Fu-Hinthorn <will@langchain.dev>, Josh Rogers <josh@langchain.dev>, Parker Rule <parker@langchain.dev>
5
5
  License: Elastic-2.0
6
6
  License-File: LICENSE
@@ -1,9 +1,9 @@
1
- langgraph_api/__init__.py,sha256=qyHqOF9ff0aiG8PunV8QpzDvCDo8FAzJozKTOeicgDw,28
1
+ langgraph_api/__init__.py,sha256=ODvnQh6zY2Mdw6hMdx11i_MRvcQ-Kv5LMYazITUYfdo,28
2
2
  langgraph_api/_factory_utils.py,sha256=5JsiJbg_YocVSryN2jwoZTg03-eyymlWMK6sKCmXwz0,5756
3
3
  langgraph_api/asgi_transport.py,sha256=XApY3lIWBZTMbbsl8dDJzl0cLGirmAGE0SifqZUnXvs,11896
4
4
  langgraph_api/asyncio.py,sha256=c-YE-14N7_AP1GzifsbP14XnhLsmxT2P916KXruerpI,10573
5
5
  langgraph_api/cache.py,sha256=LuB3Te0UdXC8a-uEJoRHoe5XsgXulXI59f_Q6DCJNKc,13005
6
- langgraph_api/cli.py,sha256=YabmG9cUN3mdyylyzXsBp9v1PgFpqAUGrGSRxie4_C4,21647
6
+ langgraph_api/cli.py,sha256=ATtS9s9Cx7QNiGPJceKnMCko29A25ZA-xz39fdxmgfg,22389
7
7
  langgraph_api/command.py,sha256=d-k8h6H4ix1n7fSZ-Zb01NbSkEyqrD6cMKfDFXEIYEw,821
8
8
  langgraph_api/cron_scheduler.py,sha256=OwFzCwD86pfMNpfm9Z8bBS_WY9bBfDxGnq8_7wXurdA,6016
9
9
  langgraph_api/errors.py,sha256=zlMW99wAzNkz2xfik-HMkl_wMqmRFvs1j8V-_DZbAUc,2553
@@ -228,8 +228,8 @@ langgraph_grpc_common/proto/errors_pb2.py,sha256=JI6x-vBK1AE7DHZ5DQwN1mZWF6C4xTR
228
228
  langgraph_grpc_common/proto/errors_pb2.pyi,sha256=rd3-BYUH8V-aO66taL7OOblaLgdrDtf1Vcd38GUoVVM,2181
229
229
  langgraph_grpc_common/proto/errors_pb2_grpc.py,sha256=2-LwQ0OPGo-NtC0269q7Fw6GPBxnTLYWq3xP5Eq0_YA,886
230
230
  langgraph_grpc_common/proto/errors_pb2_grpc.pyi,sha256=uC9Wnq6uyg488QiONpJ0ba1s_iouQCOYsjd_FDd1XUM,495
231
- langgraph_api-0.11.0.dev8.dist-info/METADATA,sha256=krNc-o4DDd4U8aJ-bHqA7O7B9DZRgPkVIydOxX_chBU,4630
232
- langgraph_api-0.11.0.dev8.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
233
- langgraph_api-0.11.0.dev8.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
234
- langgraph_api-0.11.0.dev8.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
235
- langgraph_api-0.11.0.dev8.dist-info/RECORD,,
231
+ langgraph_api-0.11.0.dev9.dist-info/METADATA,sha256=4oMpCP0-X5iIKGh10-YW2PnAbkNVSMWCjBMj-pEyBjA,4630
232
+ langgraph_api-0.11.0.dev9.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
233
+ langgraph_api-0.11.0.dev9.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
234
+ langgraph_api-0.11.0.dev9.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
235
+ langgraph_api-0.11.0.dev9.dist-info/RECORD,,