replay

command
v2.8.0-dev.3 Latest Latest
Warning

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

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

README

replay — offline agent loop from a recorded transcript

What this shows

Driving the full agent loop with no LLM credentials by replaying a recorded JSONL transcript through the mock.NewScripted provider. The 2-turn transcript is inlined as a constant and materialized to a temp file; in lenient mode (strict=false) the provider plays responses back in order regardless of the incoming prompt — pass true to assert each request matches the recording (useful for catching prompt-construction regressions in tests).

In real usage the transcript comes from a live run captured with the bundled CLI's --record-to flag or mock.NewRecorder in library code.

Run it

No credentials needed, runs offline:

go run ./examples/replay

Key APIs

  • mock.NewScriptedgithub.com/go-steer/core-agent/v2/pkg/models/mock
  • agent.New / agent.Agent.Rungithub.com/go-steer/core-agent/v2/pkg/agent

What you should see

user: What is 2+2?
model: Replay turn 1: hello from the transcript.
user: And 3+3?
model: Replay turn 2: this came from the JSONL fixture.

The prompts deliberately don't match the recorded ones — that's lenient mode doing its job.

Next

Documentation

Overview

Example: drive the agent loop offline by replaying a recorded JSONL transcript through the mock "scripted" provider — no LLM credentials required.

go run ./examples/replay

In real usage the transcript is captured from a live provider with the bundled CLI's --record-to flag (or models/mock.NewRecorder from library code). Here it's inlined as a constant so the example runs standalone.

Jump to

Keyboard shortcuts

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