Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector captures trace events and optionally forwards them to another Writer.
func NewCollector ¶
NewCollector returns a Collector that forwards events to next.
type Event ¶
type EventType ¶
type EventType string
const ( EventStepStart EventType = "step_start" // EventToolStart captures a tool invocation including parameters. EventToolStart EventType = "tool_start" EventToolEnd EventType = "tool_end" EventFinal EventType = "final" EventModelStart EventType = "model_start" // EventToken represents a streaming token from the AI response EventToken EventType = "token" // EventYield is reserved; not used by default since agents run without iteration caps. EventYield EventType = "yield" // EventSummary indicates a run summary with token and cost statistics. EventSummary EventType = "summary" )
type JSONLWriter ¶
type JSONLWriter struct {
// contains filtered or unexported fields
}
func NewJSONL ¶
func NewJSONL(w io.Writer) *JSONLWriter
type MultiWriter ¶
type MultiWriter struct {
// contains filtered or unexported fields
}
MultiWriter dispatches events to multiple writers.
func NewMulti ¶
func NewMulti(w ...Writer) *MultiWriter
type SSEWriter ¶
type SSEWriter struct {
// contains filtered or unexported fields
}
func NewSSE ¶
func NewSSE(w http.ResponseWriter) *SSEWriter
type Summary ¶
type Summary struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
TotalTokens int `json:"total_tokens"`
Cost float64 `json:"cost"`
ModelUsage map[string]cost.TokenUsage `json:"model_usage"`
}
Summary holds token usage and estimated cost for a run.
func AnalyzeFile ¶
AnalyzeFile loads a newline-delimited JSON trace log and returns the token usage summary. The input text is assumed to be empty.
Click to show internal directories.
Click to hide internal directories.