Documentation
¶
Overview ¶
Package regressiongate demonstrates LoopKit's quality engine: fixture replay assertions and eval suite with regression gate.
Workflow:
- Run the loop with real data to record a fixture: fixture.Record(...)
- Commit the fixture to version control.
- In CI, run gate_test.go to assert the loop still behaves correctly.
Example gate test:
result := looptest.Replay(t, def, "fixtures/greeting.loopfix")
result.AssertCompleted(t)
eval.RunSuite(t, suite, eval.Gate{
MinMean: 0.8,
MaxRegression: 0.05,
Baseline: "evals/baseline.json",
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Definition ¶
func Definition() loop.Definition[State, Result]
Definition builds the greeting loop definition. The loop calls a "greet" tool once and finishes with the result.
Iteration pattern:
- Iteration 1 (Greeted=false): emit ToolCall("greet")
- ToolCalled handler: store greeting in state, set Greeted=true (actions from ToolCalled handler are discarded by the runner, but state mutations ARE preserved)
- Iteration 2 (Greeted=true): emit Finish with stored greeting
Types ¶
type Result ¶
type Result struct {
// Greeting is the produced greeting message.
Greeting string `json:"greeting"`
}
Result is the output produced when the loop finishes.
type State ¶
type State struct {
// Name is the input name to greet.
Name string `json:"name"`
// Greeted tracks whether we've received the tool result.
Greeted bool `json:"greeted"`
// Greeting holds the produced greeting after the tool call.
Greeting string `json:"greeting"`
}
State is the loop state for the greeting example.
Click to show internal directories.
Click to hide internal directories.