computeruse

package
v2.36.3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClickAction

func ClickAction(button string) (string, bool)

ComputerUseClickAction maps an OpenAI computer-use click button to a Coder desktop action name.

func DoubleClickAction

func DoubleClickAction(button string) (string, bool)

DoubleClickAction maps an OpenAI computer-use double-click button to a Coder desktop action name. The desktop API currently supports only left-button double-clicks.

func IsTool

func IsTool(tool fantasy.Tool) bool

IsComputerUseTool reports whether tool is the OpenAI provider-defined computer-use tool.

func NormalizeKeys

func NormalizeKeys(keys []string) (string, error)

NormalizeComputerUseKeys maps OpenAI keypress tokens to Coder desktop key action tokens.

func ParseInput

func ParseInput(input string) (*fantasyopenai.ComputerUseInput, error)

ParseInput parses an OpenAI computer-use tool call input.

func ResultProviderMetadata

func ResultProviderMetadata(response fantasy.ToolResponse) fantasy.ProviderMetadata

ComputerUseResultProviderMetadata returns metadata that should accompany an OpenAI computer-use screenshot result.

func Tool

func Tool() fantasy.Tool

ComputerUseTool returns the OpenAI provider-defined computer-use tool.

Types

type DesktopAction

type DesktopAction struct {
	Action                workspacesdk.DesktopAction
	WaitDurationMillis    int64
	ReleaseMouseOnFailure bool
	ReleaseKeysOnFailure  []string
}

ComputerUseDesktopAction is a Coder desktop operation requested by an OpenAI computer-use tool call.

func DesktopActions

func DesktopActions(
	parsed *fantasyopenai.ComputerUseInput,
	declaredWidth, declaredHeight int,
) ([]DesktopAction, error)

ComputerUseDesktopActions converts an OpenAI computer-use tool call into Coder desktop actions. A caller should execute the returned actions in order, wait for WaitDurationMillis entries, and then return a final screenshot.

Jump to

Keyboard shortcuts

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