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), a provider block/refusal/truncation
("content_filtered" | "refused" | "length_truncated") derived from the
LLM finish_reason/refusal signal, or "error". Lets CLI/CI callers
branch on the terminal reason 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 3771
