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
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.