From 6342cd16653fede5dc024c70dd690d1fdfa9ae0d Mon Sep 17 00:00:00 2001 From: ArrayPD Date: Thu, 13 Mar 2025 15:32:25 -0400 Subject: [PATCH] prebuilt: fix typo and simplify functions of examples in chat_agent_executor.py. (#3827) **Description:** Fix typo and simplify functions of examples. **Issue:** N/A **Dependencies:** N/A **Dependencies:** N/A Co-authored-by: Eugene Yurtsev --- libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py index 405a18d2f..2bff40fc4 100644 --- a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py @@ -382,12 +382,11 @@ def create_react_agent( Use with a simple tool: ```pycon - >>> from datetime import datetime >>> from langchain_openai import ChatOpenAI >>> from langgraph.prebuilt import create_react_agent - ... def check_weather(location: str, at_time: datetime | None = None) -> str: + ... def check_weather(location: str) -> str: ... '''Return the weather forecast for the specified location.''' ... return f"It's always sunny in {location}" >>> @@ -595,7 +594,7 @@ def create_react_agent( ```pycon >>> import time - ... def check_weather(location: str, at_time: datetime | None = None) -> float: + ... def check_weather(location: str) -> str: ... '''Return the weather forecast for the specified location.''' ... time.sleep(2) ... return f"It's always sunny in {location}"