Skip to main content

last_stop_reason

Method
This is a method of the Agent class in the agent module.
Structured reason the last tool-execution loop stopped. One of "completed" (task finished), "max_steps" (the unified step budget from ExecutionConfig.max_steps was reached and the run was truncated) or "error". Lets CLI/CI callers branch on truncation instead of parsing a magic string. Reads from whichever backend (OpenAI-native or LiteLLM) executed the last turn.

Signature

Returns

str
The result of the operation.

Source

View on GitHub

praisonaiagents/agent/agent.py at line 3228