diff --git a/docs/docs/how-tos/create-react-agent-memory.ipynb b/docs/docs/how-tos/create-react-agent-memory.ipynb index b109db3a0..2c19130a9 100644 --- a/docs/docs/how-tos/create-react-agent-memory.ipynb +++ b/docs/docs/how-tos/create-react-agent-memory.ipynb @@ -122,20 +122,18 @@ "\n", "# For this tutorial we will use custom tool that returns pre-defined values for weather in two cities (NYC & SF)\n", "\n", - "from typing import Literal\n", - "\n", "from langchain_core.tools import tool\n", "\n", "\n", "@tool\n", - "def get_weather(city: Literal[\"nyc\", \"sf\"]):\n", + "def get_weather(location: str) -> str:\n", " \"\"\"Use this to get weather information.\"\"\"\n", - " if city == \"nyc\":\n", + " if any([city in location.lower() for city in [\"nyc\", \"new york city\"]]):\n", " return \"It might be cloudy in nyc\"\n", - " elif city == \"sf\":\n", + " elif any([city in location.lower() for city in [\"sf\", \"san francisco\"]]):\n", " return \"It's always sunny in sf\"\n", " else:\n", - " raise AssertionError(\"Unknown city\")\n", + " return f\"I am not sure what the weather is in {location}\"\n", "\n", "\n", "tools = [get_weather]\n",