File size: 3,006 Bytes
e187916 59022ca e187916 59022ca e187916 59022ca e187916 59022ca e187916 59022ca e187916 59022ca e187916 59022ca e187916 59022ca e187916 59022ca e187916 59022ca e187916 59022ca e187916 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | """Tiny Computer Agent - an agentic harness that drives a real computer with a
tiny, fully local model.
The harness is deliberately boring: it owns the loop, the closed action vocabulary,
perception and the safety gates, so the model only ever answers one question -
"which item from this short menu, and which verb?" Nothing here needs a network
call at run time, and the core imports nothing outside the standard library.
from tiny_computer_agent import AgentLoop, GrabScreen, IndexedScreen, OcrDetector
from tiny_computer_agent.models import TextPlannerBrain
screen = IndexedScreen(GrabScreen(), OcrDetector()) # pixels -> labels
brain = TextPlannerBrain() # 0.5B, CPU-friendly
loop = AgentLoop(screen=screen, brain=brain) # dry run by default
episode = loop.run("save the document")
print(episode.render())
"""
from tiny_computer_agent.act import (
ActionResult,
DryRunExecutor,
Executor,
InputUnavailable,
PyAutoGuiExecutor,
resolve_point,
)
from tiny_computer_agent.actions import (
ACTION_KINDS,
ACTION_MENU,
Action,
ActionError,
parse_action,
)
from tiny_computer_agent.brain import (
Brain,
BrainError,
DecisionMenu,
GoalUnreachable,
MenuItem,
MockBrain,
ModelBrain,
PlannerBrain,
extract_json_object,
extract_json_objects,
parse_decision,
)
from tiny_computer_agent.loop import AgentLoop, Episode, Step
from tiny_computer_agent.models import (
DEFAULT_TEXT_MODEL,
DEFAULT_VISION_MODEL,
MODEL_BRAINS,
TextPlannerBrain,
VLMBrain,
make_model_brain,
model_cached,
model_dependencies,
resolve_device,
)
from tiny_computer_agent.observe import (
Element,
FakeScreen,
GrabScreen,
Observation,
ScreenSource,
ScreenUnavailable,
normalise_label,
)
from tiny_computer_agent.perception import (
Detector,
DetectorUnavailable,
IndexedScreen,
OcrDetector,
detector_available,
make_detector,
)
from tiny_computer_agent.safety import Policy, PolicyViolation
__version__ = "0.2.0"
__all__ = [
"ACTION_KINDS", "ACTION_MENU", "Action", "ActionError", "ActionResult",
"AgentLoop", "Brain", "BrainError", "DEFAULT_TEXT_MODEL", "DEFAULT_VISION_MODEL",
"DecisionMenu", "Detector", "DetectorUnavailable", "DryRunExecutor", "Element",
"Episode", "Executor", "FakeScreen", "GoalUnreachable", "GrabScreen",
"IndexedScreen", "InputUnavailable", "MODEL_BRAINS", "MenuItem", "MockBrain",
"ModelBrain", "Observation", "OcrDetector", "PlannerBrain", "Policy",
"PolicyViolation", "PyAutoGuiExecutor", "ScreenSource", "ScreenUnavailable",
"Step", "TextPlannerBrain", "VLMBrain", "detector_available",
"extract_json_object", "extract_json_objects", "make_detector", "make_model_brain",
"model_cached", "model_dependencies", "normalise_label", "parse_action",
"parse_decision", "resolve_device", "resolve_point", "__version__",
]
|