Compare commits

...
1 Commits
Author SHA1 Message Date
William Fu-Hinthorn 39891526ca Handle edge case 2025-03-31 06:31:50 -07:00
@@ -772,6 +772,8 @@ def create_react_agent(
# Define the function that determines whether to continue or not
def should_continue(state: StateSchema) -> Union[str, list]:
messages = _get_state_value(state, "messages")
if not messages:
return END
last_message = messages[-1]
# If there is no function call, then we finish
if not isinstance(last_message, AIMessage) or not last_message.tool_calls: