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 you passed to the Runner.run() method.
usage: Usage;The usage of the agent run so far. For streamed responses, the usage will be updated in real-time
Methods
Section titled “Methods”approveTool()
Section titled “approveTool()”approveTool(approvalItem, options): void;Approve a tool call.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
The tool approval item to approve. |
|
|
|
{ |
Additional approval behavior options. |
|
|
|
‐ |
Returns
Section titled “Returns”void
isToolApproved()
Section titled “isToolApproved()”isToolApproved(approval): boolean | undefined;Check if a tool call has been approved.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
{ |
Details about the tool call being evaluated. |
|
|
|
‐ |
|
|
|
‐ |
Returns
Section titled “Returns”boolean | undefined
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;