audioproviders

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package audioproviders exposes seshat's stt.SpeechToText and tts.Generation implementations for direct use by a host application, independent of the agent/tool loop.

Index

Constants

APIElevenLabs is the Profile.API value of ElevenLabs.

View Source
const ResponseFormatOmit = internalproviders.ResponseFormatOmit

ResponseFormatOmit makes an STT client send no response_format field.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capability added in v1.8.0

type Capability = internalproviders.Capability

Capability lists the models a provider offers for one direction.

type ElevenLabsSTT added in v1.8.0

type ElevenLabsSTT = internalproviders.ElevenLabsSTT

ElevenLabsSTT transcribes audio with ElevenLabs Scribe.

func NewElevenLabsSTT added in v1.8.0

func NewElevenLabsSTT(apiKey string, opts ...ElevenLabsSTTOption) *ElevenLabsSTT

NewElevenLabsSTT creates an ElevenLabs Scribe client.

type ElevenLabsSTTOption added in v1.8.0

type ElevenLabsSTTOption = internalproviders.ElevenLabsSTTOption

ElevenLabsSTTOption configures an ElevenLabsSTT client.

func WithElevenLabsSTTBaseURL added in v1.8.0

func WithElevenLabsSTTBaseURL(baseURL string) ElevenLabsSTTOption

WithElevenLabsSTTBaseURL overrides the API root.

func WithElevenLabsSTTLanguage added in v1.8.0

func WithElevenLabsSTTLanguage(language string) ElevenLabsSTTOption

WithElevenLabsSTTLanguage sets an ISO-639 language code; empty auto-detects.

func WithElevenLabsSTTModel added in v1.8.0

func WithElevenLabsSTTModel(model string) ElevenLabsSTTOption

WithElevenLabsSTTModel sets the Scribe model (default scribe_v2).

type ElevenLabsTTS added in v1.8.0

type ElevenLabsTTS = internalproviders.ElevenLabsTTS

ElevenLabsTTS synthesises speech with ElevenLabs (its own API, not OpenAI-compatible). A voice_id is optional: without one the first voice of the account is used.

func NewElevenLabsTTS added in v1.8.0

func NewElevenLabsTTS(apiKey string, opts ...ElevenLabsTTSOption) *ElevenLabsTTS

NewElevenLabsTTS creates an ElevenLabs text-to-speech client.

type ElevenLabsTTSOption added in v1.8.0

type ElevenLabsTTSOption = internalproviders.ElevenLabsTTSOption

ElevenLabsTTSOption configures an ElevenLabsTTS client.

func WithElevenLabsTTSBaseURL added in v1.8.0

func WithElevenLabsTTSBaseURL(baseURL string) ElevenLabsTTSOption

WithElevenLabsTTSBaseURL overrides the API root (for example a regional host).

func WithElevenLabsTTSFormat added in v1.8.0

func WithElevenLabsTTSFormat(format string) ElevenLabsTTSOption

WithElevenLabsTTSFormat sets mp3, wav, opus, pcm or a full output_format.

func WithElevenLabsTTSModel added in v1.8.0

func WithElevenLabsTTSModel(model string) ElevenLabsTTSOption

WithElevenLabsTTSModel sets the model (default eleven_multilingual_v2).

func WithElevenLabsTTSVoice added in v1.8.0

func WithElevenLabsTTSVoice(voice string) ElevenLabsTTSOption

WithElevenLabsTTSVoice sets the voice_id.

type OpenAISTT

type OpenAISTT = internalproviders.OpenAISTT

OpenAISTT transcribes audio using OpenAI Whisper - or, via WithSTTBaseURL, any OpenAI-API-compatible transcription server, such as a locally running whisper.cpp server (no API key required in that case, since local servers don't check the Authorization header).

func NewOpenAISTT

func NewOpenAISTT(apiKey string, opts ...OpenAISTTOption) *OpenAISTT

NewOpenAISTT creates an OpenAI Whisper STT client. audioData passed to Transcribe may be MP3, MP4, MPEG, MPGA, M4A, WAV, or WebM.

type OpenAISTTOption

type OpenAISTTOption = internalproviders.OpenAISTTOption

OpenAISTTOption configures an OpenAISTT client.

func WithSTTBaseURL

func WithSTTBaseURL(url string) OpenAISTTOption

WithSTTBaseURL overrides the default endpoint - point this at a self-hosted, OpenAI-API-compatible transcription server (e.g. a local whisper.cpp server) instead of the real OpenAI cloud.

func WithSTTHTTPClient

func WithSTTHTTPClient(hc *http.Client) OpenAISTTOption

WithSTTHTTPClient injects a custom HTTP client.

func WithSTTLanguage

func WithSTTLanguage(lang string) OpenAISTTOption

WithSTTLanguage sets the IETF language tag; empty means auto-detect.

func WithSTTModel

func WithSTTModel(model string) OpenAISTTOption

WithSTTModel sets the transcription model (default "whisper-1").

func WithSTTProviderName added in v1.8.0

func WithSTTProviderName(name string) OpenAISTTOption

WithSTTProviderName sets the name an STT client reports from Provider().

func WithSTTResponseFormat added in v1.8.0

func WithSTTResponseFormat(format string) OpenAISTTOption

WithSTTResponseFormat forces the response_format an STT client sends; empty chooses from the model, ResponseFormatOmit sends none.

type OpenAITTS

type OpenAITTS = internalproviders.OpenAITTS

OpenAITTS synthesises speech using OpenAI's TTS models.

func NewOpenAITTS

func NewOpenAITTS(apiKey string, opts ...OpenAITTSOption) *OpenAITTS

NewOpenAITTS creates an OpenAI text-to-speech client.

type OpenAITTSOption

type OpenAITTSOption = internalproviders.OpenAITTSOption

OpenAITTSOption configures an OpenAITTS client.

func WithTTSBaseURL

func WithTTSBaseURL(url string) OpenAITTSOption

WithTTSBaseURL overrides the default endpoint - point this at a self-hosted, OpenAI-API-compatible TTS server instead of the real OpenAI cloud.

func WithTTSFormat

func WithTTSFormat(format string) OpenAITTSOption

WithTTSFormat sets the output audio format (e.g. "mp3", "wav").

func WithTTSHTTPClient

func WithTTSHTTPClient(hc *http.Client) OpenAITTSOption

WithTTSHTTPClient injects a custom HTTP client.

func WithTTSModel

func WithTTSModel(model string) OpenAITTSOption

WithTTSModel sets the TTS model.

func WithTTSProviderName added in v1.8.0

func WithTTSProviderName(name string) OpenAITTSOption

WithTTSProviderName sets the name a TTS client reports from Provider().

func WithTTSVoice

func WithTTSVoice(voice string) OpenAITTSOption

WithTTSVoice sets the voice (e.g. "alloy", "nova").

type Profile added in v1.8.0

type Profile = internalproviders.Profile

Profile describes a provider that serves speech over the OpenAI-compatible audio API: its endpoint, key variables and STT/TTS models.

func ProfileFor added in v1.8.0

func ProfileFor(id string) (Profile, bool)

ProfileFor returns the audio profile of a provider ID.

func Profiles added in v1.8.0

func Profiles() []Profile

Profiles returns the audio providers this build knows (OpenAI, Groq, Mistral).

Jump to

Keyboard shortcuts

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