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

fix(sdk): Fix SDK Command.update type #2901

Merged
merged 4 commits into from
Jan 1, 2025
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: 62.0 ms +- 2.0 ms ......................................... fanout_to_subgraph_10x_sync: Mean +- std dev: 52.9 ms +- 0.9 ms ......................................... fanout_to_subgraph_10x_checkpoint: Mean +- std dev: 76.0 ms +- 1.8 ms ......................................... fanout_to_subgraph_10x_checkpoint_sync: Mean +- std dev: 96.5 ms +- 1.3 ms ......................................... fanout_to_subgraph_100x: Mean +- std dev: 671 ms +- 33 ms ......................................... fanout_to_subgraph_100x_sync: Mean +- std dev: 521 ms +- 12 ms ......................................... fanout_to_subgraph_100x_checkpoint: Mean +- std dev: 826 ms +- 22 ms ......................................... fanout_to_subgraph_100x_checkpoint_sync: Mean +- std dev: 985 ms +- 27 ms ......................................... react_agent_10x: Mean +- std dev: 30.7 ms +- 0.6 ms ......................................... react_agent_10x_sync: Mean +- std dev: 22.8 ms +- 0.3 ms ......................................... react_agent_10x_checkpoint: Mean +- std dev: 37.7 ms +- 0.7 ms ......................................... react_agent_10x_checkpoint_sync: Mean +- std dev: 36.9 ms +- 0.4 ms ......................................... react_agent_100x: Mean +- std dev: 339 ms +- 6 ms ......................................... react_agent_100x_sync: Mean +- std dev: 274 ms +- 2 ms ......................................... react_agent_100x_checkpoint: Mean +- std dev: 846 ms +- 9 ms ......................................... react_agent_100x_checkpoint_sync: Mean +- std dev: 852 ms +- 14 ms ......................................... wide_state_25x300: Mean +- std dev: 22.8 ms +- 0.6 ms ......................................... wide_state_25x300_sync: Mean +- std dev: 14.8 ms +- 0.2 ms ......................................... wide_state_25x300_checkpoint: Mean +- std dev: 276 ms +- 13 ms ......................................... wide_state_25x300_checkpoint_sync: Mean +- std dev: 275 ms +- 14 ms ......................................... wide_state_15x600: Mean +- std dev: 26.6 ms +- 0.5 ms ......................................... wide_state_15x600_sync: Mean +- std dev: 17.2 ms +- 0.2 ms ......................................... wide_state_15x600_checkpoint: Mean +- std dev: 477 ms +- 21 ms ......................................... wide_state_15x600_checkpoint_sync: Mean +- std dev: 475 ms +- 15 ms ......................................... wide_state_9x1200: Mean +- std dev: 26.6 ms +- 0.5 ms ......................................... wide_state_9x1200_sync: Mean +- std dev: 17.2 ms +- 0.2 ms ......................................... wide_state_9x1200_checkpoint: Mean +- std dev: 312 ms +- 19 ms ......................................... wide_state_9x1200_checkpoint_sync: Mean +- std dev: 308 ms +- 14 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 | +=========================================+=========+=======================+ | wide_state_15x600_sync | 17.3 ms | 17.2 ms: 1.01x faster | +-----------------------------------------+---------+-----------------------+ | react_agent_100x_sync | 273 ms | 274 ms: 1.00x slower | +-----------------------------------------+---------+-----------------------+ | wide_state_9x1200_sync | 17.1 ms | 17.2 ms: 1.01x slower | +-----------------------------------------+---------+-----------------------+ | react_agent_10x_sync | 22.7 ms | 22.8 ms: 1.01x slower | +-----------------------------------------+---------+-----------------------+ | react_agent_10x | 30.5 ms | 30.7 ms: 1.01x slower | +-----------------------------------------+---------+-----------------------+ | react_agent_10x_checkpoint_sync | 36.5 ms | 36.9 ms: 1.01x slower | +-----------------------------------------+---------+-----------------------+ | react_agent_100x | 335 ms | 339 ms: 1.01x slower | +-----------------------------------------+---------+-----------------------+ | react_agent_100x_checkpoint | 836 ms | 846 ms: 1.01x slower | +-----------------------------------------+---------+-----------------------+ | wide_state_9x1200_checkpoint | 306 ms | 312 ms: 1.02x slower | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_sync | 51.6 ms | 52.9 ms: 1.03x slower | +-----------------------------------------+---------+-----------------------+ | react_agent_100x_checkpoint_sync | 830 ms | 852 ms: 1.03x slower | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x | 60.2 ms | 62.0 ms: 1.03x slower | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_sync | 505 ms | 521 ms: 1.03x slower | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_checkpoint_sync | 93.2 ms | 96.5 ms: 1.04x slower | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_checkpoint | 73.3 ms | 76.0 ms: 1.04x slower | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_checkpoint_sync | 929 ms | 985 ms: 1.06x slower | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_checkpoint | 730 ms | 826 ms: 1.13x slower | +-----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x | 589 ms | 671 ms: 1.14x slower | +-----------------------------------------+---------+-----------------------+ | Geometric mean | (ref) | 1.02x slower | +-----------------------------------------+---------+-----------------------+ Benchmark hidden because not significant (10): react_agent_10x_checkpoint, wide_state_15x600, wide_state_25x300_checkpoint_sync, wide_state_25x300_checkpoint, wide_state_15x600_checkpoint, wide_state_15x600_checkpoint_sync, wide_state_25x300, wide_state_25x300_sync, wide_state_9x1200, wide_state_9x1200_checkpoint_sync
"name": "@langchain/langgraph-sdk",
"version": "0.0.32",
"version": "0.0.33",
"description": "Client library for interacting with the LangGraph API",
"type": "module",
"packageManager": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion libs/sdk-js/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface Command {
/**
* An object to update the thread state with.
*/
update?: Record<string, unknown>;
update?: Record<string, unknown> | [string, unknown][];

/**
* The value to return from an `interrupt` function call.
Expand Down
14 changes: 12 additions & 2 deletions libs/sdk-py/langgraph_sdk/schema.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
"""Data models for interacting with the LangGraph API."""

from datetime import datetime
from typing import Any, Dict, Literal, NamedTuple, Optional, Sequence, TypedDict, Union
from typing import (
Any,
Dict,
Literal,
NamedTuple,
Optional,
Sequence,
Tuple,
TypedDict,
Union,
)

Json = Optional[dict[str, Any]]
"""Represents a JSON-like structure, which can be None or a dictionary with string keys and any values."""
Expand Down Expand Up @@ -374,5 +384,5 @@ class Send(TypedDict):

class Command(TypedDict, total=False):
goto: Union[Send, str, Sequence[Union[Send, str]]]
update: dict[str, Any]
update: Union[dict[str, Any], Sequence[Tuple[str, Any]]]
resume: Any
2 changes: 1 addition & 1 deletion libs/sdk-py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langgraph-sdk"
version = "0.1.48"
version = "0.1.49"
description = "SDK for interacting with LangGraph API"
authors = []
license = "MIT"
Expand Down
Loading