Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdk-js: Update types for state.task #2429

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/sdk-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{

Check notice on line 1 in libs/sdk-js/package.json

View workflow job for this annotation

GitHub Actions / benchmark

Benchmark results

......................................... fanout_to_subgraph_10x: Mean +- std dev: 60.9 ms +- 1.6 ms ......................................... fanout_to_subgraph_10x_sync: Mean +- std dev: 51.1 ms +- 0.6 ms ......................................... fanout_to_subgraph_10x_checkpoint: Mean +- std dev: 90.8 ms +- 7.6 ms ......................................... fanout_to_subgraph_10x_checkpoint_sync: Mean +- std dev: 92.9 ms +- 0.7 ms ......................................... fanout_to_subgraph_100x: Mean +- std dev: 601 ms +- 28 ms ......................................... fanout_to_subgraph_100x_sync: Mean +- std dev: 500 ms +- 6 ms ......................................... fanout_to_subgraph_100x_checkpoint: Mean +- std dev: 945 ms +- 52 ms ......................................... fanout_to_subgraph_100x_checkpoint_sync: Mean +- std dev: 921 ms +- 20 ms ......................................... react_agent_10x: Mean +- std dev: 30.7 ms +- 0.6 ms ......................................... react_agent_10x_sync: Mean +- std dev: 22.3 ms +- 0.2 ms ......................................... react_agent_10x_checkpoint: Mean +- std dev: 46.8 ms +- 0.9 ms ......................................... react_agent_10x_checkpoint_sync: Mean +- std dev: 36.5 ms +- 0.4 ms ......................................... react_agent_100x: Mean +- std dev: 342 ms +- 7 ms ......................................... react_agent_100x_sync: Mean +- std dev: 270 ms +- 4 ms ......................................... react_agent_100x_checkpoint: Mean +- std dev: 931 ms +- 14 ms ......................................... react_agent_100x_checkpoint_sync: Mean +- std dev: 825 ms +- 10 ms ......................................... wide_state_25x300: Mean +- std dev: 24.2 ms +- 0.5 ms ......................................... wide_state_25x300_sync: Mean +- std dev: 15.4 ms +- 0.1 ms ......................................... wide_state_25x300_checkpoint: Mean +- std dev: 278 ms +- 7 ms ......................................... wide_state_25x300_checkpoint_sync: Mean +- std dev: 265 ms +- 4 ms ......................................... wide_state_15x600: Mean +- std dev: 28.1 ms +- 0.5 ms ......................................... wide_state_15x600_sync: Mean +- std dev: 17.8 ms +- 0.1 ms ......................................... wide_state_15x600_checkpoint: Mean +- std dev: 479 ms +- 5 ms ......................................... wide_state_15x600_checkpoint_sync: Mean +- std dev: 461 ms +- 5 ms ......................................... wide_state_9x1200: Mean +- std dev: 28.1 ms +- 0.5 ms ......................................... wide_state_9x1200_sync: Mean +- std dev: 17.7 ms +- 0.2 ms ......................................... wide_state_9x1200_checkpoint: Mean +- std dev: 312 ms +- 4 ms ......................................... wide_state_9x1200_checkpoint_sync: Mean +- std dev: 297 ms +- 6 ms

Check notice on line 1 in libs/sdk-js/package.json

View workflow job for this annotation

GitHub Actions / benchmark

Comparison against main

+-----------------------------------------+---------+-----------------------+ | Benchmark | main | changes | +=========================================+=========+=======================+ | react_agent_100x_checkpoint_sync | 886 ms | 825 ms: 1.07x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_100x_checkpoint | 999 ms | 931 ms: 1.07x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_checkpoint | 987 ms | 945 ms: 1.04x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x | 625 ms | 601 ms: 1.04x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_25x300_sync | 15.8 ms | 15.4 ms: 1.03x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_100x_sync | 278 ms | 270 ms: 1.03x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_checkpoint_sync | 946 ms | 921 ms: 1.03x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_10x_checkpoint_sync | 37.4 ms | 36.5 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_10x | 31.4 ms | 30.7 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_15x600 | 28.7 ms | 28.1 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_100x | 348 ms | 342 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_checkpoint_sync | 94.6 ms | 92.9 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_10x_sync | 22.6 ms | 22.3 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_25x300_checkpoint | 282 ms | 278 ms: 1.02x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_9x1200_sync | 18.0 ms | 17.7 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_25x300 | 24.5 ms | 24.2 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x | 61.6 ms | 60.9 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_sync | 51.6 ms | 51.1 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_sync | 505 ms | 500 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_25x300_checkpoint_sync | 267 ms | 265 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_10x_checkpoint | 47.2 ms | 46.8 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_15x600_sync | 17.9 ms | 17.8 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_9x1200_checkpoint_sync | 299 ms | 297 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | wide_state_15x600_checkpoint_sync | 463 ms | 461 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | Geometric mean | (ref) | 1.02x faster | +---------------------------------------
"name": "@langchain/langgraph-sdk",
"version": "0.0.24",
"version": "0.0.25",
"description": "Client library for interacting with the LangGraph API",
"type": "module",
"packageManager": "[email protected]",
Expand Down
1 change: 1 addition & 0 deletions libs/sdk-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type {
Metadata,
Run,
Thread,
ThreadTask,
ThreadState,
ThreadStatus,
Cron,
Expand Down
8 changes: 7 additions & 1 deletion libs/sdk-js/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,14 @@ export interface ThreadState<ValuesType = DefaultValues> {
export interface ThreadTask {
id: string;
name: string;
result?: unknown;
error: Optional<string>;
interrupts: Array<{ value: unknown; when: "during" }>;
interrupts: Array<{
value: unknown;
when: "during";
resumable: boolean;
ns?: string[];
}>;
checkpoint: Optional<Checkpoint>;
state: Optional<ThreadState>;
}
Expand Down
Loading