SpeechConfigLoader

org.llm4s.speech.config.SpeechConfigLoader

Loads TTSConfig and STTConfig from the llm4s.speech block of the application configuration, whose defaults and environment variables are declared in this module's reference.conf.

Provider selection is the provider/model form used for chat models:

SPEECH_TTS_MODEL=openai/tts-1            OPENAI_API_KEY=...
SPEECH_TTS_MODEL=elevenlabs/<voice-id>   ELEVENLABS_API_KEY=...
SPEECH_TTS_MODEL=azure/en-US-JennyNeural AZURE_SPEECH_KEY=... AZURE_SPEECH_REGION=...
SPEECH_STT_MODEL=openai/whisper-1        OPENAI_API_KEY=...
SPEECH_STT_MODEL=azure/en-US             AZURE_SPEECH_KEY=... AZURE_SPEECH_REGION=...

Only the selected provider's credentials are required.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

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

The STT configuration selected by llm4s.speech.stt.model.

The STT configuration selected by llm4s.speech.stt.model.

Value parameters

source

configuration to read, e.g. ConfigSource.default

Attributes

Returns

the provider's configuration, or a org.llm4s.error.ConfigurationError naming the missing or invalid key

def stt(modelSpec: String, source: ConfigSource): Result[STTConfig]

As tts(modelSpec, source), for speech-to-text: an explicit provider/model such as openai/whisper-1.

As tts(modelSpec, source), for speech-to-text: an explicit provider/model such as openai/whisper-1.

Attributes

def stt(modelSpec: String): Result[STTConfig]

stt(modelSpec, source) against the current environment.

stt(modelSpec, source) against the current environment.

Attributes

def stt(): Result[STTConfig]

stt(source) against the current environment.

stt(source) against the current environment.

Attributes

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

The TTS configuration selected by llm4s.speech.tts.model.

The TTS configuration selected by llm4s.speech.tts.model.

Value parameters

source

configuration to read, e.g. ConfigSource.default

Attributes

Returns

the provider's configuration, or a org.llm4s.error.ConfigurationError naming the missing or invalid key

def tts(modelSpec: String, source: ConfigSource): Result[TTSConfig]

The TTS configuration for an explicit provider/model (e.g. openai/tts-1), with that provider's credentials and endpoint read from source. For callers that choose the model themselves instead of through llm4s.speech.tts.model.

The TTS configuration for an explicit provider/model (e.g. openai/tts-1), with that provider's credentials and endpoint read from source. For callers that choose the model themselves instead of through llm4s.speech.tts.model.

Attributes

def tts(modelSpec: String): Result[TTSConfig]

tts(modelSpec, source) against the current environment.

tts(modelSpec, source) against the current environment.

Attributes

def tts(): Result[TTSConfig]

tts(source) against the current environment: system properties, application.conf and every reference.conf.

tts(source) against the current environment: system properties, application.conf and every reference.conf.

Attributes