langgraph-api 0.0.28rc1__tar.gz → 0.0.30__tar.gz

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.

Files changed (98) hide show
  1. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/PKG-INFO +1 -1
  2. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/api/__init__.py +2 -0
  3. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/api/runs.py +2 -0
  4. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/auth/custom.py +6 -2
  5. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/auth/middleware.py +5 -0
  6. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/client.mts +4 -2
  7. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/src/parser/parser.mts +5 -0
  8. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/src/schema/types.mts +0 -120
  9. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/src/schema/types.template.mts +13 -11
  10. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/logging.py +4 -3
  11. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_storage/ops.py +1 -1
  12. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/pyproject.toml +2 -1
  13. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/LICENSE +0 -0
  14. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/README.md +0 -0
  15. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/__init__.py +0 -0
  16. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/api/assistants.py +0 -0
  17. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/api/meta.py +0 -0
  18. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/api/openapi.py +0 -0
  19. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/api/store.py +0 -0
  20. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/api/threads.py +0 -0
  21. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/api/ui.py +0 -0
  22. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/asyncio.py +0 -0
  23. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/auth/__init__.py +0 -0
  24. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/auth/langsmith/__init__.py +0 -0
  25. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/auth/langsmith/backend.py +0 -0
  26. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/auth/langsmith/client.py +0 -0
  27. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/auth/noop.py +0 -0
  28. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/auth/studio_user.py +0 -0
  29. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/cli.py +0 -0
  30. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/config.py +0 -0
  31. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/cron_scheduler.py +0 -0
  32. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/errors.py +0 -0
  33. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/graph.py +0 -0
  34. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/http.py +0 -0
  35. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/.gitignore +0 -0
  36. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/base.py +0 -0
  37. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/build.mts +0 -0
  38. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/errors.py +0 -0
  39. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/global.d.ts +0 -0
  40. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/package.json +0 -0
  41. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/remote.py +0 -0
  42. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/schema.py +0 -0
  43. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/src/graph.mts +0 -0
  44. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/src/hooks.mjs +0 -0
  45. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/src/parser/parser.worker.mjs +0 -0
  46. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/src/utils/importMap.mts +0 -0
  47. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/src/utils/pythonSchemas.mts +0 -0
  48. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/src/utils/serde.mts +0 -0
  49. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/sse.py +0 -0
  50. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/api.test.mts +0 -0
  51. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/compose-postgres.yml +0 -0
  52. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/graphs/.gitignore +0 -0
  53. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/graphs/agent.css +0 -0
  54. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/graphs/agent.mts +0 -0
  55. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/graphs/agent.ui.tsx +0 -0
  56. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/graphs/delay.mts +0 -0
  57. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/graphs/error.mts +0 -0
  58. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/graphs/langgraph.json +0 -0
  59. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/graphs/nested.mts +0 -0
  60. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/graphs/package.json +0 -0
  61. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/graphs/weather.mts +0 -0
  62. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/graphs/yarn.lock +0 -0
  63. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/parser.test.mts +0 -0
  64. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/tests/utils.mts +0 -0
  65. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/js/yarn.lock +0 -0
  66. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/lifespan.py +0 -0
  67. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/metadata.py +0 -0
  68. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/middleware/__init__.py +0 -0
  69. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/middleware/http_logger.py +0 -0
  70. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/middleware/private_network.py +0 -0
  71. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/models/__init__.py +0 -0
  72. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/models/run.py +0 -0
  73. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/patch.py +0 -0
  74. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/queue_entrypoint.py +0 -0
  75. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/route.py +0 -0
  76. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/schema.py +0 -0
  77. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/serde.py +0 -0
  78. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/server.py +0 -0
  79. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/sse.py +0 -0
  80. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/state.py +0 -0
  81. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/stream.py +0 -0
  82. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/utils.py +0 -0
  83. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/validation.py +0 -0
  84. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/webhook.py +0 -0
  85. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_api/worker.py +0 -0
  86. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_license/__init__.py +0 -0
  87. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_license/middleware.py +0 -0
  88. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_license/validation.py +0 -0
  89. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_storage/__init__.py +0 -0
  90. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_storage/checkpoint.py +0 -0
  91. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_storage/database.py +0 -0
  92. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_storage/inmem_stream.py +0 -0
  93. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_storage/queue.py +0 -0
  94. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_storage/retry.py +0 -0
  95. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_storage/store.py +0 -0
  96. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/langgraph_storage/ttl_dict.py +0 -0
  97. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/logging.json +0 -0
  98. {langgraph_api-0.0.28rc1 → langgraph_api-0.0.30}/openapi.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langgraph-api
3
- Version: 0.0.28rc1
3
+ Version: 0.0.30
4
4
  Summary:
5
5
  License: Elastic-2.0
6
6
  Author: Nuno Campos
@@ -64,6 +64,8 @@ if HTTP_CONFIG:
64
64
  protected_routes.extend(threads_routes)
65
65
  if not HTTP_CONFIG.get("disable_store"):
66
66
  protected_routes.extend(store_routes)
67
+ if not HTTP_CONFIG.get("disable_ui"):
68
+ protected_routes.extend(ui_routes)
67
69
  else:
68
70
  protected_routes.extend(assistants_routes)
69
71
  protected_routes.extend(runs_routes)
@@ -354,11 +354,13 @@ async def join_run_stream_endpoint(request: ApiRequest):
354
354
  cancel_on_disconnect = cancel_on_disconnect_str.lower() in {"true", "yes", "1"}
355
355
  validate_uuid(thread_id, "Invalid thread ID: must be a UUID")
356
356
  validate_uuid(run_id, "Invalid run ID: must be a UUID")
357
+ stream_mode = request.query_params.get("stream_mode")
357
358
  return EventSourceResponse(
358
359
  Runs.Stream.join(
359
360
  run_id,
360
361
  thread_id=thread_id,
361
362
  cancel_on_disconnect=cancel_on_disconnect,
363
+ stream_mode=stream_mode,
362
364
  )
363
365
  )
364
366
 
@@ -18,6 +18,7 @@ from starlette.authentication import (
18
18
  BaseUser,
19
19
  )
20
20
  from starlette.concurrency import run_in_threadpool
21
+ from starlette.datastructures import QueryParams
21
22
  from starlette.exceptions import HTTPException
22
23
  from starlette.requests import HTTPConnection, Request
23
24
  from starlette.responses import Response
@@ -37,7 +38,7 @@ SUPPORTED_PARAMETERS = {
37
38
  "scopes": list[str],
38
39
  "path_params": dict[str, str] | None,
39
40
  "query_params": dict[str, str] | None,
40
- "headers": dict[str, bytes] | None,
41
+ "headers": dict[bytes, bytes] | None,
41
42
  "authorization": str | None,
42
43
  "scope": dict[str, Any],
43
44
  }
@@ -271,7 +272,7 @@ def _extract_arguments_from_scope(
271
272
  if "path" in param_names:
272
273
  args["path"] = scope["path"]
273
274
  if "query_params" in param_names:
274
- args["query_params"] = scope.get("query_params", {})
275
+ args["query_params"] = QueryParams(scope.get("query_string"))
275
276
  if "headers" in param_names:
276
277
  args["headers"] = dict(scope.get("headers", {}))
277
278
  if "authorization" in param_names:
@@ -478,6 +479,9 @@ class ProxyUser(BaseUser):
478
479
  """Proxy any other attributes to the underlying user object."""
479
480
  return getattr(self._user, name)
480
481
 
482
+ def __str__(self) -> str:
483
+ return f"{self._user}"
484
+
481
485
 
482
486
  class SimpleUser(ProxyUser):
483
487
  def __init__(self, username: str):
@@ -42,6 +42,11 @@ class ConditionalAuthenticationMiddleware(AuthenticationMiddleware):
42
42
  await self.app(scope, receive, send)
43
43
  return
44
44
 
45
+ if scope["path"].startswith("/ui") and scope["method"] == "GET":
46
+ # disable auth for UI asset requests
47
+ await self.app(scope, receive, send)
48
+ return
49
+
45
50
  return await super().__call__(scope, receive, send)
46
51
 
47
52
 
@@ -493,6 +493,7 @@ const StreamModeSchema = z.union([
493
493
  z.literal("updates"),
494
494
  z.literal("debug"),
495
495
  z.literal("values"),
496
+ z.literal("custom"),
496
497
  ]);
497
498
 
498
499
  const ExtraStreamModeSchema = z.union([
@@ -529,8 +530,9 @@ async function* streamEventsRequest(
529
530
  ? payload.stream_mode
530
531
  : [payload.stream_mode];
531
532
 
532
- const graphStreamMode: Set<"updates" | "debug" | "values" | "messages"> =
533
- new Set();
533
+ const graphStreamMode: Set<
534
+ "updates" | "debug" | "values" | "messages" | "custom"
535
+ > = new Set();
534
536
  if (payload.stream_mode) {
535
537
  for (const mode of userStreamMode) {
536
538
  if (mode === "messages") {
@@ -348,6 +348,11 @@ export class SubgraphExtractor {
348
348
 
349
349
  const fsMap = new Map<string, string>();
350
350
  const system = vfs.createFSBackedSystem(fsMap, dirname, ts);
351
+
352
+ // TODO: investigate if we should create a PR in @typescript/vfs
353
+ const oldReadFile = system.readFile.bind(system);
354
+ system.readFile = (fileName) => oldReadFile(fileName) ?? "// Non-existent file";
355
+
351
356
  const host = vfs.createVirtualCompilerHost(system, compilerOptions, ts);
352
357
 
353
358
  const targetPath =
@@ -2014,123 +2014,3 @@ export function buildGenerator(
2014
2014
  settings
2015
2015
  );
2016
2016
  }
2017
-
2018
- export async function extractGraphSchema(
2019
- id: string,
2020
- userPath: string,
2021
- exportName: string
2022
- ) {
2023
- const filePath = path.resolve(process.cwd(), userPath);
2024
- const parentPath = path.dirname(filePath);
2025
-
2026
- const typePath = path.resolve(parentPath, `__$0${id}.mts`);
2027
- const importPath = path.relative(parentPath, filePath);
2028
-
2029
- try {
2030
- await fs.writeFile(
2031
- typePath,
2032
- dedent`
2033
- import { ${exportName} as __graph } from "./${importPath}";
2034
- import type { BaseMessage } from "@langchain/core/messages";
2035
- import type {
2036
- StateType,
2037
- UpdateType,
2038
- StateDefinition,
2039
- } from "@langchain/langgraph";
2040
-
2041
- type Wrap<T> = (a: T) => void;
2042
- type MatchBaseMessage<T> = T extends BaseMessage ? BaseMessage : never;
2043
- type MatchBaseMessageArray<T> =
2044
- T extends Array<infer C>
2045
- ? Wrap<MatchBaseMessage<C>> extends Wrap<BaseMessage>
2046
- ? BaseMessage[]
2047
- : never
2048
- : never;
2049
-
2050
- type Defactorify<T> = T extends (...args: any[]) => infer R
2051
- ? Awaited<R>
2052
- : Awaited<T>;
2053
-
2054
- type Inspect<T> = T extends unknown
2055
- ? {
2056
- [K in keyof T]: 0 extends 1 & T[K]
2057
- ? T[K]
2058
- : Wrap<MatchBaseMessageArray<T[K]>> extends Wrap<BaseMessage[]>
2059
- ? BaseMessage[]
2060
- : Wrap<MatchBaseMessage<T[K]>> extends Wrap<BaseMessage>
2061
- ? BaseMessage
2062
- : Inspect<T[K]>;
2063
- }
2064
- : never;
2065
-
2066
- type ReflectCompiled<T> = T extends { RunInput: infer S; RunOutput: infer U }
2067
- ? { state: S; update: U }
2068
- : never;
2069
-
2070
- type Reflect<T> =
2071
- Defactorify<T> extends infer DT
2072
- ? DT extends {
2073
- compile(...args: any[]): infer Compiled;
2074
- }
2075
- ? ReflectCompiled<Compiled>
2076
- : ReflectCompiled<DT>
2077
- : never;
2078
-
2079
- type __reflect = Reflect<typeof __graph>;
2080
- export type __state = Inspect<__reflect["state"]>;
2081
- export type __update = Inspect<__reflect["update"]>;
2082
-
2083
- type BuilderReflectCompiled<T> = T extends {
2084
- builder: {
2085
- _inputDefinition: infer I extends StateDefinition;
2086
- _outputDefinition: infer O extends StateDefinition;
2087
- _configSchema?: infer C extends StateDefinition | undefined;
2088
- };
2089
- }
2090
- ? { input: UpdateType<I>; output: StateType<O>; config: UpdateType<C> }
2091
- : never;
2092
-
2093
- type BuilderReflect<T> =
2094
- Defactorify<T> extends infer DT
2095
- ? DT extends {
2096
- compile(...args: any[]): infer Compiled;
2097
- }
2098
- ? BuilderReflectCompiled<Compiled>
2099
- : BuilderReflectCompiled<DT>
2100
- : never;
2101
-
2102
- type __builder = BuilderReflect<typeof __graph>;
2103
- type FilterAny<T> = 0 extends 1 & T ? never : T;
2104
- export type __input = Inspect<FilterAny<__builder["input"]>>;
2105
- export type __output = Inspect<FilterAny<__builder["output"]>>;
2106
- export type __config = Inspect<FilterAny<__builder["config"]>>;
2107
- `
2108
- );
2109
- const program = ts.createProgram([typePath], {
2110
- noEmit: true,
2111
- strict: true,
2112
- allowUnusedLabels: true,
2113
- });
2114
-
2115
- const schema = buildGenerator(program);
2116
-
2117
- const trySymbol = (schema: JsonSchemaGenerator | null, symbol: string) => {
2118
- try {
2119
- return schema?.getSchemaForSymbol(symbol) ?? undefined;
2120
- } catch (e) {
2121
- console.error(`Failed to obtain symbol "${symbol}":`, e?.message);
2122
- }
2123
- return undefined;
2124
- };
2125
-
2126
- return {
2127
- state: trySymbol(schema, "__state"),
2128
- update: trySymbol(schema, "__update"),
2129
- input: trySymbol(schema, "__input"),
2130
- output: trySymbol(schema, "__output"),
2131
- config: trySymbol(schema, "__config"),
2132
- };
2133
- } finally {
2134
- await fs.unlink(typePath);
2135
- }
2136
- }
@@ -23,17 +23,19 @@ type Defactorify<T> = T extends (...args: any[]) => infer R
23
23
  ? Awaited<R>
24
24
  : Awaited<T>;
25
25
 
26
- type Inspect<T> = T extends unknown
27
- ? {
28
- [K in keyof T]: 0 extends 1 & T[K]
29
- ? T[K]
30
- : Wrap<MatchBaseMessageArray<T[K]>> extends Wrap<BaseMessage[]>
31
- ? BaseMessage[]
32
- : Wrap<MatchBaseMessage<T[K]>> extends Wrap<BaseMessage>
33
- ? BaseMessage
34
- : Inspect<T[K]>;
35
- }
36
- : never;
26
+ type Inspect<T, CNT extends Array<0> = []> = CNT extends [0, 0, 0]
27
+ ? any
28
+ : T extends unknown
29
+ ? {
30
+ [K in keyof T]: 0 extends 1 & T[K]
31
+ ? T[K]
32
+ : Wrap<MatchBaseMessageArray<T[K]>> extends Wrap<BaseMessage[]>
33
+ ? BaseMessage[]
34
+ : Wrap<MatchBaseMessage<T[K]>> extends Wrap<BaseMessage>
35
+ ? BaseMessage
36
+ : Inspect<T[K], [0, ...CNT]>;
37
+ }
38
+ : never;
37
39
 
38
40
  type ReflectCompiled<T> = T extends { RunInput: infer S; RunOutput: infer U }
39
41
  ? { state: S; update: U }
@@ -6,9 +6,6 @@ import structlog
6
6
  from starlette.config import Config
7
7
  from structlog.typing import EventDict
8
8
 
9
- from langgraph_api.metadata import append_log
10
- from langgraph_api.serde import json_dumpb
11
-
12
9
  # env
13
10
 
14
11
  log_env = Config()
@@ -52,6 +49,8 @@ class JSONRenderer:
52
49
  """
53
50
  The return type of this depends on the return type of self._dumps.
54
51
  """
52
+ from langgraph_api.serde import json_dumpb
53
+
55
54
  return json_dumpb(event_dict).decode()
56
55
 
57
56
 
@@ -69,6 +68,8 @@ class TapForMetadata:
69
68
  event_dict["logger"].startswith("langgraph")
70
69
  and LEVELS[event_dict["level"].upper()] > LEVELS["INFO"]
71
70
  ):
71
+ from langgraph_api.metadata import append_log
72
+
72
73
  append_log(event_dict.copy())
73
74
  return event_dict
74
75
 
@@ -1757,7 +1757,7 @@ class Runs(Authenticated):
1757
1757
  queue = (
1758
1758
  stream_mode
1759
1759
  if isinstance(stream_mode, asyncio.Queue)
1760
- else await Runs.Stream.subscribe(run_id)
1760
+ else await Runs.Stream.subscribe(run_id, stream_mode=stream_mode)
1761
1761
  )
1762
1762
 
1763
1763
  try:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "langgraph-api"
3
- version = "0.0.28-rc1"
3
+ version = "0.0.30"
4
4
  description = ""
5
5
  authors = [
6
6
  "Nuno Campos <nuno@langchain.dev>",
@@ -48,6 +48,7 @@ pytest-repeat = "^0.9.3"
48
48
  pytest-retry = "^1.6.3"
49
49
  pytest-httpserver = "^1.1.0"
50
50
  fastapi = "^0.115.8"
51
+ langgraph = ">=0.3.9"
51
52
 
52
53
  [tool.pytest.ini_options]
53
54
  # --strict-markers will raise errors on unknown marks.