SpeechProviderSelector

org.llm4s.speech.SpeechProviderSelector

Routes speech provider configuration to the appropriate TTS or STT client.

Provider selection follows the same provider/model prefix pattern used for LLM providers. The model format, set through SPEECH_TTS_MODEL / SPEECH_STT_MODEL (see org.llm4s.speech.config.SpeechConfigLoader), is: openai/tts-1, elevenlabs/ , azure/ (TTS) openai/whisper-1, azure/en-US (STT)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

Returns a SpeechToText implementation for the given configuration. Dispatches based on cfg.provider:

Returns a SpeechToText implementation for the given configuration. Dispatches based on cfg.provider:

Value parameters

cfg

STT provider configuration

Attributes

Returns

Right(SpeechToText) on success, Left(ConfigurationError) for unknown provider

Returns a TextToSpeech implementation for the given configuration. Dispatches based on cfg.provider:

Returns a TextToSpeech implementation for the given configuration. Dispatches based on cfg.provider:

Value parameters

cfg

TTS provider configuration

Attributes

Returns

Right(TextToSpeech) on success, Left(ConfigurationError) for unknown provider

def parseModelSpec(modelSpec: String): Result[(String, String)]

Parses a provider/model format string and returns the provider and model parts.

Parses a provider/model format string and returns the provider and model parts.

Value parameters

modelSpec

Format: "provider/model", e.g. "openai/tts-1", "elevenlabs/voice-id"

Attributes

Returns

Right((provider, model)) or Left(ConfigurationError) if format is invalid

The STT client selected by llm4s.speech.stt.model, with credentials read from configuration.

The STT client selected by llm4s.speech.stt.model, with credentials read from configuration.

Attributes

def stt(source: ConfigSource): Result[SpeechToText]

As stt, reading source.

As stt, reading source.

Attributes

The TTS client selected by llm4s.speech.tts.model, with credentials read from configuration.

The TTS client selected by llm4s.speech.tts.model, with credentials read from configuration.

Attributes

def tts(source: ConfigSource): Result[TextToSpeech]

As tts, reading source.

As tts, reading source.

Attributes