AgentResult
Defined in: src/types/agent.ts:39
Result returned by the agent loop.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AgentResult(data): AgentResult;Defined in: src/types/agent.ts:58
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | { stopReason: StopReason; lastMessage: Message; structuredOutput?: unknown; } |
data.stopReason | StopReason |
data.lastMessage | Message |
data.structuredOutput? | unknown |
Returns
Section titled “Returns”AgentResult
Properties
Section titled “Properties”readonly type: "agentResult";Defined in: src/types/agent.ts:40
stopReason
Section titled “stopReason”readonly stopReason: StopReason;Defined in: src/types/agent.ts:45
The stop reason from the final model response.
lastMessage
Section titled “lastMessage”readonly lastMessage: Message;Defined in: src/types/agent.ts:50
The last message added to the messages array.
structuredOutput?
Section titled “structuredOutput?”readonly optional structuredOutput: unknown;Defined in: src/types/agent.ts:56
The validated structured output from the LLM, if a schema was provided. Type represents any validated Zod schema output.
Methods
Section titled “Methods”toString()
Section titled “toString()”toString(): string;Defined in: src/types/agent.ts:72
Extracts and concatenates all text content from the last message. Includes text from TextBlock and ReasoningBlock content blocks.
Returns
Section titled “Returns”string
The agent’s last message as a string, with multiple blocks joined by newlines.