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

Align typing with JS:


https://github.com/langchain-ai/langgraphjs/blob/main/libs/langgraph/src/constants.ts#L226
This commit is contained in:
David Duong
2025-01-01 15:55:58 +01:00
committed by GitHub
4 changed files with 15 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@langchain/langgraph-sdk",
"version": "0.0.32",
"version": "0.0.33",
"description": "Client library for interacting with the LangGraph API",
"type": "module",
"packageManager": "yarn@1.22.19",
+1 -1
View File
@@ -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.
+12 -2
View File
@@ -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."""
@@ -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
+1 -1
View File
@@ -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"