companion

package
v0.40.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package companion provides small composers for hands-free SpeechKit hosts.

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingAssist = errors.New("speechkit companion: assist service is required")
View Source
var ErrMissingContext = errors.New("speechkit companion: context is required")
View Source
var ErrMissingRuntime = errors.New("speechkit companion: runtime is required")

Functions

This section is empty.

Types

type HandsFree

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

func NewHandsFree

func NewHandsFree(opts Options) (*HandsFree, error)

func (*HandsFree) Assist

func (h *HandsFree) Assist() speechkit.AssistService

func (*HandsFree) Events

func (h *HandsFree) Events() <-chan speechkit.Event

func (*HandsFree) HandleWake

func (h *HandsFree) HandleWake(ctx context.Context, ev wakeword.DetectionEvent) error

HandleWake publishes a wake event, forwards it to the optional downstream sink, and starts the configured Assist or Voice-Agent path.

func (*HandsFree) ProcessAssist

ProcessAssist runs a one-shot Assist request through the configured service and, when TTS is present, synthesizes the spoken response.

func (*HandsFree) Runtime

func (h *HandsFree) Runtime() *speechkit.Runtime

func (*HandsFree) Start

func (h *HandsFree) Start(ctx context.Context) error

func (*HandsFree) Stop

func (h *HandsFree) Stop(ctx context.Context) error

func (*HandsFree) TTS

func (h *HandsFree) TTS() *tts.Service

func (*HandsFree) VoiceAgent

func (h *HandsFree) VoiceAgent() speechkit.VoiceAgentService

func (*HandsFree) WakeSink

func (h *HandsFree) WakeSink() wakeword.Sink

type Options

type Options struct {
	Runtime     *speechkit.Runtime
	WakeSink    wakeword.Sink
	WakeRequest WakeRequestFunc
	Assist      speechkit.AssistService
	VoiceAgent  speechkit.VoiceAgentService
	TTS         *tts.Service
}

type WakeRequestFunc

WakeRequestFunc converts a wake detection into an Assist request. Hosts use it to attach their transcript/capture result to the framework composer.

Jump to

Keyboard shortcuts

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