Entry points
Agent methods
Stream consumers
Definition options
AgentDefinition includes:
idmodelormodelspresetinstructionstoolsmaxStepsandstopWhenmodelRetryandtoolExecutiontemperature,maxOutputTokens, andtopPparseOutputandoutputSchemarequireApprovalandhumanReview
Run and continuation options
AgentRunOptions supplies input, the model client, application context, optional overrides, cancellation, lifecycle hooks, DevTools, and an application-owned state accessor.
AgentContinueOptions additionally accepts:
- a prior
runorrunId humanInput- approvals and rejections by exact tool-call ID
- externally produced
toolOutputs
Result records
AgentRunResult contains:
run: durable run status, context, pause details, and stop reasonsteps: persisted model/tool step recordsstepResults: normalized step results when availableusage: cumulative tokens and reported costoutput: parsed final outputmessages: the complete conversation used by the loopitems: ordered typed messages, reasoning, tool activity, errors, and final output
Error types
AgentGatewayErrordescribes gateway or upstream request failures.AgentSchemaValidationErrordescribes invalid tool, progress, or final-output data.