跳转到内容

ComputerTool

此内容尚不支持你的语言。

type ComputerTool<Context, TComputer> = object;

Exposes a computer to the model as a tool to be called

Result

The result of the tool

Type Parameter Default type Description

Context

UnknownContext

The context of the tool

TComputer extends Computer

Computer

‐

computer: ComputerConfig<Context, TComputer>;

The computer to use.


optional customDataExtractor?: ComputerToolCustomDataExtractor<Context, TComputer>;

Optional callback that attaches SDK-only custom data to the emitted tool output item.


name: "computer_use_preview" | string & object;

The name of the tool.


needsApproval: ComputerApprovalFunction;

Predicate determining whether this computer action requires approval.


optional onSafetyCheck?: ComputerOnSafetyCheckFunction;

Optional handler invoked before execution when the model reports pending safety checks. If omitted, the checks remain unacknowledged and execution continues with a warning. Return false to reject the call, or true to acknowledge all checks. Returning void allows execution without acknowledgment.


type: "computer";