autonomous

command
v2.8.0-dev.4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

README

autonomous — autonomous.Run loop shape and the report_done gesture

What this shows

Driving an agent through autonomous.Run end-to-end with no LLM credentials. A scripted transcript stands in for the model: it calls the driver's internal report_done lifecycle tool with state="done", then emits a final text summary. The driver loops, detects the done call, and returns a structured RunResult (reason, turn count, done detail, final text, duration).

The build callback is the key pattern: autonomous.Run hands you the extras tool slice (carrying report_done) and you compose it with your own tools when constructing the agent.

Run it

No credentials needed, runs offline:

go run ./examples/autonomous

Key APIs

  • autonomous.Run / autonomous.WithMaxTurnsgithub.com/go-steer/core-agent/v2/pkg/agent/autonomous
  • autonomous.RunResult — reason / turns / done detail / final text / duration
  • mock.NewScriptedgithub.com/go-steer/core-agent/v2/pkg/models/mock
  • agent.New / agent.WithToolsgithub.com/go-steer/core-agent/v2/pkg/agent

What you should see

reason:      completed
turns:       1
done detail: summarized example.txt
final text:  Done. The project ships an autonomous-run driver.
duration:    <a few ms>

Next

Documentation

Overview

Example: drive an agent through autonomous.Run end-to-end with no LLM credentials. The mock "scripted" provider replays a JSONL transcript that the model would normally produce; the autonomous driver loops, watches for the report_done tool call, and returns a structured RunResult.

go run ./examples/autonomous

Real consumers swap in a credentialled provider:

GEMINI_API_KEY=... go run ./examples/autonomous --real

(the --real path is intentionally not implemented here; this example focuses on the loop shape and termination gesture).

Jump to

Keyboard shortcuts

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