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 <eyurtsev@gmail.com>
This commit is contained in:
ArrayPD
2025-03-13 15:32:25 -04:00
committed by GitHub
co-authored by Eugene Yurtsev
parent baedf91836
commit 6342cd1665
@@ -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}"