RunResult
The result of an agent run.
Extends
Section titled “Extends”RunResultBase
<TContext
,TAgent
>
Type Parameters
Section titled “Type Parameters”Type Parameter |
---|
|
|
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RunResult<TContext, TAgent>(state): RunResult<TContext, TAgent>
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
|
|
Returns
Section titled “Returns”RunResult
<TContext
, TAgent
>
Overrides
Section titled “Overrides”RunResultBase<TContext, TAgent>.constructor
Properties
Section titled “Properties”readonly state: RunState<TContext, TAgent>;
The state of the run.
Inherited from
Section titled “Inherited from”RunResultBase.state
Accessors
Section titled “Accessors”finalOutput
Section titled “finalOutput”Get Signature
Section titled “Get Signature”get finalOutput(): undefined | ResolvedAgentOutput<TAgent["outputType"]>
The final output of the agent. If the output type was set to anything other than text
,
this will be parsed either as JSON or using the Zod schema you provided.
Returns
Section titled “Returns”undefined
| ResolvedAgentOutput
<TAgent
["outputType"
]>
Inherited from
Section titled “Inherited from”RunResultBase.finalOutput
history
Section titled “history”Get Signature
Section titled “Get Signature”get history(): AgentInputItem[]
The history of the agent run. This includes the input items and the new items generated during the agent run.
This can be used as inputs for the next agent run.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”RunResultBase.history
Get Signature
Section titled “Get Signature”get input(): | string | AgentInputItem[]
A copy of the original input items.
Returns
Section titled “Returns”| string
| AgentInputItem
[]
Inherited from
Section titled “Inherited from”RunResultBase.input
inputGuardrailResults
Section titled “inputGuardrailResults”Get Signature
Section titled “Get Signature”get inputGuardrailResults(): InputGuardrailResult[]
Guardrail results for the input messages.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”RunResultBase.inputGuardrailResults
interruptions
Section titled “interruptions”Get Signature
Section titled “Get Signature”get interruptions(): RunToolApprovalItem[]
Any interruptions that occurred during the agent run for example for tool approvals.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”RunResultBase.interruptions
lastAgent
Section titled “lastAgent”Get Signature
Section titled “Get Signature”get lastAgent(): undefined | TAgent
The last agent that was run
Returns
Section titled “Returns”undefined
| TAgent
Inherited from
Section titled “Inherited from”RunResultBase.lastAgent
lastResponseId
Section titled “lastResponseId”Get Signature
Section titled “Get Signature”get lastResponseId(): undefined | string
The last response ID generated by the model during the agent run.
Returns
Section titled “Returns”undefined
| string
Inherited from
Section titled “Inherited from”RunResultBase.lastResponseId
newItems
Section titled “newItems”Get Signature
Section titled “Get Signature”get newItems(): RunItem[]
The run items generated during the agent run. This associates the model data with the agents.
For the model data that can be used as inputs for the next agent run, use the output
property.
Returns
Section titled “Returns”RunItem
[]
Inherited from
Section titled “Inherited from”RunResultBase.newItems
output
Section titled “output”Get Signature
Section titled “Get Signature”get output(): AgentOutputItem[]
The new items generated during the agent run. These include things like new messages, tool calls and their outputs, etc.
It does not include information about the agents and instead represents the model data.
For the output including the agents, use the newItems
property.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”RunResultBase.output
outputGuardrailResults
Section titled “outputGuardrailResults”Get Signature
Section titled “Get Signature”get outputGuardrailResults(): OutputGuardrailResult<OutputGuardrailMetadata, "text">[]
Guardrail results for the final output of the agent.
Returns
Section titled “Returns”OutputGuardrailResult
<OutputGuardrailMetadata
, "text"
>[]
Inherited from
Section titled “Inherited from”RunResultBase.outputGuardrailResults
rawResponses
Section titled “rawResponses”Get Signature
Section titled “Get Signature”get rawResponses(): ModelResponse[]
The raw LLM responses generated by the model during the agent run.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”RunResultBase.rawResponses