Documentation
¶
Overview ¶
Package tamesu is the root of tamesu (試す, "to try, to test"), an agentic testing framework and CLI for web apps and AI agents: "Your agents, tested like users would."
Tests are written in YAML suites or in Go and run against four kinds of target with one runner, one assertion model and one report format: browser (agentic web tests), rest (HTTP agents), livekit (realtime voice over WebRTC) and sip (phone calls through a LiveKit SIP service).
The repository is a multi-module monorepo. This root module holds the public API (Run, Test, Persona, Scenario, LoadSuite), the target, assert and metrics contracts, the reporters and the internal config, runner, secrets and redaction packages. It never depends on Genkit, LiveKit, pion, chromedp or a cloud SDK. The heavy dependency sets live in their own modules: llm (every model call, through Genkit), targets/rest, targets/livekit, targets/sip, targets/browser and audio. The tamesu binary (module cmd/tamesu) is the only module that links everything.
Secrets are declared as mamori refs and resolved once per run; see github.com/xavidop/mamori.
Index ¶
- func Env(name string) string
- func Run(t testing.TB, test Test, opts ...RunOption) *report.TestOutcome
- func UUID() string
- type Persona
- type Provider
- type RunOption
- func WithMamoriOptions(opts secrets.Options) RunOption
- func WithOutDir(dir string) RunOption
- func WithProject(p config.Project) RunOption
- func WithProvider(p Provider) RunOption
- func WithReporter(r report.Reporter) RunOption
- func WithSecrets(refs map[string]string) RunOption
- func WithVars(vars map[string]string) RunOption
- type Scenario
- type Suite
- type Test
- type TestInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Env ¶
Env returns an environment variable, or "" when it is not set. It is a convenience for target configs built in Go tests.
Types ¶
type Persona ¶
type Persona struct {
Name string
Style string
Language string
Voice string
// InterruptProbability, SilenceAfterTurnMs and BackgroundNoise are the
// audio-mode behaviours.
InterruptProbability float64
SilenceAfterTurnMs [2]int
BackgroundNoise string
LineQuality string
}
Persona is the simulated user of an agent test (design.md §2).
type Provider ¶
Provider is the AI layer a test needs: the simulated user, the judge, the evaluators and the usage meter. *llm.Client implements it.
type RunOption ¶
type RunOption func(*runOptions)
RunOption configures Run.
func WithMamoriOptions ¶
WithMamoriOptions configures how secrets are resolved: ref vars, providers, the env file.
func WithOutDir ¶
WithOutDir sets the run directory (default $TAMESU_OUT, else the test's temp dir).
func WithProject ¶
WithProject applies a project configuration (defaults, budgets); the default is config's DefaultProject.
func WithProvider ¶
WithProvider sets the AI layer (an *llm.Client).
func WithReporter ¶
WithReporter adds a reporter (the console reporter on the test log is always on).
func WithSecrets ¶
WithSecrets declares secrets as mamori refs, resolved once before the test runs and available as {{secrets.NAME}} to the target.
type Suite ¶
type Suite struct {
Name string
Path string
Tags []string
// Tests lists the suite's tests by name, target and target type.
Tests []TestInfo
}
Suite is a loaded YAML suite as the Go API sees it.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package assert defines the Assertion contract and the deterministic assertions tamesu ships (contains, regex, json_path, status, tool_called, metric, turns).
|
Package assert defines the Assertion contract and the deterministic assertions tamesu ships (contains, regex, json_path, status, tool_called, metric, turns). |
|
audio
module
|
|
|
cmd
|
|
|
tamesu
module
|
|
|
internal
|
|
|
a2aserver
Package a2aserver is tamesu playing a remote agent: a small Agent2Agent server with a card, scripted replies and the fuzz modes, so an orchestrator under test can delegate to it and the suite can see what it delegated.
|
Package a2aserver is tamesu playing a remote agent: a small Agent2Agent server with a card, scripted replies and the fuzz modes, so an orchestrator under test can delegate to it and the suite can see what it delegated. |
|
calibrate
Package calibrate measures a judge model against labelled transcripts: conversations a person has already marked pass or fail for a rubric.
|
Package calibrate measures a judge model against labelled transcripts: conversations a person has already marked pass or fail for a rubric. |
|
cli
Package cli is the tamesu command tree.
|
Package cli is the tamesu command tree. |
|
config
Package config loads tamesu.yaml (the project configuration) and suite files, validates them with file and line numbers, interpolates ${VAR} and renders {{...}} templates, and generates the JSON Schema published under schema/.
|
Package config loads tamesu.yaml (the project configuration) and suite files, validates them with file and line numbers, interpolates ${VAR} and renders {{...}} templates, and generates the JSON Schema published under schema/. |
|
fsutil
Package fsutil has the file helpers the caches share.
|
Package fsutil has the file helpers the caches share. |
|
generate
Package generate turns the scenario generator's draft into a suite file a person reviews: a target stub for the named target and one test per draft, in the order and shape a hand-written suite has.
|
Package generate turns the scenario generator's draft into a suite file a person reviews: a target stub for the named target and one test per draft, in the order and shape a hand-written suite has. |
|
lint
Package lint finds the weak spots of a suite that validation accepts: tests that only a judge can fail, tests nobody can select, goals written twice, thresholds that can never bind, declarations nothing uses.
|
Package lint finds the weak spots of a suite that validation accepts: tests that only a judge can fail, tests nobody can select, goals written twice, thresholds that can never bind, declarations nothing uses. |
|
model
Package model holds the types the runner exchanges with the AI layer: the simulated user's input and output, usage, and the Provider interface the llm module implements.
|
Package model holds the types the runner exchanges with the AI layer: the simulated user's input and output, usage, and the Provider interface the llm module implements. |
|
persona
Package persona runs the simulated-user loop of a conversational test: the simulator produces the next user turn, the target sends it and returns the agent's turn, and the loop stops on the scenario's conditions.
|
Package persona runs the simulated-user loop of a conversational test: the simulator produces the next user turn, the target sends it and returns the agent's turn, and the loop stops on the scenario's conditions. |
|
pinned
Package pinned finds the external command-line tools tamesu drives (agent-browser, agent-desktop) at the version tamesu was tested with.
|
Package pinned finds the external command-line tools tamesu drives (agent-browser, agent-desktop) at the version tamesu was tested with. |
|
redact
Package redact replaces resolved secret values with ‹secret:NAME› in every string tamesu writes: transcripts, HARs, logs, reports and errors.
|
Package redact replaces resolved secret values with ‹secret:NAME› in every string tamesu writes: transcripts, HARs, logs, reports and errors. |
|
replay
Package replay caches the simulator's turns and the judge's verdicts on disk, keyed by the request, so a repeated run with the same conversation costs nothing and is deterministic.
|
Package replay caches the simulator's turns and the judge's verdicts on disk, keyed by the request, so a repeated run with the same conversation costs nothing and is deterministic. |
|
runner
Package runner executes selected tests: it schedules repeats in parallel, opens a session per run, drives the persona loop, collects metrics, evaluates assertions, writes the run directory (design.md §9) and feeds the reporters.
|
Package runner executes selected tests: it schedules repeats in parallel, opens a session per run, drives the persona loop, collects metrics, evaluates assertions, writes the run directory (design.md §9) and feeds the reporters. |
|
secrets
Package secrets resolves the secrets a run needs through mamori, once, before any test starts, and holds them as secret.String values that are revealed only at the moment of use.
|
Package secrets resolves the secrets a run needs through mamori, once, before any test starts, and holds them as secret.String values that are revealed only at the moment of use. |
|
llm
module
|
|
|
plugins/assemblyai
module
|
|
|
plugins/azure
module
|
|
|
plugins/cartesia
module
|
|
|
plugins/deepgram
module
|
|
|
plugins/elevenlabs
module
|
|
|
plugins/gladia
module
|
|
|
plugins/googlespeech
module
|
|
|
plugins/openaispeech
module
|
|
|
plugins/rime
module
|
|
|
plugins/soniox
module
|
|
|
plugins/speechmatics
module
|
|
|
plugins/speechstream
module
|
|
|
Package metrics names the built-in metrics (design.md §8) and the helpers that aggregate them across turns and repeats.
|
Package metrics names the built-in metrics (design.md §8) and the helpers that aggregate them across turns and repeats. |
|
Package report holds the outcome of a run (tests, repeats, assertions, metrics, transcripts) and the reporters that render it: console, JSON, JUnit and the self-contained HTML report.
|
Package report holds the outcome of a run (tests, repeats, assertions, metrics, transcripts) and the reporters that render it: console, JSON, JUnit and the self-contained HTML report. |
|
Package target defines the contract a system under test implements: a Target that starts a Session (conversational targets: rest, livekit, sip) or a BrowserSession (the browser target), plus the turn, artifact and run-context types they exchange with the runner.
|
Package target defines the contract a system under test implements: a Target that starts a Session (conversational targets: rest, livekit, sip) or a BrowserSession (the browser target), plus the turn, artifact and run-context types they exchange with the runner. |
|
targets
|
|
|
a2a
module
|
|
|
browser
module
|
|
|
grpc
module
|
|
|
livekit
module
|
|
|
mcp
module
|
|
|
model
module
|
|
|
pipecat
module
|
|
|
realtime
module
|
|
|
rest
module
|
|
|
sip
module
|
|
|
twilio
module
|
|
|
voice
module
|
|
|
Package targettest is the conformance suite every conversational target must pass.
|
Package targettest is the conformance suite every conversational target must pass. |