timeline

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 9 Imported by: 1 module, 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 timeline reduces the runtime's debug stream to the handful of events that tell the story of a turn, in five lanes: what the recogniser heard, what the interaction policy chose, what the language model was asked and said, what was synthesised and played, and what the background passes (standing-instruction extraction and its follow-up questions) concluded.

It exists because the debug stream is complete and therefore unreadable: a few minutes of conversation is twenty thousand events, most of them the graph's own bookkeeping. Reading a turn back - why did it speak there, why did it not count that animal - means finding the twenty events that matter among them, and the vocabulary for those twenty is defined once, here, so the log file on disk and the timeline drawn in the browser show the same thing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Projects

func Projects(name string) bool

Projects reports whether a debug event of this name has a place on the timeline.

Types

type Event

type Event struct {
	Lane Lane `json:"lane"`
	// Kind names what happened within the lane: partial, final, speak, result,
	// synthesis, playback, extract, ground...
	Kind string `json:"kind"`
	// Phase is "start", "end", or "point". A start and an end with the same
	// Span draw as one bar.
	Phase string `json:"phase"`
	// Span joins a start with its end: an utterance id, a generation id, a
	// speech stream id.
	Span string `json:"span,omitempty"`
	// Detail is metadata - revision numbers, confidences, durations, codes.
	// It never carries conversation content, so it can be shown without the
	// payload opt-in.
	Detail string `json:"detail,omitempty"`
	// Text is conversation content: a transcript, what the model said, what a
	// background question answered. It is a debug payload and is withheld from
	// a client that did not ask for payloads.
	Text string `json:"text,omitempty"`
	// DurationMS is how long the thing took, when the event reports it.
	DurationMS float64 `json:"duration_ms,omitempty"`
}

Event is one mark on the timeline.

func Project

func Project(entry binding.DebugEvent) []Event

Project reduces one debug event to its timeline events. Most debug events project to nothing; a policy decision that also ran the standing-instruction pass projects to several, one per background question.

The debug payload holds whatever Go value the element emitted. Rather than know every element's types, the value is read through its JSON form, which is also exactly what the log and the wire carry.

func (Event) Line

func (event Event) Line(at time.Time, session string) string

Line renders an event as one line of the timeline log.

type Lane

type Lane string

Lane is one row of the timeline.

const (
	// LaneASR is the recogniser: speech activity and each transcript revision.
	LaneASR Lane = "asr"
	// LanePolicy is the interaction policy: one choice per transcript event.
	LanePolicy Lane = "policy"
	// LaneModel is the language model behind the voice: request, text, outcome.
	LaneModel Lane = "model"
	// LaneTTS is synthesis and playback of what the model said.
	LaneTTS Lane = "tts"
	// LaneBackground is every model question asked off the critical path:
	// standing-instruction extraction, grounding, and the readings of a pin.
	LaneBackground Lane = "background"
)

func Lanes

func Lanes() []Lane

Lanes lists every lane in display order.

func Sorted

func Sorted(lanes map[Lane]struct{}) []Lane

Sorted returns the lane names in display order, for callers that render a legend from the vocabulary rather than hard-coding it.

type Writer

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

Writer appends timeline lines to one destination from every session, in arrival order.

func NewWriter

func NewWriter(out io.Writer) *Writer

NewWriter wraps a destination. A nil destination yields a writer that discards, so callers need not test for one.

func (*Writer) Write

func (writer *Writer) Write(at time.Time, session string, events []Event) error

Write appends one line per event.

Jump to

Keyboard shortcuts

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