From 7883ceae6434056680d450d327573d3a3f7ff986 Mon Sep 17 00:00:00 2001 From: Andrew Nguonly Date: Tue, 8 Oct 2024 13:49:27 -0700 Subject: [PATCH] sdk-py: Add `Sequence[dict]` type to `values` param type for `update_state()` (#2054) ### Summary The LangGraph API supports a list of `dict` for the `values` field for the `POST /threads//state` endpoint. Reference: https://github.com/langchain-ai/langgraph-api/blob/main/api/openapi.json#L3005-L3021 --- libs/sdk-py/langgraph_sdk/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/sdk-py/langgraph_sdk/client.py b/libs/sdk-py/langgraph_sdk/client.py index e332a35d9..f89a0f6a5 100644 --- a/libs/sdk-py/langgraph_sdk/client.py +++ b/libs/sdk-py/langgraph_sdk/client.py @@ -1057,7 +1057,7 @@ async def get_state( async def update_state( self, thread_id: str, - values: dict, + values: Optional[Union[dict, Sequence[dict]]], *, as_node: Optional[str] = None, checkpoint: Optional[Checkpoint] = None, @@ -3118,7 +3118,7 @@ def get_state( def update_state( self, thread_id: str, - values: dict, + values: Optional[Union[dict, Sequence[dict]]], *, as_node: Optional[str] = None, checkpoint: Optional[Checkpoint] = None,