Skip to main content

Module agent

Module agent 

Source
Expand description

agent_step: the questions a browser agent asks for one step, built from the page’s element table the way jev-ultrafast’s choose builds them (jev_ultrafast/model.py, MIT, Browser Use). One operation head picks CLICK, TYPE_TEXT, SELECT, a page control such as SCROLL_DOWN, DONE or BLOCKED, and each operation with candidates gets a <op>_target head over the element indexes, so one request answers both what to do and where. AgentStep::decide checks the answers as jev-ultrafast’s validate_choice does and maps them back to the action to run.

The snapshot is what jev-ultrafast’s snapshot.js returns: url, title, text and actions, where an action has id, kind (click, fill, select, or anything else for a page control), and for elements node, label, role and value. The body is the same one jev-ultrafast sends, key for key and in the same order, so answers can be compared with Jev’s.

Structs§

AgentStep
The questions for one step and what is needed to read the answers.
Decision
The action an answer picked.
Invalid
An answer jev-ultrafast would refuse to act on.

Constants§

HISTORY
How many past actions go into the state.
NEXT_ACTION
jev-ultrafast’s rules for the operation head.
TARGET
jev-ultrafast’s rules for a target head, added to NEXT_ACTION.

Functions§

agent_step
Builds the questions for one step from a snapshot, the goal and the actions taken so far.