Skip to content

Commit

Permalink
python[patch]: call create_react_agent model node without is_last_step (
Browse files Browse the repository at this point in the history
#3114)

So that you can call agent.nodes['agent'].invoke({'messages': []})
without needing to specify is_last_step. very helpful for evaluating
just the model node of the agent
  • Loading branch information
baskaryan authored Jan 21, 2025
1 parent 6cbc7e8 commit 6087b19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libs/langgraph/langgraph/prebuilt/chat_agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def call_model(state: AgentState, config: RunnableConfig) -> AgentState:
if (
(
"remaining_steps" not in state
and state["is_last_step"]
and state.get("is_last_step", False)
and has_tool_calls
)
or (
Expand Down Expand Up @@ -672,7 +672,7 @@ async def acall_model(state: AgentState, config: RunnableConfig) -> AgentState:
if (
(
"remaining_steps" not in state
and state["is_last_step"]
and state.get("is_last_step", False)
and has_tool_calls
)
or (
Expand Down
2 changes: 1 addition & 1 deletion libs/langgraph/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langgraph"
version = "0.2.64"
version = "0.2.65"
description = "Building stateful, multi-actor applications with LLMs"
authors = []
license = "MIT"
Expand Down

0 comments on commit 6087b19

Please sign in to comment.