Skip to content

AgentResult

Defined in: src/types/agent.ts:38

Result returned by the agent loop.

new AgentResult(data): AgentResult;

Defined in: src/types/agent.ts:51

ParameterType
data{ stopReason: StopReason; lastMessage: Message; }
data.stopReasonStopReason
data.lastMessageMessage

AgentResult

readonly type: "agentResult";

Defined in: src/types/agent.ts:39


readonly stopReason: StopReason;

Defined in: src/types/agent.ts:44

The stop reason from the final model response.


readonly lastMessage: Message;

Defined in: src/types/agent.ts:49

The last message added to the messages array.

toString(): string;

Defined in: src/types/agent.ts:62

Extracts and concatenates all text content from the last message. Includes text from TextBlock and ReasoningBlock content blocks.

string

The agent’s last message as a string, with multiple blocks joined by newlines.