Documentation
¶
Overview ¶
Package companion provides small composers for hands-free SpeechKit hosts.
Index ¶
- Variables
- type HandsFree
- func (h *HandsFree) Assist() speechkit.AssistService
- func (h *HandsFree) Events() <-chan speechkit.Event
- func (h *HandsFree) HandleWake(ctx context.Context, ev wakeword.DetectionEvent) error
- func (h *HandsFree) ProcessAssist(ctx context.Context, req speechkit.AssistRequest) (speechkit.AssistResult, error)
- func (h *HandsFree) Runtime() *speechkit.Runtime
- func (h *HandsFree) Start(ctx context.Context) error
- func (h *HandsFree) Stop(ctx context.Context) error
- func (h *HandsFree) TTS() *tts.Service
- func (h *HandsFree) VoiceAgent() speechkit.VoiceAgentService
- func (h *HandsFree) WakeSink() wakeword.Sink
- type Options
- type WakeRequestFunc
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 (*HandsFree) Assist ¶
func (h *HandsFree) Assist() speechkit.AssistService
func (*HandsFree) HandleWake ¶
HandleWake publishes a wake event, forwards it to the optional downstream sink, and starts the configured Assist or Voice-Agent path.
func (*HandsFree) ProcessAssist ¶
func (h *HandsFree) ProcessAssist(ctx context.Context, req speechkit.AssistRequest) (speechkit.AssistResult, error)
ProcessAssist runs a one-shot Assist request through the configured service and, when TTS is present, synthesizes the spoken response.
func (*HandsFree) VoiceAgent ¶
func (h *HandsFree) VoiceAgent() speechkit.VoiceAgentService
type Options ¶
type Options struct {
Runtime *speechkit.Runtime
WakeSink wakeword.Sink
WakeRequest WakeRequestFunc
Assist speechkit.AssistService
VoiceAgent speechkit.VoiceAgentService
TTS *tts.Service
}
type WakeRequestFunc ¶
type WakeRequestFunc func(context.Context, wakeword.DetectionEvent) (speechkit.AssistRequest, bool)
WakeRequestFunc converts a wake detection into an Assist request. Hosts use it to attach their transcript/capture result to the framework composer.
Click to show internal directories.
Click to hide internal directories.