Documentation
¶
Index ¶
- func RegisterAction[T, D any](r *Registry, name string, description string, function ActionFunc[T, D]) error
- type Action
- type ActionFunc
- type ActionResult
- type Controller
- func (c *Controller) ExecuteAction(ctx context.Context, action map[string]any, driver *appiumgo.WebDriver, ...) (*ActionResult, error)
- func (c *Controller) LaunchApp(ctx context.Context, params LaunchAppAction) (*ActionResult, error)
- func (c *Controller) PressKeyCode(ctx context.Context, params PressKeyCodeAction) (*ActionResult, error)
- func (c *Controller) Registry() *Registry
- func (c *Controller) Swipe(ctx context.Context, params SwipeAction) (*ActionResult, error)
- func (c *Controller) TapByCoordinates(ctx context.Context, params TapByCoordinatesAction) (*ActionResult, error)
- type LaunchAppAction
- type PressKeyCodeAction
- type Registry
- type ScreenshotAction
- type SwipeAction
- type TapByCoordinatesAction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAction ¶
func RegisterAction[T, D any]( r *Registry, name string, description string, function ActionFunc[T, D], ) error
Action registers a new action into the registry. should be called after registry initialization registry.Action("click_element_by_index", ClickElementFunc, "click action", paramModel, domains, pageFilter)
Types ¶
type ActionFunc ¶
type ActionResult ¶
type ActionResult struct {
IsDone *bool `json:"is_done,omitempty"`
Success *bool `json:"success,omitempty"`
ExtractedContent *string `json:"extracted_content,omitempty"`
Error *string `json:"error,omitempty"`
IncludeInMemory bool `json:"include_in_memory"`
}
func NewActionResult ¶
func NewActionResult() *ActionResult
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(driver *appiumgo.WebDriver) *Controller
func (*Controller) ExecuteAction ¶
func (c *Controller) ExecuteAction( ctx context.Context, action map[string]any, driver *appiumgo.WebDriver, model *llm.Instance, sensitiveData map[string]string, availableFilePaths []string, ) (*ActionResult, error)
ExecuteAction TODO
func (*Controller) LaunchApp ¶
func (c *Controller) LaunchApp(ctx context.Context, params LaunchAppAction) (*ActionResult, error)
func (*Controller) PressKeyCode ¶
func (c *Controller) PressKeyCode(ctx context.Context, params PressKeyCodeAction) (*ActionResult, error)
func (*Controller) Registry ¶
func (c *Controller) Registry() *Registry
func (*Controller) Swipe ¶
func (c *Controller) Swipe(ctx context.Context, params SwipeAction) (*ActionResult, error)
func (*Controller) TapByCoordinates ¶
func (c *Controller) TapByCoordinates(ctx context.Context, params TapByCoordinatesAction) (*ActionResult, error)
type LaunchAppAction ¶
type PressKeyCodeAction ¶
type PressKeyCodeAction struct {
KeyCode int `json:"key_code"` // keycode: Android keycode to press(// Common keycodes:\n - 3: HOME\n - 4: BACK\n - 24: VOLUME UP\n - 25: VOLUME DOWN\n - 26: POWER\n - 82: MENU)
}
type Registry ¶
The main service class that manages action registration and execution
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) AvailableActions ¶
type ScreenshotAction ¶
type ScreenshotAction struct {
Path string `json:"path"`
}
type SwipeAction ¶
type TapByCoordinatesAction ¶
type TapByCoordinatesAction struct {
X int `json:"x" jsonschema:"description=the percentage of the screen width from the left,required"`
Y int `json:"y" jsonschema:"description=the percentage of the screen height from the top,required"`
Duration int `json:"duration" jsonschema:"description=duration of the tap,required"`
}
Click to show internal directories.
Click to hide internal directories.