Documentation
¶
Overview ¶
Package mock ships two credential-free LLM providers and a recording wrapper that pair for offline testing of agent flows:
"echo" returns the user's last message as the model response. Zero config; useful for "does the binary boot?" smoke tests.
"scripted" replays a JSONL transcript turn-by-turn. Pair it with a recording captured against a real provider to exercise the agent loop without burning API quota.
NewRecorder wraps any model.LLM and appends each turn (request + response stream) to an io.Writer as JSONL. Recorded transcripts are consumed by the scripted provider via the same shared RecordedTurn type defined in format.go.
Tool execution at replay time uses the live environment, so the scripted provider faithfully replays the LLM side but not the wider tool surface — fine for testing prompt construction and loop shape, not for bit-exact session reproduction.
Index ¶
Constants ¶
const ( ProviderEcho = "echo" ProviderScripted = "scripted" )
Provider names registered by this package.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is the mock implementation of models.Provider. It holds a single model.LLM (echo or scripted) and returns it from Model — the modelID argument is ignored because mocks aren't model-specific.
func NewEcho ¶
func NewEcho() *Provider
NewEcho returns an echo Provider directly. Useful for library callers that want the mock without going through models.Resolve.
func NewScripted ¶
NewScripted returns a scripted Provider that plays back the JSONL transcript at path. strict toggles request-shape validation per turn (see scriptedLLM for details).