From bcf9ec4a04d6e188344837fbbfb75baabf17dd15 Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Tue, 19 Aug 2025 21:44:15 -0700 Subject: [PATCH 1/9] Update LG version --- pyproject.toml | 2 +- src/react_agent/tools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6e66f7e..3fe2f50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ readme = "README.md" license = { text = "MIT" } requires-python = ">=3.11,<4.0" dependencies = [ - "langgraph>=0.6.0,<0.7.0", + "langgraph>=0.6.6,<0.7.0", "langchain-openai>=0.1.22", "langchain-anthropic>=0.1.23", "langchain>=0.2.14", diff --git a/src/react_agent/tools.py b/src/react_agent/tools.py index 7afd11b..4ce1eb6 100644 --- a/src/react_agent/tools.py +++ b/src/react_agent/tools.py @@ -8,7 +8,7 @@ from typing import Any, Callable, List, Optional, cast -from langchain_tavily import TavilySearch +from langchain_tavily import TavilySearch # type: ignore[import-not-found] from langgraph.runtime import get_runtime from react_agent.context import Context From 88832fe31f62f039e4949bd3132588a4735d8618 Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Fri, 12 Sep 2025 11:53:36 -0700 Subject: [PATCH 2/9] Update to include --- langgraph.json | 1 + 1 file changed, 1 insertion(+) diff --git a/langgraph.json b/langgraph.json index 31264e4..43d1eb1 100644 --- a/langgraph.json +++ b/langgraph.json @@ -1,4 +1,5 @@ { + "$schema": "https://langgra.ph/schema.json", "dependencies": ["."], "graphs": { "agent": "./src/react_agent/graph.py:graph" From 706c656def54873d84d0960dd5ee151a69c3fee4 Mon Sep 17 00:00:00 2001 From: Caspar Broekhuizen Date: Fri, 17 Oct 2025 14:52:49 -0700 Subject: [PATCH 3/9] chore: bump langgraph to v1.0 --- pyproject.toml | 2 +- src/react_agent/context.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3fe2f50..06e5060 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ readme = "README.md" license = { text = "MIT" } requires-python = ">=3.11,<4.0" dependencies = [ - "langgraph>=0.6.6,<0.7.0", + "langgraph>=1.0.0", "langchain-openai>=0.1.22", "langchain-anthropic>=0.1.23", "langchain>=0.2.14", diff --git a/src/react_agent/context.py b/src/react_agent/context.py index 8ccfa75..d691776 100644 --- a/src/react_agent/context.py +++ b/src/react_agent/context.py @@ -22,7 +22,7 @@ class Context: ) model: Annotated[str, {"__template_metadata__": {"kind": "llm"}}] = field( - default="anthropic/claude-3-5-sonnet-20240620", + default="anthropic/claude-4-5", metadata={ "description": "The name of the language model to use for the agent's main interactions. " "Should be in the form: provider/model-name." From ceb1c6fbde607f848bd0b6f6b4c4e2e7185214a2 Mon Sep 17 00:00:00 2001 From: Caspar Broekhuizen Date: Fri, 17 Oct 2025 14:56:40 -0700 Subject: [PATCH 4/9] lint --- src/react_agent/graph.py | 2 +- src/react_agent/tools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/react_agent/graph.py b/src/react_agent/graph.py index 098f51b..9d2ca76 100644 --- a/src/react_agent/graph.py +++ b/src/react_agent/graph.py @@ -42,7 +42,7 @@ async def call_model( ) # Get the model's response - response = cast( + response = cast( # type: ignore[redundant-cast] AIMessage, await model.ainvoke( [{"role": "system", "content": system_message}, *state.messages] diff --git a/src/react_agent/tools.py b/src/react_agent/tools.py index 4ce1eb6..7afd11b 100644 --- a/src/react_agent/tools.py +++ b/src/react_agent/tools.py @@ -8,7 +8,7 @@ from typing import Any, Callable, List, Optional, cast -from langchain_tavily import TavilySearch # type: ignore[import-not-found] +from langchain_tavily import TavilySearch from langgraph.runtime import get_runtime from react_agent.context import Context From e2e26fc98276e78952e3be0fd7e8a53023de1a65 Mon Sep 17 00:00:00 2001 From: Caspar Broekhuizen Date: Fri, 17 Oct 2025 15:20:25 -0700 Subject: [PATCH 5/9] fix: int test --- Makefile | 3 +++ README.md | 2 +- pyproject.toml | 1 + src/react_agent/context.py | 2 +- tests/conftest.py | 7 +++++++ tests/integration_tests/test_graph.py | 5 +++-- 6 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 tests/conftest.py diff --git a/Makefile b/Makefile index e629494..4bfd878 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ TEST_FILE ?= tests/unit_tests/ test: python -m pytest $(TEST_FILE) +integration_tests: + python -m pytest tests/integration_tests + test_watch: python -m ptw --snapshot-update --now . -- -vv tests/unit_tests diff --git a/README.md b/README.md index 6a5d6c2..e869ed1 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ The primary [search tool](./src/react_agent/tools.py) [^1] used is [Tavily](http The defaults values for `model` are shown below: ```yaml -model: anthropic/claude-3-5-sonnet-20240620 +model: claude-sonnet-4-5-20250929 ``` Follow the instructions below to get set up, or pick one of the additional options. diff --git a/pyproject.toml b/pyproject.toml index 06e5060..1e44a90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,6 +62,7 @@ convention = "google" [dependency-groups] dev = [ + "anyio>=4.7.0", "langgraph-cli[inmem]>=0.1.71", "pytest>=8.3.5", ] diff --git a/src/react_agent/context.py b/src/react_agent/context.py index d691776..238ccfd 100644 --- a/src/react_agent/context.py +++ b/src/react_agent/context.py @@ -22,7 +22,7 @@ class Context: ) model: Annotated[str, {"__template_metadata__": {"kind": "llm"}}] = field( - default="anthropic/claude-4-5", + default="anthropic/claude-sonnet-4-5-20250929", metadata={ "description": "The name of the language model to use for the agent's main interactions. " "Should be in the form: provider/model-name." diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..ad84bd0 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,7 @@ +import pytest + + +@pytest.fixture(scope="session") +def anyio_backend(): + return "asyncio" + diff --git a/tests/integration_tests/test_graph.py b/tests/integration_tests/test_graph.py index 8c4ac57..4972454 100644 --- a/tests/integration_tests/test_graph.py +++ b/tests/integration_tests/test_graph.py @@ -4,13 +4,14 @@ from react_agent import graph from react_agent.context import Context +pytestmark = pytest.mark.anyio + -@pytest.mark.asyncio -@unit async def test_react_agent_simple_passthrough() -> None: res = await graph.ainvoke( {"messages": [("user", "Who is the founder of LangChain?")]}, # type: ignore context=Context(system_prompt="You are a helpful AI assistant."), ) + print(res) assert "harrison" in str(res["messages"][-1].content).lower() From 80f68ce3e3f929441d1be11556367cc17ef6bec3 Mon Sep 17 00:00:00 2001 From: Caspar Broekhuizen Date: Fri, 17 Oct 2025 15:21:50 -0700 Subject: [PATCH 6/9] remove print --- tests/integration_tests/test_graph.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integration_tests/test_graph.py b/tests/integration_tests/test_graph.py index 4972454..dbc2652 100644 --- a/tests/integration_tests/test_graph.py +++ b/tests/integration_tests/test_graph.py @@ -12,6 +12,5 @@ async def test_react_agent_simple_passthrough() -> None: {"messages": [("user", "Who is the founder of LangChain?")]}, # type: ignore context=Context(system_prompt="You are a helpful AI assistant."), ) - print(res) assert "harrison" in str(res["messages"][-1].content).lower() From 8c806394cd2495585fb975e3e2bb6899b986112a Mon Sep 17 00:00:00 2001 From: Caspar Broekhuizen Date: Fri, 17 Oct 2025 15:39:44 -0700 Subject: [PATCH 7/9] remove unused import --- tests/integration_tests/test_graph.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integration_tests/test_graph.py b/tests/integration_tests/test_graph.py index dbc2652..a84adc3 100644 --- a/tests/integration_tests/test_graph.py +++ b/tests/integration_tests/test_graph.py @@ -1,5 +1,4 @@ import pytest -from langsmith import unit from react_agent import graph from react_agent.context import Context From f0b8cf200ddbdb158f6de229b0872b32196cf561 Mon Sep 17 00:00:00 2001 From: Caspar Broekhuizen Date: Fri, 17 Oct 2025 17:27:34 -0700 Subject: [PATCH 8/9] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e869ed1..cd666ab 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # LangGraph ReAct Agent Template [![CI](https://github.com/langchain-ai/react-agent/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/langchain-ai/react-agent/actions/workflows/unit-tests.yml) -[![Integration Tests](https://github.com/langchain-ai/react-agent/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/langchain-ai/react-agent/actions/workflows/integration-tests.yml) [![Open in - LangGraph Studio](https://img.shields.io/badge/Open_in-LangGraph_Studio-00324d.svg?logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4NS4zMzMiIGhlaWdodD0iODUuMzMzIiB2ZXJzaW9uPSIxLjAiIHZpZXdCb3g9IjAgMCA2NCA2NCI+PHBhdGggZD0iTTEzIDcuOGMtNi4zIDMuMS03LjEgNi4zLTYuOCAyNS43LjQgMjQuNi4zIDI0LjUgMjUuOSAyNC41QzU3LjUgNTggNTggNTcuNSA1OCAzMi4zIDU4IDcuMyA1Ni43IDYgMzIgNmMtMTIuOCAwLTE2LjEuMy0xOSAxLjhtMzcuNiAxNi42YzIuOCAyLjggMy40IDQuMiAzLjQgNy42cy0uNiA0LjgtMy40IDcuNkw0Ny4yIDQzSDE2LjhsLTMuNC0zLjRjLTQuOC00LjgtNC44LTEwLjQgMC0xNS4ybDMuNC0zLjRoMzAuNHoiLz48cGF0aCBkPSJNMTguOSAyNS42Yy0xLjEgMS4zLTEgMS43LjQgMi41LjkuNiAxLjcgMS44IDEuNyAyLjcgMCAxIC43IDIuOCAxLjYgNC4xIDEuNCAxLjkgMS40IDIuNS4zIDMuMi0xIC42LS42LjkgMS40LjkgMS41IDAgMi43LS41IDIuNy0xIDAtLjYgMS4xLS44IDIuNi0uNGwyLjYuNy0xLjgtMi45Yy01LjktOS4zLTkuNC0xMi4zLTExLjUtOS44TTM5IDI2YzAgMS4xLS45IDIuNS0yIDMuMi0yLjQgMS41LTIuNiAzLjQtLjUgNC4yLjguMyAyIDEuNyAyLjUgMy4xLjYgMS41IDEuNCAyLjMgMiAyIDEuNS0uOSAxLjItMy41LS40LTMuNS0yLjEgMC0yLjgtMi44LS44LTMuMyAxLjYtLjQgMS42LS41IDAtLjYtMS4xLS4xLTEuNS0uNi0xLjItMS42LjctMS43IDMuMy0yLjEgMy41LS41LjEuNS4yIDEuNi4zIDIuMiAwIC43LjkgMS40IDEuOSAxLjYgMi4xLjQgMi4zLTIuMy4yLTMuMi0uOC0uMy0yLTEuNy0yLjUtMy4xLTEuMS0zLTMtMy4zLTMtLjUiLz48L3N2Zz4=)](https://langgraph-studio.vercel.app/templates/open?githubUrl=https://github.com/langchain-ai/react-agent) This template showcases a [ReAct agent](https://arxiv.org/abs/2210.03629) implemented using [LangGraph](https://github.com/langchain-ai/langgraph), designed for [LangGraph Studio](https://github.com/langchain-ai/langgraph-studio). ReAct agents are uncomplicated, prototypical agents that can be flexibly extended to many tools. From 76c9a3eca1d81b450aba9e0e085deb62de78e1fb Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:55:23 -0800 Subject: [PATCH 9/9] Update cli version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1e44a90..1ba46e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,6 @@ convention = "google" [dependency-groups] dev = [ "anyio>=4.7.0", - "langgraph-cli[inmem]>=0.1.71", + "langgraph-cli[inmem]>=0.4.7", "pytest>=8.3.5", ]