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 ¶
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.
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" )