From 95e834b6b89dd27546aa142fd4f13ecca2c4361f Mon Sep 17 00:00:00 2001 From: Yang Yang Date: Tue, 15 Oct 2024 15:23:30 +0800 Subject: [PATCH 1/2] fix example in docs of state_schema in create_react_agent --- libs/langgraph/langgraph/prebuilt/chat_agent_executor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py b/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py index 5f739c0a6..f6d271174 100644 --- a/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py @@ -349,6 +349,8 @@ class Agent,Tools otherClass ```pycon >>> from typing import TypedDict + >>> + >>> from langgraph.managed import IsLastStep >>> prompt = ChatPromptTemplate.from_messages( ... [ ... ("system", "Today is {today}"), @@ -359,7 +361,7 @@ class Agent,Tools otherClass >>> class CustomState(TypedDict): ... today: str ... messages: Annotated[list[BaseMessage], add_messages] - ... is_last_step: str + ... is_last_step: IsLastStep >>> >>> graph = create_react_agent(model, tools, state_schema=CustomState, state_modifier=prompt) >>> inputs = {"messages": [("user", "What's today's date? And what's the weather in SF?")], "today": "July 16, 2004"} From cf18bfd9c6e2b133185efceeeda50bd01bf7f0ee Mon Sep 17 00:00:00 2001 From: vbarda Date: Wed, 18 Dec 2024 10:05:55 -0500 Subject: [PATCH 2/2] lint --- libs/langgraph/langgraph/prebuilt/chat_agent_executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py b/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py index f6d271174..ed30e4241 100644 --- a/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py @@ -349,7 +349,7 @@ class Agent,Tools otherClass ```pycon >>> from typing import TypedDict - >>> + >>> >>> from langgraph.managed import IsLastStep >>> prompt = ChatPromptTemplate.from_messages( ... [