Documentation
¶
Index ¶
Constants ¶
const ( TempChoice = 1.11 TempYesNo = 1.56 )
const ( // DecideTemperature is decider-0.8b's decision temperature, the one the browser uses // (qwen.Config.DecideTemperature). DecideTemperature = 1.03 )
const DefaultRuns = 10
const (
MinConfidence = 0.8
)
Variables ¶
var ( ErrGivenAtRequired = errors.New("agenteval: Given.At is required") ErrMinPassRequired = errors.New("agenteval: MinPass is required (1..Runs)") ErrWhenRequired = errors.New("agenteval: When is required") ErrThenCheckRequired = errors.New("agenteval: Then needs at least one check") )
var (
ErrFakeToolNeedsName = errors.New("agenteval: FakeTool needs a Name")
)
Functions ¶
func NewDeciderJudge ¶ added in v0.1.0
NewDeciderJudge creates a new decider-4b judge client.
Types ¶
type Attempt ¶ added in v0.1.0
type Attempt struct {
Question string // Scenario.When
At Moment
Answer string // what agent.Run returned (reply.Text)
Pending []llm.ToolCall // what the agent asked the person to confirm; not executed
Err error // what agent.Run returned
Calls []ToolCall // every tool call, in order
}
Attempt is what happened in one run of a scenario.
type Check ¶ added in v0.1.0
type Check interface {
Name() string // how the check reads in the report, e.g. `Contains("18:00")`
Check(a Attempt, j llm.Decider) Result
}
Check judges one attempt.
func AnswersTheQuestion ¶ added in v0.1.0
func AnswersTheQuestion() Check
AnswersTheQuestion checks if the assistant's answer actually answers the user's question.
func AsksNothingToConfirm ¶ added in v0.2.0
func AsksNothingToConfirm() Check
AsksNothingToConfirm checks that Pending is empty.
func AsksToConfirm ¶ added in v0.2.0
AsksToConfirm checks that some pending tool call has the given name.
func DoesNotModify ¶ added in v0.1.0
func DoesNotModify() Check
DoesNotModify checks that every tool call has Action == model.Read.
func Faithful ¶ added in v0.1.0
func Faithful() Check
Faithful checks if the assistant's answer states anything not supported by the tool result.
func NotContains ¶ added in v0.1.0
NotContains checks that the answer does not contain the given substring.
type Env ¶ added in v0.1.0
type Env struct {
Decider llm.Decider // decider-0.8b on llama-server (AGENTEVAL_DECIDER_URL)
Writer llm.Client // LFM2.5-350M on llama-server (AGENTEVAL_WRITER_URL)
Tokens llm.TokenCounter // the decider's tokenizer
Clock agent.Clock
Memory agent.MemoryStore // fresh for every attempt
IDGen model.IDGenerator
ToolIndex agent.ToolIndex
Tools []agent.Tool // the scenario's FakeTools; pass them as Config.LocalTools
}
Env is everything a scenario provides to the agent. A Builder passes each field to agent.Config unchanged and adds only the application's Texts, Templates and Guard.
type FakeTool ¶ added in v0.1.0
type FakeTool struct {
Name, Description, InputSchema string
Action model.Action // required: model.Read, model.Create, model.Update, model.Delete or a combination
Returns string // what the tool answers, whatever the arguments
}
FakeTool is a tool with a fixed answer. Its definition should be the real tool's, so the agent sees exactly what it will see in production.
type Given ¶ added in v0.1.0
type Given struct {
At Moment // required: the date and time the user speaks
Tools []FakeTool // the tools the agent can use in this scenario
}
Given is the situation before the user speaks.
type Moment ¶ added in v0.1.0
type Moment struct {
Year, Month, Day, Hour, Minute int
UTCOffsetMinutes int // e.g. -180 for UTC-3
}
Moment is a local date and time.
type Scenario ¶ added in v0.1.0
type Scenario struct {
Given Given
When string // the user's message
Then []Check // every check must pass for an attempt to pass
Runs int // attempts; 0 means DefaultRuns
MinPass int // required: attempts that must pass, 1..Runs
}
Scenario is one use case of an agent. Run executes it Runs times and fails the test when fewer than MinPass attempts pass.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
lab
command
Command lab builds the agent laboratory with the real models and serves it on https://localhost:8443 (README, "Laboratorio").
|
Command lab builds the agent laboratory with the real models and serves it on https://localhost:8443 (README, "Laboratorio"). |
|
Package lab is the agent this repository's laboratory runs (web/client.go, web/workers/agent): its model files and its Worker scripts.
|
Package lab is the agent this repository's laboratory runs (web/client.go, web/workers/agent): its model files and its Worker scripts. |
|
worker
Package worker is the agent the laboratory runs in its Web Worker: a clinic assistant over two tools (the opening hours, and changing them), in Spanish.
|
Package worker is the agent the laboratory runs in its Web Worker: a clinic assistant over two tools (the opening hours, and changing them), in Spanish. |
|
workers/agent
command
The agent laboratory's Web Worker: the lab's agent with the real models (lab/worker).
|
The agent laboratory's Web Worker: the lab's agent with the real models (lab/worker). |