action

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 16 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 action turns decisions into effects on the world.

It is perception's dual. Perception turns a continuous external stream into discrete commitments by gating - discarding what does not matter. Action turns discrete commitments back into a continuous external stream by pacing - holding back what is not yet safe to emit. Same boundary, opposite directions.

There is one commit boundary and it is the same for everything. Speech, assistant text, tool calls, and clicks are all irreversible once emitted: a spoken sentence cannot be unsaid, and a repair is damage limitation rather than reversal. So this package does not classify outputs by how recoverable they are - it holds a single line between decided and emitted, identically for all of them. Nothing crosses without authority, and everything that has not yet crossed can still be cancelled.

That is simpler than a taxonomy of consequence and it is also stronger, because the guarantee does not depend on having classified a new action type correctly. What remains genuinely per-action is a confirmation requirement, and that is a policy a developer declares rather than one the runtime infers.

Index

Constants

View Source
const ToolParameterCompactASCIIAlphanumericV1 = toolargs.CompactASCIIAlphanumericV1

ToolParameterCompactASCIIAlphanumericV1 removes ASCII speech separators from a string argument and then requires one non-empty ASCII alphanumeric token. It is intended for fields whose declared domain is a compact identifier, not names, addresses, free text, or arbitrary strings.

View Source
const ToolParameterCoordinatePairXYV1 = toolargs.CoordinatePairXYV1

ToolParameterCoordinatePairXYV1 recognizes only an x member whose value is exactly a two-integer [x,y] array while y is absent, and derives separate x and y members. It exists for an observed provider serialization defect; it does not relax the provider-facing coordinate schema.

Variables

View Source
var (
	// ErrUnknownCommitment names a commitment the ledger never saw.
	ErrUnknownCommitment = errors.New("unknown commitment")
	// ErrAlreadyCrossed means the caller tried to reverse something that had
	// already reached the world.
	ErrAlreadyCrossed = errors.New("commitment has already crossed the boundary")
	// ErrInvalidTransition names a lifecycle step that does not exist.
	ErrInvalidTransition = errors.New("invalid commitment transition")
	// ErrDuplicateCall means a call ID was dispatched twice.
	ErrDuplicateCall = errors.New("duplicate call identity")
)
View Source
var (
	// ErrNoAuthority means a call was never committed as an executable call.
	// A proposal from the fast provider lands here, which is the first
	// cognition boundary enforced at the point of effect.
	ErrNoAuthority = errors.New("call has no execution authority in the trajectory")
	// ErrNotConfirmed means a declared confirmation requirement was refused.
	ErrNotConfirmed = errors.New("action was not confirmed")
	// ErrUnknownTool names a call for a tool that was never declared.
	ErrUnknownTool = errors.New("unknown tool")
	// ErrGraphNativeNormalizationRequired prevents the legacy Tools boundary
	// from silently ignoring a deployment-owned argument normalizer. The
	// graph-native NormalizeArguments element is the only implementation that
	// can currently emit and re-attest the required derivation evidence.
	ErrGraphNativeNormalizationRequired = errors.New("tool argument normalization requires the graph-native action path")
)
View Source
var ErrQueueFull = errors.New("speech queue is full")

ErrQueueFull means the bounded speech horizon is exhausted.

View Source
var ErrSilentProducer = errors.New("producer has no voice authority")

ErrSilentProducer means the caller tried to voice content whose producer had no voice authority. It is the second cognition boundary, enforced where output commits rather than where it is configured.

Functions

This section is empty.

Types

type Commitment

type Commitment struct {
	ID   string `json:"id"`
	Kind Kind   `json:"kind"`
	// AssistantItemIDs are the trajectory items this commitment carries, so a
	// cancellation can record the matching visibility transitions.
	AssistantItemIDs []string `json:"assistant_item_ids,omitempty"`
	// CallID is the idempotency key for a tool or computer-use action. The
	// same call ID may be dispatched at most once, so recovery can retry a
	// committed call without duplicating its external effect.
	CallID string `json:"call_id,omitempty"`
	// SourceRevision is the perception revision this commitment answers.
	SourceRevision uint64 `json:"source_revision,omitempty"`
	// Phase is the cognition phase that produced it.
	Phase trajectory.Phase `json:"phase,omitempty"`
	// SpeechAuthority is the producing provider's authority, read from the
	// committed log. Silent content must never be queued for speech.
	SpeechAuthority string `json:"speech_authority,omitempty"`
	// Confirm is the declared requirement for this action.
	Confirm Confirm `json:"confirm,omitempty"`

	State State `json:"state"`
	// PlayedMS is how much of a speech commitment the user actually heard.
	PlayedMS uint64 `json:"played_ms,omitempty"`
	// CancelReason records why a commitment stopped.
	CancelReason string `json:"cancel_reason,omitempty"`
}

Commitment is one decided output on its way to the world.

type Confirm

type Confirm string

Confirm is a developer's declaration about consequence, carried on a tool definition. It is never inferred from the action's name or arguments.

const (
	ConfirmNever  Confirm = "never"
	ConfirmPolicy Confirm = "policy"
	ConfirmAlways Confirm = "always"
)

func ParseConfirm

func ParseConfirm(value string) (Confirm, error)

ParseConfirm validates a declared confirmation requirement. An unset value means never, which matches how an ordinary tool behaves today.

type ConfirmationRequest

type ConfirmationRequest struct {
	Call    trajectory.ToolCall `json:"call"`
	Confirm Confirm             `json:"confirm"`
	// Target is the declared context an action applies to - a browser context
	// or a virtual display - so a human sees what the click will land on.
	Target string `json:"target,omitempty"`
}

ConfirmationRequest is what a confirmer is asked to authorize. It carries the declared requirement and the call, and nothing that would let a confirmer be talked into an answer by the content it is authorizing.

type Confirmer

type Confirmer interface {
	Confirm(context.Context, ConfirmationRequest) (bool, error)
}

Confirmer authorizes actions whose declared requirement calls for it.

type ConfirmerFunc

type ConfirmerFunc func(context.Context, ConfirmationRequest) (bool, error)

ConfirmerFunc adapts a function to Confirmer.

func (ConfirmerFunc) Confirm

func (function ConfirmerFunc) Confirm(ctx context.Context, request ConfirmationRequest) (bool, error)

type DenyAll

type DenyAll struct{}

DenyAll refuses every action that requires confirmation. It is the correct default for an unattended deployment: an action nobody can authorize should not happen because nobody was asked.

func (DenyAll) Confirm

type Dispatcher

type Dispatcher interface {
	Name() string
	Dispatch(context.Context, trajectory.ToolCall) (trajectory.ToolResult, error)
}

Dispatcher executes one authoritative call.

Implementations must be idempotent by call ID: recovery may retry a committed call, and a retry that duplicated the external effect would make the commit boundary meaningless in exactly the situation it matters most.

type DispatcherFunc

type DispatcherFunc func(context.Context, trajectory.ToolCall) (trajectory.ToolResult, error)

DispatcherFunc adapts a function to Dispatcher.

func (DispatcherFunc) Dispatch

func (function DispatcherFunc) Dispatch(ctx context.Context, call trajectory.ToolCall) (trajectory.ToolResult, error)

func (DispatcherFunc) Name

func (function DispatcherFunc) Name() string

type Frame

type Frame struct {
	PCM16LE      []byte        `json:"-"`
	SampleRateHz uint32        `json:"sample_rate_hz"`
	Duration     time.Duration `json:"duration"`
	Final        bool          `json:"final,omitempty"`
}

Frame is one paced block of audio.

type Kind

type Kind string

Kind names what sort of effect a commitment will have. It exists for reporting and for confirmation policy - never to decide how carefully the commit boundary is held, which is identical for all of them.

const (
	KindSpeech   Kind = "speech"
	KindText     Kind = "text"
	KindToolCall Kind = "tool_call"
	// KindComputerAction is a computer-use action. It rides the same dispatch
	// path as any other tool call and gets no special handling here.
	KindComputerAction Kind = "computer_action"
)

type Ledger

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

Ledger is the single record of what has been decided, what has crossed the boundary, and what repair is owed. Every output kind goes through it.

func NewLedger

func NewLedger() *Ledger

NewLedger creates an empty ledger.

func (*Ledger) Cancel

func (ledger *Ledger) Cancel(id, reason string) (crossed bool, err error)

Cancel stops a commitment. It reports whether anything had already crossed the boundary, which is the caller's signal that a repair may be owed rather than an error - cancelling something already heard is a normal race, not a programming mistake.

func (*Ledger) Cancellable

func (ledger *Ledger) Cancellable(match func(Commitment) bool) []Commitment

Cancellable returns every commitment that has not yet crossed the boundary and that matches the supplied predicate. It is how barge-in and supersession find what they may still stop.

func (*Ledger) Complete

func (ledger *Ledger) Complete(id string, playedMS uint64) error

Complete records that emission finished. playedMS is how much of a speech commitment was actually heard.

func (*Ledger) Crossed

func (ledger *Ledger) Crossed(match func(Commitment) bool) []Commitment

Crossed returns every commitment that reached the world and matches the supplied predicate.

It is Cancellable's mirror, and the pair is the whole vocabulary the commit boundary offers: what can still be stopped, and what can only be repaired. Supersession needs both - it stops what nobody heard and owes a correction for what somebody did.

func (*Ledger) Emit

func (ledger *Ledger) Emit(id string) error

Emit records that something reached the world. This is the irreversible step, and it is deliberately separate from Queue: the code that queues a decision and the code that puts bytes on the wire are not the same code, and only the second one knows.

func (*Ledger) Invalidate

func (ledger *Ledger) Invalidate(id string, byRevision uint64) (Obligation, bool)

Invalidate records that later evidence invalidated content that had already reached the world, and returns the obligation it created. Content that never crossed the boundary creates no obligation: there is nothing to repair.

func (*Ledger) Lookup

func (ledger *Ledger) Lookup(id string) (Commitment, bool)

Lookup returns one commitment.

func (*Ledger) Obligations

func (ledger *Ledger) Obligations() []Obligation

Obligations returns outstanding repairs in the order they were created.

func (*Ledger) Outstanding

func (ledger *Ledger) Outstanding() []Commitment

Outstanding returns every commitment that has not reached a terminal state.

func (*Ledger) Prepare

func (ledger *Ledger) Prepare(commitment Commitment) error

Prepare records a decided output. It has not left the process.

func (*Ledger) Queue

func (ledger *Ledger) Queue(id string) error

Queue accepts a commitment for emission. It is still fully cancellable.

func (*Ledger) ResolveObligation

func (ledger *Ledger) ResolveObligation(commitmentID string) bool

ResolveObligation marks a repair as discharged.

func (*Ledger) Snapshot

func (ledger *Ledger) Snapshot() []Commitment

Snapshot is the whole ledger, for the health endpoint and for evidence.

func (*Ledger) Truncated

func (ledger *Ledger) Truncated(id string, playedMS uint64) bool

Truncated records what the client says was actually heard.

The server knows what it sent and when; only the client knows where playback stopped. That makes the client authoritative on the one number a repair decision turns on, and a repair raised later must use the honest figure rather than the server's optimistic one.

type Obligation

type Obligation struct {
	CommitmentID          string   `json:"commitment_id"`
	AssistantItemIDs      []string `json:"assistant_item_ids"`
	PlayedMS              uint64   `json:"played_ms"`
	InvalidatedByRevision uint64   `json:"invalidated_by_revision"`
	Resolved              bool     `json:"resolved"`
}

Obligation is an outstanding repair: content that reached the world and was later invalidated. It is what the ledger owes the conversation.

type Outcome

type Outcome struct {
	Completed bool   `json:"completed"`
	PlayedMS  uint64 `json:"played_ms"`
	Reason    string `json:"reason,omitempty"`
	// Mark is which of the utterance's words the user actually heard.
	//
	// PlayedMS beside it is the same fact in the unit the audio was paced in,
	// and it is not a substitute for this one. A duration says how long the
	// agent was audible; only the mark says where in the sentence that landed,
	// and every decision after an interruption - what to correct, what to
	// repeat, where to carry on from - is about the sentence rather than about
	// the clock.
	Mark spoken.Mark `json:"mark,omitzero"`
}

Outcome is how an utterance ended.

type PlaybackReporter

type PlaybackReporter interface {
	AgentAudioHandedOff(utteranceID string, duration time.Duration) error
	AgentAudioStopped(atNS uint64)
}

PlaybackReporter receives audio hand-off notifications.

type PolicyDecision

type PolicyDecision func(trajectory.ToolCall) bool

PolicyDecision is how a deployment answers the "policy" requirement.

type Record

type Record struct {
	CallID        string           `json:"call_id"`
	Name          string           `json:"name"`
	Target        string           `json:"target,omitempty"`
	ProducerPhase trajectory.Phase `json:"producer_phase,omitempty"`
	Confirmed     bool             `json:"confirmed"`
	Executed      bool             `json:"executed"`
	Error         string           `json:"error,omitempty"`
	ElapsedNS     uint64           `json:"elapsed_ns,omitempty"`
}

Record is one dispatch attempt.

type Registry

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

Registry is the declared action surface of a session.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates an empty registry.

func (*Registry) Declare

func (registry *Registry) Declare(spec ToolSpec) error

Declare adds a tool. Redeclaring a name replaces it, which is what a session update does when a client changes its tool list.

func (*Registry) Lookup

func (registry *Registry) Lookup(name string) (ToolSpec, bool)

Lookup returns one declared tool.

func (*Registry) Replace

func (registry *Registry) Replace(specs []ToolSpec) error

Replace declares a complete tool set, dropping anything not in it.

func (*Registry) Specs

func (registry *Registry) Specs() []ToolSpec

Specs returns every declared tool in declaration order.

type Speech

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

Speech plans and paces spoken output.

Pacing is the whole point. A synthesiser produces audio faster than it plays, and emitting it as fast as it arrives makes "the agent is speaking" a fiction: everything would be on the wire in a moment, and nothing the user heard could be cancelled. Emitting at the rate the audio plays keeps the commit boundary meaningful.

func NewSpeech

func NewSpeech(config SpeechConfig) (*Speech, error)

NewSpeech creates a speech planner.

func (*Speech) ActiveOrdinary

func (speech *Speech) ActiveOrdinary() bool

ActiveOrdinary reports whether an ordinary response has claimed the speech planner but has not necessarily emitted audio yet.

Duplex state deliberately begins at the first audio frame, because that is what the user can hear. Turn-taking needs one additional fact at the other side of that boundary: a synthesiser can be working on a response while the agent is still acoustically silent. If the user resumes during that window, treating the response as nonexistent lets it begin after they have already taken the floor. This method exposes only the pending fact; the barge-in policy still decides whether to cancel it.

func (*Speech) ActiveSpokeOver

func (speech *Speech) ActiveSpokeOver() bool

ActiveSpokeOver reports whether the audio reaching the user right now was begun on purpose over somebody who already had the floor.

Barge-in needs it, for every act that produces overlap deliberately: a backchannel, where cancelling would have the agent interrupt itself for saying it was listening, and an interruption or speak-through, where cancelling would have it abandon what it cut in to say the moment the sentence it cut into carried on.

func (*Speech) Cancel

func (speech *Speech) Cancel(reason string) (cancelled []Commitment, heard bool)

Cancel stops the utterance in flight and drops everything queued behind it.

It returns the commitments that never crossed the boundary, so a caller can record their cancellation in the trajectory, and separately reports whether the active utterance had already been partly heard - which is the input to the repair policy rather than a decision this package makes.

func (*Speech) CancelMatching

func (speech *Speech) CancelMatching(reason string, match func(Utterance) bool) (cancelled, heard []Commitment)

CancelMatching stops the utterance in flight and every queued utterance that matches a predicate, leaving the rest alone. Supersession uses it: work derived from a prefix that newer evidence replaced is stale, but unrelated queued speech is not.

It returns two sets and the difference between them is the whole point. Cancelled never reached the world and can simply be forgotten. Heard did reach it, wholly or in part, and cannot be taken back - a repair is damage limitation rather than reversal - so it is handed back for the repair policy to decide about rather than being classified here.

It does not bump the epoch, unlike Cancel: an epoch bump invalidates every queued utterance, and the point of a predicate is that some of them survive.

func (*Speech) Close

func (speech *Speech) Close(reason string) []Commitment

Close stops accepting work and cancels what is queued.

func (*Speech) Enqueue

func (speech *Speech) Enqueue(utterance Utterance, speechAuthority string) error

Enqueue accepts an utterance for emission.

It refuses silent producers outright. That check lives here, at the point where content would cross into speech, because a rule enforced only at configuration time is a rule that a new binding can forget.

func (*Speech) Run

func (speech *Speech) Run(ctx context.Context)

Run drains the queue until the context ends. It is one goroutine per session: speech is inherently serial, because a second voice talking over the first is not a feature.

type SpeechConfig

type SpeechConfig struct {
	Provider v1.StreamingSpeechProvider
	Sink     SpeechSink
	Ledger   *Ledger
	// Playback is notified as audio is handed to the world, so the duplex
	// state can answer "is the agent speaking" from what actually crossed the
	// boundary rather than from what was decided.
	Playback PlaybackReporter
	// FrameDuration is the wire frame size. Zero selects 100 ms, which is what
	// the Realtime clients in the field expect.
	FrameDuration time.Duration
	// Timing follows each utterance's audio and answers which of its words
	// crossed the boundary. Nil is allowed: without it the outcome carries a
	// duration and no boundary, which is what this planner reported before.
	Timing *spoken.Tracker
	// QueueDepth bounds how many utterances may wait. A bounded horizon is
	// what keeps a burst of decisions from becoming a backlog of speech that
	// no longer matches the conversation.
	QueueDepth int
	Scheduler  clock.Scheduler
}

SpeechConfig configures the planner.

type SpeechReservationSink

type SpeechReservationSink interface {
	Reserve(Utterance) error
	CancelReservation(Utterance)
}

SpeechReservationSink is the optional queue-lifecycle half of a speech sink. A renderer whose response lifetime includes asynchronously queued speech can reserve that work before the speech goroutine begins synthesis.

Reserve is called before an utterance becomes visible to the queue worker. CancelReservation is called only when that accepted utterance is discarded before Begin. Once Begin is called, the ordinary Begin/End pair owns the reservation's lifetime.

type SpeechSink

type SpeechSink interface {
	// Begin announces an utterance that is about to be emitted.
	Begin(context.Context, Utterance) error
	// Audio delivers one paced frame. It is called only after the ledger has
	// recorded that the boundary is being crossed.
	Audio(context.Context, Utterance, Frame) error
	// End completes the utterance with its terminal outcome. It is called
	// exactly once for every Begin, including when emission failed.
	End(context.Context, Utterance, Outcome) error
}

SpeechSink is how paced audio reaches the world.

Encoding is not this package's business: the sink is handed PCM16 at the synthesiser's rate and renders it however its transport requires - Realtime wire events, a WebRTC track, a file. Pacing is done in duration, so it is the same whatever the encoding turns out to be.

type State

type State string

State is how far a commitment has crossed the boundary.

The vocabulary matches the trajectory's assistant visibility deliberately: the ledger and the log are describing the same lifecycle, and two vocabularies for one lifecycle is how they drift apart.

const (
	// StatePrepared: decided, nothing has left the process.
	StatePrepared State = "prepared"
	// StateQueued: accepted for emission, still fully cancellable.
	StateQueued State = "queued"
	// StateEmitting: something has reached the world. From here nothing is
	// reversible; cancelling stops the remainder and nothing more.
	StateEmitting State = "emitting"
	// StatePlayed: emission completed.
	StatePlayed State = "played"
	// StateCancelled: stopped before anything reached the world.
	StateCancelled State = "cancelled"
)

func (State) Crossed

func (state State) Crossed() bool

Crossed reports whether any part of this commitment reached the world. It is the only distinction that matters for reversibility.

func (State) Terminal

func (state State) Terminal() bool

Terminal reports whether a state can still change.

type ToolArgumentNormalizer

type ToolArgumentNormalizer struct {
	Argument   string `json:"argument"`
	Normalizer string `json:"normalizer"`
}

ToolArgumentNormalizer is deployment-owned control metadata for one direct JSON object member. It is deliberately separate from Parameters: provider APIs receive the standard JSON Schema, while the action authority path keeps this transformation contract in the immutable tool declaration.

type ToolSpec

type ToolSpec struct {
	Name                string                   `json:"name"`
	Description         string                   `json:"description"`
	Parameters          json.RawMessage          `json:"parameters"`
	ArgumentNormalizers []ToolArgumentNormalizer `json:"argument_normalizers,omitempty"`
	Confirm             Confirm                  `json:"confirm,omitempty"`
	// Background declares that starting this tool remains valid when newer
	// user speech arrives. It is for non-consequential work whose purpose is to
	// continue while the agent listens, not a general exemption from stale
	// evidence: undeclared and mixed call batches still stop at that boundary.
	Background bool `json:"background,omitempty"`
	// Target names the declared context this tool acts on, when it acts on
	// one. A computer-use tool always has one; an ordinary function need not.
	Target     string     `json:"target,omitempty"`
	Dispatcher Dispatcher `json:"-"`
}

ToolSpec is a declared tool: its provider-facing schema, runtime-only argument transformation contract, confirmation requirement, and dispatcher.

type Tools

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

Tools dispatches authoritative calls through one boundary.

func NewTools

func NewTools(config ToolsConfig) (*Tools, error)

NewTools creates the dispatch path.

func (*Tools) Complete

func (tools *Tools) Complete(callID string)

Complete closes a client-executed commitment when its real or synthesised result joins the trajectory. It is idempotent at the caller: local actions are already complete, and a result for one simply leaves the terminal ledger state unchanged.

func (*Tools) Dispatch

func (tools *Tools) Dispatch(ctx context.Context, call trajectory.ToolCall) (trajectory.ToolResult, error)

Dispatch executes one call after checking that it has authority and, where declared, confirmation.

Idempotency is enforced here rather than hoped for: a call ID that has already produced a result returns that result without touching the dispatcher again.

func (*Tools) DispatchAll

func (tools *Tools) DispatchAll(ctx context.Context, calls []trajectory.ToolCall) ([]trajectory.ToolResult, error)

DispatchAll runs a complete call batch, preserving call order in the results. A batch that fails part way still returns what it completed: those effects happened and the trajectory must learn about them.

func (*Tools) EmitRemote

func (tools *Tools) EmitRemote(ctx context.Context, call trajectory.ToolCall) error

EmitRemote authorizes an executable call whose implementation belongs to the protocol client, then records that it crossed the action boundary.

Client execution is not a shortcut around the action plane. The call must already be authoritative in the trajectory, its declared confirmation is answered here, and its ledger transition happens before it is handed to the client. The eventual client result completes the commitment through Complete.

type ToolsConfig

type ToolsConfig struct {
	Registry *Registry
	Ledger   *Ledger
	// Store is the canonical trajectory. Dispatch reads it to verify that a
	// call was committed with execution authority, which is why authority
	// cannot be granted by whoever is calling Dispatch.
	Store *trajectory.Store
	// Confirmer authorizes actions whose declared requirement calls for it.
	// Nil means DenyAll.
	Confirmer Confirmer
	// Policy answers the "policy" confirmation requirement. Nil means the
	// requirement is treated as "always", which is the safe reading of a
	// deployment that declared a policy and then supplied none.
	Policy PolicyDecision
	// Audit receives every dispatch attempt and outcome. Every executed action
	// is already a trajectory item with causal parents; this is the
	// operational mirror of that, for a deployment that wants one.
	Audit func(Record)
}

ToolsConfig configures dispatch.

type Utterance

type Utterance struct {
	// ID is the commitment ID in the ledger.
	ID               string           `json:"id"`
	Text             string           `json:"text"`
	Phase            trajectory.Phase `json:"phase,omitempty"`
	SourceRevision   uint64           `json:"source_revision,omitempty"`
	AssistantItemIDs []string         `json:"assistant_item_ids,omitempty"`
	// Continuer marks a listener backchannel rather than a turn: a short "mm-hm"
	// the agent chose to emit while the user is still speaking. It is audio
	// reaching the user like any other, so it crosses the same commit boundary
	// - but it is not the agent taking the floor, and treating the user's
	// continuing speech over it as a barge-in would have the agent interrupt
	// itself for saying it was listening.
	Continuer bool `json:"continuer,omitempty"`
	// SpokeOver marks speech the agent began on purpose while somebody else
	// held the floor. A continuer is one case of it; an interruption and a
	// speak-through are the others.
	//
	// Barge-in asks whether somebody took the floor from the agent. Nobody did
	// here: the agent walked into speech that was already in progress, so the
	// overlap is the utterance's premise rather than evidence against it.
	// Measured, without this every correction was decided, worded, and then
	// cancelled by the sentence it was correcting after a single
	// hundred-millisecond frame had gone out, so nothing audible ever reached
	// the person it was for.
	//
	// It says which act produced the speech, and is not derived from the
	// duplex state when the audio is queued. The recogniser cuts one
	// continuous sentence into several stretches, and a rule keyed on the
	// stretch in progress fails exactly when the person keeps talking - which
	// is the case this exists for. What bounds talking over somebody is the
	// act's own brevity and scarcity, not barge-in.
	SpokeOver bool `json:"spoke_over,omitempty"`
}

Utterance is one unit of speech on its way to the world.

Jump to

Keyboard shortcuts

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