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”activeAgent
Section titled “activeAgent”Get Signature
Section titled “Get Signature”get activeAgent(): TAgent | undefined;The agent that should handle the next turn. This is an alias for the last agent that completed a turn.
Returns
Section titled “Returns”TAgent | undefined
Inherited from
Section titled “Inherited from”RunResultBase.activeAgent
agentToolInvocation
Section titled “agentToolInvocation”Get Signature
Section titled “Get Signature”get agentToolInvocation(): | Readonly<{ toolArguments?: string; toolCallId?: string; toolName: string;}> | undefined;Metadata about the nested Agent.asTool() invocation that produced this result, when applicable.
Returns
Section titled “Returns”| Readonly<{
toolArguments?: string;
toolCallId?: string;
toolName: string;
}>
| undefined
Inherited from
Section titled “Inherited from”RunResultBase.agentToolInvocation
finalOutput
Section titled “finalOutput”Get Signature
Section titled “Get Signature”get finalOutput(): ResolvedAgentOutput<TAgent["outputType"]> | undefined;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 validation schema you provided.
Returns
Section titled “Returns”ResolvedAgentOutput<TAgent["outputType"]> | undefined
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(): TAgent | undefined;The last agent that was run
Returns
Section titled “Returns”TAgent | undefined
Inherited from
Section titled “Inherited from”RunResultBase.lastAgent
lastResponseId
Section titled “lastResponseId”Get Signature
Section titled “Get Signature”get lastResponseId(): string | undefined;The last response ID generated by the model during the agent run.
Returns
Section titled “Returns”string | undefined
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
runContext
Section titled “runContext”Get Signature
Section titled “Get Signature”get runContext(): RunContext<TContext>;The public run context for this run.
Returns
Section titled “Returns”RunContext<TContext>
Inherited from
Section titled “Inherited from”RunResultBase.runContext
toolInputGuardrailResults
Section titled “toolInputGuardrailResults”Get Signature
Section titled “Get Signature”get toolInputGuardrailResults(): ToolInputGuardrailResult[];Guardrail results for tool inputs.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”RunResultBase.toolInputGuardrailResults
toolOutputGuardrailResults
Section titled “toolOutputGuardrailResults”Get Signature
Section titled “Get Signature”get toolOutputGuardrailResults(): ToolOutputGuardrailResult[];Guardrail results for tool outputs.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”RunResultBase.toolOutputGuardrailResults