ov.agents.operator#
The Operator agent — the model-bound perceive→decide→act→record loop.
In Phases 1–3 the host plays the operator, following the ov-operate skill: it
reads affordances, decides the next action, and records intent. Phase 4 packages that
loop as a runnable agent. The deterministic “hands” (observe / act /
make_step / journal / progress) are reused unchanged; the only thing the
agent adds is the decide step — and that is injected (decider), so:
the package never hard-depends on an LLM (the host, a script, or a model can all supply
decide); andthe loop is unit-testable with a trivial decider and fake
observe/actcallables — no browser, no API call.
The agent satisfies the aw.AgenticStep protocol structurally
(execute(input_data, context) -> (artifact, info)), so it drops into an aw
workflow (see ov.agents.orchestrator). Its artifact is the populated
CaptureRun; the model-free progress() facts are
the deterministic stop signal a budget-bound manager interprets.
Module Attributes
A decider maps the current observation (+ goal + history) to the next action, or |
Functions
|
Classes
|
Drive a target toward a goal, recording every step (an |
- ov.agents.operator.Decider#
A decider maps the current observation (+ goal + history) to the next action, or
Noneto stop. The model’s only job in the loop.
- class ov.agents.operator.OperatorAgent(decider, session=None, max_steps=12, strategy='ax_snapshot', polite_rate_s=0.0, no_progress_steps=3, observe_fn=None, act_fn=None, model='haiku', name='operator')[source]#
Bases:
objectDrive a target toward a goal, recording every step (an
aw.AgenticStep).- Parameters:
decider (
Callable[...,Optional[Action]]) –(observation, *, goal, history) -> Action | None. Returns the next action, orNoneto stop. Usemake_llm_decider()for a model-backed one, or any callable (host / script / test stub).session (
Any) – aCaptureSession(supplies.page+.run). Optional —pageandrunmay instead arrive via thecontextpassed toexecute()(keys"page"/"run").max_steps (
int) – hard cap on actions (a budget; the deterministic loop signal is advisory, the cap is the backstop).strategy (
str) – perception strategy for the defaultobserve("ax_snapshot"|"screenshot"|"hybrid").act_fn (
Optional[Callable[[Any,Action],Any]]) – injection seams for the hands (default to the realobserve()/act()); tests pass fakes.
- ov.agents.operator.make_llm_decider(llm=None, *, instruction=None)[source]#
A model-backed
Deciderthat picks the nextAction.Uses the injected
llmthroughov.agents.llm.structured()to choose an action conforming toAction’s schema. ReturnsNone(stop) when no LLM is resolvable, on a parse miss, or when the model signals a stop — so an operator built with this decider degrades safely to a no-op rather than crashing.