asr

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ElevenLabsSupportedModelID

func ElevenLabsSupportedModelID() string

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 AudioModelTranscriber

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

func NewAudioModelTranscriber

func NewAudioModelTranscriber(modelCfg *config.ModelConfig) *AudioModelTranscriber

func (*AudioModelTranscriber) Name

func (t *AudioModelTranscriber) Name() string

func (*AudioModelTranscriber) Transcribe

func (t *AudioModelTranscriber) Transcribe(ctx context.Context, audioFilePath string) (*TranscriptionResponse, error)

type ElevenLabsTranscriber

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

ElevenLabsTranscriber uses the ElevenLabs Scribe API for speech-to-text.

func NewElevenLabsTranscriber

func NewElevenLabsTranscriber(apiKey, apiBase, modelID string) *ElevenLabsTranscriber

func (*ElevenLabsTranscriber) Name

func (t *ElevenLabsTranscriber) Name() string

func (*ElevenLabsTranscriber) Transcribe

func (t *ElevenLabsTranscriber) Transcribe(ctx context.Context, audioFilePath string) (*TranscriptionResponse, error)

type Transcriber

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

func DetectTranscriber

func DetectTranscriber(cfg *config.Config) Transcriber

DetectTranscriber inspects cfg and returns the appropriate Transcriber, or nil if no supported transcription provider is configured.

type TranscriptionResponse

type TranscriptionResponse struct {
	Text     string  `json:"text"`
	Language string  `json:"language,omitempty"`
	Duration float64 `json:"duration,omitempty"`
}

type WhisperTranscriber

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

func NewGroqTranscriber

func NewGroqTranscriber(apiKey, modelID string) *WhisperTranscriber

func NewWhisperTranscriber

func NewWhisperTranscriber(modelCfg *config.ModelConfig) *WhisperTranscriber

func (*WhisperTranscriber) Name

func (t *WhisperTranscriber) Name() string

func (*WhisperTranscriber) Transcribe

func (t *WhisperTranscriber) Transcribe(ctx context.Context, audioFilePath string) (*TranscriptionResponse, error)

func (*WhisperTranscriber) TranscribeData

func (t *WhisperTranscriber) TranscribeData(
	ctx context.Context,
	data []byte,
	filename string,
) (*TranscriptionResponse, error)

Jump to

Keyboard shortcuts

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