Documentation
¶
Overview ¶
Package audit builds the LLMTurn record of each model call that led to tool calls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SerializeMessages ¶
SerializeMessages JSON-encodes the messages sent to the model as {"messages":[...]}. Over 256 KiB the oldest messages are dropped and "truncated" is set. It returns the JSON, the number of messages kept and the character count of all messages.
func SerializeToolCalls ¶
SerializeToolCalls JSON-encodes an assistant message's tool calls, or "[]".
Types ¶
type CostEstimator ¶
type CostEstimator interface {
Estimate(provider, model string, inputTokens, outputTokens int) float64
}
CostEstimator prices one turn. → the caller's loop.CostEstimator, or defaults.ZeroCost
type ModelIdentifier ¶
type ModelIdentifier interface {
Identity() (provider, model string)
}
ModelIdentifier names the provider and model for each turn. It is asked once per turn, so it may change during a run. → the caller's loop.ModelIdentifier, or defaults.NoIdentity
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
func NewRecorder ¶
func NewRecorder(identity ModelIdentifier, cost CostEstimator, stopLabel string) *Recorder