asr

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

func NewAgent

func NewAgent(mb *bus.MessageBus, t Transcriber) *Agent

func (*Agent) Start

func (a *Agent) Start(ctx context.Context)

type Transcriber

type Transcriber interface {
	Name() string
	Transcribe(ctx context.Context, audioFilePath string) (*TranscriptionResponse, error)
}

Transcriber turns recorded speech into text.

func DetectTranscriber

func DetectTranscriber(cfg *config.Config) Transcriber

DetectTranscriber returns the transcriber of cfg's speech-to-text target, cfg.Voice.STTTarget, on its instance's core provider; a chat model when cfg.Voice.STTViaChat opts in, provided its catalog declares audio input (see modelservice.CheckChatTranscriptionTarget). It returns nil, which turns voice transcription off, when no target is configured or the target cannot transcribe.

func NewTranscriber

func NewTranscriber(client *voice.Client) Transcriber

NewTranscriber returns the Transcriber of a speech-to-text voice client. Its transcripts hold only recognized speech: one without speech is empty (see voice.RecognizedSpeech).

type TranscriptionResponse

type TranscriptionResponse = voice.Transcription

TranscriptionResponse is a transcription.

Jump to

Keyboard shortcuts

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