diff --git a/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py b/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py index 4c8699360..b5207d167 100644 --- a/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py @@ -382,6 +382,8 @@ def create_react_agent( ```pycon >>> from typing import TypedDict + >>> + >>> from langgraph.managed import IsLastStep >>> prompt = ChatPromptTemplate.from_messages( ... [ ... ("system", "Today is {today}"), @@ -392,7 +394,7 @@ def create_react_agent( >>> 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"}