RunContext
A context object that is passed to the Runner.run()
method.
Type Parameters
Section titled “Type Parameters”Type Parameter | Default type |
---|---|
|
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RunContext<TContext>(context?): RunContext<TContext>
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
|
|
Returns
Section titled “Returns”RunContext
<TContext
>
Properties
Section titled “Properties”context
Section titled “context”context: TContext;
The context object passed by you to the Runner.run()
usage: Usage;
The usage of the agent run so far. For streamed responses, the usage will be stale until the last chunk of the stream is processed.
Methods
Section titled “Methods”approveTool()
Section titled “approveTool()”approveTool(approvalItem, callId?): void
Approve a tool call.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
|
‐ |
|
|
{ |
The call ID of the tool call. |
|
|
‐ |
Returns
Section titled “Returns”void
isToolApproved()
Section titled “isToolApproved()”isToolApproved(__namedParameters): undefined | boolean
Check if a tool call has been approved.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
|
{ |
|
|
|
|
Returns
Section titled “Returns”undefined
| boolean
true
if the tool call has been approved, false
if blocked and undefined
if not yet approved or rejected.
rejectTool()
Section titled “rejectTool()”rejectTool(approvalItem, __namedParameters?): void
Reject a tool call.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
|
The tool approval item to reject. |
|
|
{ |
‐ |
|
|
‐ |
Returns
Section titled “Returns”void
toJSON()
Section titled “toJSON()”toJSON(): object
Returns
Section titled “Returns”object
approvals
Section titled “approvals”approvals: Record<string, ApprovalRecord>;
context
Section titled “context”context: any;
usage: Usage;