trace

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package trace records the agent's decision path — goal, model turns, tool calls, observations, final answer, and learned lessons — as JSONL. One run is one trajectory; the file is the future training dataset (state → action → observation → outcome).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileTracer

type FileTracer struct {
	// contains filtered or unexported fields
}

FileTracer appends JSONL records to a file. Emit is safe for concurrent use.

func NewFileTracer

func NewFileTracer(path, runID string) (*FileTracer, error)

NewFileTracer opens (creating + appending) the trace file at path, tagging every record with runID.

func (*FileTracer) Close

func (t *FileTracer) Close() error

Close closes the underlying file.

func (*FileTracer) Emit

func (t *FileTracer) Emit(kind string, fields map[string]any)

Emit writes one JSONL record: the standard time/run/kind fields plus the caller's fields.

type Tracer

type Tracer interface {
	Emit(kind string, fields map[string]any)
}

Tracer receives one structured event per agent step.

func Multi

func Multi(tracers ...Tracer) Tracer

Multi fans one event out to several tracers (e.g. the JSONL file plus the live TUI). Nil tracers are dropped, so Multi(file, nil) is safe.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL