pkg

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func New

func New(modelsPath string, opt ...Opt) (*Manager, error)

New creates a new manager with a whisper client and optionally elevenlabs and openai clients if API keys are provided via Opts

func (*Manager) Close

func (m *Manager) Close() error

Close closes the manager and all clients

func (*Manager) DeleteModel

func (m *Manager) DeleteModel(ctx context.Context, modelID string) error

DeleteModel deletes a whisper model by id

func (*Manager) DownloadModel

func (m *Manager) DownloadModel(ctx context.Context, path string, fn func(cur, total uint64)) (*schema.Model, error)

DownloadModel downloads a whisper model by path

func (*Manager) GetModel

func (m *Manager) GetModel(ctx context.Context, modelID string) (*schema.Model, error)

GetModel retrieves a model by ID from all available sources

func (*Manager) ListModels

func (m *Manager) ListModels(ctx context.Context) []*schema.Model

ListModels returns all available models from whisper, openai, and elevenlabs

func (*Manager) Transcribe

Transcribe performs a transcription request in the language of the speech

func (*Manager) Translate

Translate performs a transcription request and returns the result in English

type Opt

type Opt func(*opts) error

func OptElevenLabsKey

func OptElevenLabsKey(key string) Opt

OptElevenLabsKey sets the ElevenLabs API key

func OptOpenAIKey

func OptOpenAIKey(key string) Opt

OptOpenAIKey sets the OpenAI API key

func WithClientOpts added in v0.0.36

func WithClientOpts(clientOpts ...goclient.ClientOpt) Opt

WithClientOpts appends client options applied to HTTP-based providers (ElevenLabs and OpenAI). This is useful for setting timeouts, tracing, headers, and other transport-level behaviors shared across providers.

func WithClientTimeout added in v0.0.36

func WithClientTimeout(d time.Duration) Opt

WithClientTimeout is a convenience wrapper to set the HTTP client timeout for ElevenLabs and OpenAI requests.

func WithSegmenterOpt added in v0.0.36

func WithSegmenterOpt(segmenterOpts ...segmenter.Opt) Opt

WithSegmenterOpt appends segmenter options applied to the audio segmenter used during transcription and translation.

func WithTracer added in v0.0.36

func WithTracer(tracer trace.Tracer) Opt

WithTracer sets the OpenTelemetry tracer for distributed tracing of transcription, translation, and model operations across all providers.

func WithWhisperOpt added in v0.0.36

func WithWhisperOpt(whisperOpts ...whisper.Opt) Opt

WithWhisperOpt appends whisper options applied to the whisper manager used during transcription and translation.

Directories

Path Synopsis
https://elevenlabs.io/docs/overview
https://elevenlabs.io/docs/overview
Package httpclient provides a typed Go client for consuming the go-whisper REST API.
Package httpclient provides a typed Go client for consuming the go-whisper REST API.
store
store implements a model store which allows downloading models from a remote server
store implements a model store which allows downloading models from a remote server

Jump to

Keyboard shortcuts

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