computeruse

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package agent provides the ComputerUse orchestrator — a screenshot→analyze→act→verify loop that lets the agent control the desktop GUI. It calls the LLM directly (bypassing the provider.Message type, which doesn't support multimodal image inputs) to analyze screenshots and decide the next action.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputerAction

type ComputerAction struct {
	Action  string `json:"action"` // click | double-click | right-click | type | key | scroll | wait | done | fail
	X       int    `json:"x,omitempty"`
	Y       int    `json:"y,omitempty"`
	Text    string `json:"text,omitempty"`
	Key     string `json:"key,omitempty"`     // Enter, Tab, Escape, etc.
	Clicks  int    `json:"clicks,omitempty"`  // scroll: positive=down, negative=up
	MS      int    `json:"ms,omitempty"`      // wait: milliseconds to wait
	Summary string `json:"summary,omitempty"` // done/fail
	Reason  string `json:"reason,omitempty"`  // fail
}

ComputerAction is a structured action the LLM returns during the computer-use loop.

type ComputerUse

type ComputerUse struct {
	// contains filtered or unexported fields
}

ComputerUse runs a visual desktop-automation loop: screenshot → LLM analysis → execute action → verify → repeat. It makes direct HTTP calls to the OpenAI-compatible provider so it can send base64-encoded screenshot images (the standard Message type only supports plain text).

func NewComputerUse

func NewComputerUse(apiKey, baseURL, model string) *ComputerUse

NewComputerUse creates a ComputerUse loop driver.

func (*ComputerUse) RunGoal

func (cu *ComputerUse) RunGoal(ctx context.Context, goal string) (string, error)

RunGoal executes one computer-use goal: screenshot → analyze → act → verify loop. It returns a summary of what was accomplished.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL