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
- type Capability
- type ElevenLabsSTT
- type ElevenLabsSTTOption
- type ElevenLabsTTS
- type ElevenLabsTTSOption
- type OpenAISTT
- type OpenAISTTOption
- func WithSTTBaseURL(url string) OpenAISTTOption
- func WithSTTHTTPClient(hc *http.Client) OpenAISTTOption
- func WithSTTLanguage(lang string) OpenAISTTOption
- func WithSTTModel(model string) OpenAISTTOption
- func WithSTTProviderName(name string) OpenAISTTOption
- func WithSTTResponseFormat(format string) OpenAISTTOption
- type OpenAITTS
- type OpenAITTSOption
- func WithTTSBaseURL(url string) OpenAITTSOption
- func WithTTSFormat(format string) OpenAITTSOption
- func WithTTSHTTPClient(hc *http.Client) OpenAITTSOption
- func WithTTSModel(model string) OpenAITTSOption
- func WithTTSProviderName(name string) OpenAITTSOption
- func WithTTSVoice(voice string) OpenAITTSOption
- type Profile
Constants ¶
const APIElevenLabs = internalproviders.APIElevenLabs
APIElevenLabs is the Profile.API value of ElevenLabs.
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
ProfileFor returns the audio profile of a provider ID.