Table of Contents

Class ComputerUseCallManager

Manages and executes computer actions that can be called by AI agents.

public class ComputerUseCallManager : ToolCallManager<ComputerUseCall, ComputerUseOutput>, IComputerUseCallExecutor, IToolCallExecutor<ComputerUseCall, ComputerUseOutput>, IComputerUseActionHandler
Inheritance
object
ComputerUseCallManager
Implements
Inherited Members

Fields

onInputEventReceived

public UnityEvent<Event> onInputEventReceived

Field Value

UnityEvent<Event>

onKeyboardTyped

public UnityEvent<string> onKeyboardTyped

Field Value

UnityEvent<string>

Properties

Api

public Api Api { get; set; }

Property Value

Api

ScreenshotPathType

public ScreenshotPathType ScreenshotPathType { get; }

Property Value

ScreenshotPathType

Methods

CanExecute(string)

public bool CanExecute(string toolName)

Parameters

toolName string

Returns

bool

ExecuteAsync(ComputerUseCall, CancellationToken)

public override UniTask<ComputerUseOutput> ExecuteAsync(ComputerUseCall call, CancellationToken ct)

Parameters

call ComputerUseCall
ct CancellationToken

Returns

UniTask<ComputerUseOutput>

OnKeyboardKeysPressedAsync(List<string>, CancellationToken)

public UniTask OnKeyboardKeysPressedAsync(List<string> keys, CancellationToken ct)

Parameters

keys List<string>
ct CancellationToken

Returns

UniTask

OnKeyboardTypedAsync(string, CancellationToken)

public UniTask OnKeyboardTypedAsync(string text, CancellationToken ct)

Parameters

text string
ct CancellationToken

Returns

UniTask

OnMouseClickAsync(MouseButton, Vector2, CancellationToken)

public UniTask OnMouseClickAsync(MouseButton button, Vector2 position, CancellationToken ct)

Parameters

button MouseButton
position Vector2
ct CancellationToken

Returns

UniTask

OnMouseDoubleClickAsync(Vector2, CancellationToken)

public UniTask OnMouseDoubleClickAsync(Vector2 position, CancellationToken ct)

Parameters

position Vector2
ct CancellationToken

Returns

UniTask

OnMouseDragAsync(List<Vector2>, CancellationToken)

public UniTask OnMouseDragAsync(List<Vector2> path, CancellationToken ct)

Parameters

path List<Vector2>
ct CancellationToken

Returns

UniTask

OnMouseMoveAsync(Vector2, CancellationToken)

public UniTask OnMouseMoveAsync(Vector2 position, CancellationToken ct)

Parameters

position Vector2
ct CancellationToken

Returns

UniTask

OnMouseScrollAsync(Vector2, Vector2, CancellationToken)

public UniTask OnMouseScrollAsync(Vector2 position, Vector2 scroll, CancellationToken ct)

Parameters

position Vector2
scroll Vector2
ct CancellationToken

Returns

UniTask

OnTakeScreenshotAsync(CancellationToken)

Takes a screenshot and provides

  • The uploaded file ID if ScreenshotPathType is FileId
  • Your own URL if ScreenshotPathType is Url
public UniTask<string> OnTakeScreenshotAsync(CancellationToken ct)

Parameters

ct CancellationToken

Returns

UniTask<string>

OnWaitAsync(CancellationToken)

public UniTask OnWaitAsync(CancellationToken ct)

Parameters

ct CancellationToken

Returns

UniTask

SetSafetyCheckService(IComputerUseSafetyCheckService)

public void SetSafetyCheckService(IComputerUseSafetyCheckService service)

Parameters

service IComputerUseSafetyCheckService

ValidateCall(ComputerUseCall)

protected override void ValidateCall(ComputerUseCall call)

Parameters

call ComputerUseCall