AgentRunResult
AgentRunResult<
Tools,TOutput> =object
Defined in: packages/core/src/agent/types.ts:197
Result of one agent.run / agent.stream turn (possibly several model requests).
text / output: the final model response. Intermediate tool-call requests
are in messages / newMessages and as agent_tool_call / agent_tool_result
events — not in text. A tool whose execute returns an AsyncIterable (streaming
progress, e.g. a long-running shell command) emits an agent_tool_result per yielded
value plus one more (see that event’s own doc comment), each preliminary: true except
the last — none of the preliminary ones reach messages / newMessages or the model
itself, only the final one does.
output: typed payload from AgentDefinition.outputSchema
(or a per-call override). When no schema is set, this is the same string as text.
Type Parameters
Section titled “Type Parameters”Tools extends ToolSet = ToolSet
TOutput
Section titled “TOutput”TOutput = string
Properties
Section titled “Properties”memoryScope
Section titled “memoryScope”memoryScope:
string
Defined in: packages/core/src/agent/types.ts:206
Scope this episode persisted to (caller-supplied or a generated id).
messages
Section titled “messages”messages:
ModelMessage[]
Defined in: packages/core/src/agent/types.ts:200
newMessages
Section titled “newMessages”newMessages:
ModelMessage[]
Defined in: packages/core/src/agent/types.ts:202
All model/tool messages appended during this turn (every request).
output
Section titled “output”output:
TOutput
Defined in: packages/core/src/agent/types.ts:199
sdk:
StreamTextResult<Tools,TOutput>
Defined in: packages/core/src/agent/types.ts:208
Raw AI SDK stream result for this episode.
text:
string
Defined in: packages/core/src/agent/types.ts:198
turns:
number
Defined in: packages/core/src/agent/types.ts:204
Number of AI SDK steps (model requests) made during this turn.