langgraph-api 0.0.41__tar.gz → 0.0.42__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.
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/PKG-INFO +1 -1
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/api/assistants.py +2 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/api/runs.py +1 -1
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/asyncio.py +6 -2
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/config.py +19 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/graph.py +1 -1
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/lifespan.py +3 -1
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/schema.py +2 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_storage/database.py +1 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_storage/ops.py +13 -1
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_storage/queue.py +2 -2
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/pyproject.toml +1 -1
- langgraph_api-0.0.41/langgraph_storage/ttl_dict.py +0 -54
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/LICENSE +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/README.md +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/__init__.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/api/__init__.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/api/mcp.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/api/meta.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/api/openapi.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/api/store.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/api/threads.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/api/ui.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/auth/__init__.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/auth/custom.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/auth/langsmith/__init__.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/auth/langsmith/backend.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/auth/langsmith/client.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/auth/middleware.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/auth/noop.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/auth/studio_user.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/cli.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/command.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/cron_scheduler.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/errors.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/http.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/.gitignore +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/base.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/build.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/client.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/errors.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/global.d.ts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/package.json +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/remote.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/schema.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/src/graph.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/src/hooks.mjs +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/src/parser/parser.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/src/parser/parser.worker.mjs +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/src/schema/types.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/src/schema/types.template.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/src/utils/importMap.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/src/utils/pythonSchemas.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/src/utils/serde.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/sse.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/api.test.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/compose-postgres.yml +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/.gitignore +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/agent.css +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/agent.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/agent.ui.tsx +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/delay.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/dynamic.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/error.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/langgraph.json +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/nested.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/package.json +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/weather.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/graphs/yarn.lock +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/parser.test.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/tests/utils.mts +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/yarn.lock +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/logging.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/metadata.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/middleware/__init__.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/middleware/http_logger.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/middleware/private_network.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/models/__init__.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/models/run.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/patch.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/queue_entrypoint.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/route.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/serde.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/server.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/sse.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/state.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/stream.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/thread_ttl.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/utils.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/validation.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/webhook.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/worker.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_license/__init__.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_license/middleware.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_license/validation.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_storage/__init__.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_storage/checkpoint.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_storage/inmem_stream.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_storage/retry.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_storage/store.py +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/logging.json +0 -0
- {langgraph_api-0.0.41 → langgraph_api-0.0.42}/openapi.json +0 -0
|
@@ -124,6 +124,7 @@ async def create_assistant(request: ApiRequest) -> ApiResponse:
|
|
|
124
124
|
metadata=payload.get("metadata") or {},
|
|
125
125
|
if_exists=payload.get("if_exists") or "raise",
|
|
126
126
|
name=payload.get("name") or "Untitled",
|
|
127
|
+
description=payload.get("description"),
|
|
127
128
|
)
|
|
128
129
|
return ApiResponse(await fetchone(assistant, not_found_code=409))
|
|
129
130
|
|
|
@@ -312,6 +313,7 @@ async def patch_assistant(
|
|
|
312
313
|
graph_id=payload.get("graph_id"),
|
|
313
314
|
metadata=payload.get("metadata"),
|
|
314
315
|
name=payload.get("name"),
|
|
316
|
+
description=payload.get("description"),
|
|
315
317
|
)
|
|
316
318
|
return ApiResponse(await fetchone(assistant))
|
|
317
319
|
|
|
@@ -63,7 +63,9 @@ async def wait_if_not_done(coro: Coroutine[Any, Any, T], done: ValueEvent) -> T:
|
|
|
63
63
|
async with asyncio.TaskGroup() as tg:
|
|
64
64
|
coro_task = tg.create_task(coro)
|
|
65
65
|
done_task = tg.create_task(done.wait())
|
|
66
|
-
coro_task.add_done_callback(
|
|
66
|
+
coro_task.add_done_callback(
|
|
67
|
+
lambda _: done_task.cancel("Coro task completed")
|
|
68
|
+
)
|
|
67
69
|
done_task.add_done_callback(lambda _: coro_task.cancel(done._value))
|
|
68
70
|
try:
|
|
69
71
|
return await coro_task
|
|
@@ -131,6 +133,7 @@ class SimpleTaskGroup(AbstractAsyncContextManager["SimpleTaskGroup"]):
|
|
|
131
133
|
cancel: bool = False,
|
|
132
134
|
wait: bool = True,
|
|
133
135
|
taskset: set[asyncio.Task] | None = None,
|
|
136
|
+
taskgroup_name: str | None = None,
|
|
134
137
|
) -> None:
|
|
135
138
|
self.tasks = taskset if taskset is not None else set()
|
|
136
139
|
self.cancel = cancel
|
|
@@ -140,6 +143,7 @@ class SimpleTaskGroup(AbstractAsyncContextManager["SimpleTaskGroup"]):
|
|
|
140
143
|
task.add_done_callback(partial(self._create_task_done_callback, ()))
|
|
141
144
|
for coro in coros:
|
|
142
145
|
self.create_task(coro)
|
|
146
|
+
self.taskgroup_name = f" {taskgroup_name} " if taskgroup_name else ""
|
|
143
147
|
|
|
144
148
|
def _create_task_done_callback(
|
|
145
149
|
self, ignore_exceptions: tuple[Exception, ...], task: asyncio.Task
|
|
@@ -175,7 +179,7 @@ class SimpleTaskGroup(AbstractAsyncContextManager["SimpleTaskGroup"]):
|
|
|
175
179
|
# cancel all tasks
|
|
176
180
|
if self.cancel:
|
|
177
181
|
for task in tasks:
|
|
178
|
-
task.cancel()
|
|
182
|
+
task.cancel(f"Task group{self.taskgroup_name}cancelled.")
|
|
179
183
|
# wait for all tasks
|
|
180
184
|
if self.wait:
|
|
181
185
|
await asyncio.gather(*tasks, return_exceptions=True)
|
|
@@ -105,6 +105,20 @@ class StoreConfig(TypedDict, total=False):
|
|
|
105
105
|
ttl: TTLConfig
|
|
106
106
|
|
|
107
107
|
|
|
108
|
+
class CheckpointerConfig(TypedDict, total=False):
|
|
109
|
+
"""Configuration for the built-in checkpointer, which handles checkpointing of state.
|
|
110
|
+
|
|
111
|
+
If omitted, no checkpointer is set up (the object store will still be present, however).
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
ttl: ThreadTTLConfig | None
|
|
115
|
+
"""Optional. Defines the TTL (time-to-live) behavior configuration.
|
|
116
|
+
|
|
117
|
+
If provided, the checkpointer will apply TTL settings according to the configuration.
|
|
118
|
+
If omitted, no TTL behavior is configured.
|
|
119
|
+
"""
|
|
120
|
+
|
|
121
|
+
|
|
108
122
|
# env
|
|
109
123
|
|
|
110
124
|
env = Config()
|
|
@@ -223,9 +237,14 @@ def _parse_thread_ttl(value: str | None) -> ThreadTTLConfig | None:
|
|
|
223
237
|
}
|
|
224
238
|
|
|
225
239
|
|
|
240
|
+
CHECKPOINTER_CONFIG: CheckpointerConfig | None = env(
|
|
241
|
+
"LANGGRAPH_CHECKPOINTER", cast=_parse_json, default=None
|
|
242
|
+
)
|
|
226
243
|
THREAD_TTL: ThreadTTLConfig | None = env(
|
|
227
244
|
"LANGGRAPH_THREAD_TTL", cast=_parse_thread_ttl, default=None
|
|
228
245
|
)
|
|
246
|
+
if THREAD_TTL is None and CHECKPOINTER_CONFIG is not None:
|
|
247
|
+
THREAD_TTL = CHECKPOINTER_CONFIG.get("ttl")
|
|
229
248
|
|
|
230
249
|
N_JOBS_PER_WORKER = env("N_JOBS_PER_WORKER", cast=int, default=10)
|
|
231
250
|
BG_JOB_TIMEOUT_SECS = env("BG_JOB_TIMEOUT_SECS", cast=float, default=3600)
|
|
@@ -291,7 +291,7 @@ def _handle_exception(task: asyncio.Task) -> None:
|
|
|
291
291
|
async def stop_remote_graphs() -> None:
|
|
292
292
|
logger.info("Cancelling remote graphs")
|
|
293
293
|
for task in js_bg_tasks:
|
|
294
|
-
task.cancel()
|
|
294
|
+
task.cancel("Stopping remote graphs.")
|
|
295
295
|
|
|
296
296
|
|
|
297
297
|
def verify_graphs() -> None:
|
|
@@ -47,7 +47,9 @@ async def lifespan(
|
|
|
47
47
|
await start_pool()
|
|
48
48
|
await collect_graphs_from_env(True)
|
|
49
49
|
try:
|
|
50
|
-
async with SimpleTaskGroup(
|
|
50
|
+
async with SimpleTaskGroup(
|
|
51
|
+
cancel=True, taskset=taskset, taskgroup_name="Lifespan"
|
|
52
|
+
) as tg:
|
|
51
53
|
tg.create_task(metadata_loop())
|
|
52
54
|
if config.N_JOBS_PER_WORKER > 0:
|
|
53
55
|
tg.create_task(queue())
|
|
@@ -177,6 +177,7 @@ class Assistants(Authenticated):
|
|
|
177
177
|
if_exists: OnConflictBehavior,
|
|
178
178
|
name: str,
|
|
179
179
|
ctx: Auth.types.BaseAuthContext | None = None,
|
|
180
|
+
description: str | None = None,
|
|
180
181
|
) -> AsyncIterator[Assistant]:
|
|
181
182
|
"""Insert an assistant."""
|
|
182
183
|
assistant_id = _ensure_uuid(assistant_id)
|
|
@@ -224,6 +225,7 @@ class Assistants(Authenticated):
|
|
|
224
225
|
"created_at": now,
|
|
225
226
|
"updated_at": now,
|
|
226
227
|
"version": 1,
|
|
228
|
+
"description": description,
|
|
227
229
|
}
|
|
228
230
|
new_version = {
|
|
229
231
|
"assistant_id": assistant_id,
|
|
@@ -251,16 +253,20 @@ class Assistants(Authenticated):
|
|
|
251
253
|
graph_id: str | None = None,
|
|
252
254
|
metadata: MetadataInput | None = None,
|
|
253
255
|
name: str | None = None,
|
|
256
|
+
description: str | None = None,
|
|
254
257
|
ctx: Auth.types.BaseAuthContext | None = None,
|
|
255
258
|
) -> AsyncIterator[Assistant]:
|
|
256
259
|
"""Update an assistant.
|
|
257
260
|
|
|
258
261
|
Args:
|
|
262
|
+
conn: The connection to the in-memory store.
|
|
259
263
|
assistant_id: The assistant ID.
|
|
260
264
|
graph_id: The graph ID.
|
|
261
265
|
config: The assistant config.
|
|
262
266
|
metadata: The assistant metadata.
|
|
263
267
|
name: The assistant name.
|
|
268
|
+
description: The assistant description.
|
|
269
|
+
ctx: The auth context.
|
|
264
270
|
|
|
265
271
|
Returns:
|
|
266
272
|
return the updated assistant model.
|
|
@@ -317,6 +323,9 @@ class Assistants(Authenticated):
|
|
|
317
323
|
"metadata": metadata if metadata is not None else assistant["metadata"],
|
|
318
324
|
"created_at": now,
|
|
319
325
|
"name": name if name is not None else assistant["name"],
|
|
326
|
+
"description": description
|
|
327
|
+
if description is not None
|
|
328
|
+
else assistant["description"],
|
|
320
329
|
}
|
|
321
330
|
conn.store["assistant_versions"].append(new_version_entry)
|
|
322
331
|
|
|
@@ -327,6 +336,9 @@ class Assistants(Authenticated):
|
|
|
327
336
|
"config": new_version_entry["config"],
|
|
328
337
|
"metadata": new_version_entry["metadata"],
|
|
329
338
|
"name": name if name is not None else assistant["name"],
|
|
339
|
+
"description": description
|
|
340
|
+
if description is not None
|
|
341
|
+
else assistant["description"],
|
|
330
342
|
"updated_at": now,
|
|
331
343
|
"version": new_version,
|
|
332
344
|
}
|
|
@@ -1350,7 +1362,7 @@ class Runs(Authenticated):
|
|
|
1350
1362
|
# Get queue for this run
|
|
1351
1363
|
queue = await Runs.Stream.subscribe(run_id)
|
|
1352
1364
|
|
|
1353
|
-
async with SimpleTaskGroup(cancel=True) as tg:
|
|
1365
|
+
async with SimpleTaskGroup(cancel=True, taskgroup_name="Runs.enter") as tg:
|
|
1354
1366
|
done = ValueEvent()
|
|
1355
1367
|
tg.create_task(listen_for_cancellation(queue, run_id, done))
|
|
1356
1368
|
|
|
@@ -141,9 +141,9 @@ async def queue():
|
|
|
141
141
|
bb.deactivate()
|
|
142
142
|
logger.info("Shutting down background workers")
|
|
143
143
|
for task in WORKERS:
|
|
144
|
-
task.cancel()
|
|
144
|
+
task.cancel("Shutting down background workers.")
|
|
145
145
|
for task in WEBHOOKS:
|
|
146
|
-
task.cancel()
|
|
146
|
+
task.cancel("Shutting down webhooks for background workers.")
|
|
147
147
|
await asyncio.wait_for(
|
|
148
148
|
asyncio.gather(*WORKERS, *WEBHOOKS, return_exceptions=True),
|
|
149
149
|
SHUTDOWN_GRACE_PERIOD_SECS,
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# TODO: Make this class thread-safe
|
|
5
|
-
class TTLDict:
|
|
6
|
-
def __init__(self, timeout=10):
|
|
7
|
-
self._store = {}
|
|
8
|
-
self._timeouts = {}
|
|
9
|
-
self._tasks = {} # Track tasks for key expiry
|
|
10
|
-
self._timeout = timeout
|
|
11
|
-
|
|
12
|
-
async def _remove_key_after_timeout(self, key):
|
|
13
|
-
await asyncio.sleep(self._timeouts[key])
|
|
14
|
-
if key in self._store:
|
|
15
|
-
del self._store[key]
|
|
16
|
-
del self._timeouts[key]
|
|
17
|
-
|
|
18
|
-
def set(self, key, value, timeout=None):
|
|
19
|
-
self._store[key] = value
|
|
20
|
-
key_timeout = timeout if timeout is not None else self._timeout
|
|
21
|
-
self._timeouts[key] = key_timeout
|
|
22
|
-
|
|
23
|
-
# Cancel the previous task if it exists
|
|
24
|
-
if key in self._tasks:
|
|
25
|
-
self._tasks[key].cancel()
|
|
26
|
-
|
|
27
|
-
# Schedule the removal of the key
|
|
28
|
-
self._tasks[key] = asyncio.create_task(self._remove_key_after_timeout(key))
|
|
29
|
-
|
|
30
|
-
def get(self, key, default=None):
|
|
31
|
-
return self._store.get(key, default)
|
|
32
|
-
|
|
33
|
-
def __contains__(self, key):
|
|
34
|
-
return key in self._store
|
|
35
|
-
|
|
36
|
-
def remove(self, key):
|
|
37
|
-
if key in self._store:
|
|
38
|
-
del self._store[key]
|
|
39
|
-
del self._timeouts[key]
|
|
40
|
-
if key in self._tasks:
|
|
41
|
-
self._tasks[key].cancel()
|
|
42
|
-
del self._tasks[key]
|
|
43
|
-
|
|
44
|
-
def keys(self):
|
|
45
|
-
return self._store.keys()
|
|
46
|
-
|
|
47
|
-
def values(self):
|
|
48
|
-
return self._store.values()
|
|
49
|
-
|
|
50
|
-
def items(self):
|
|
51
|
-
return self._store.items()
|
|
52
|
-
|
|
53
|
-
def __repr__(self):
|
|
54
|
-
return f"{self.__class__.__name__}({self._store})"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langgraph_api-0.0.41 → langgraph_api-0.0.42}/langgraph_api/js/src/schema/types.template.mts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|