Class ElevenLabsTextToSpeechModel
java.lang.Object
org.springframework.ai.elevenlabs.ElevenLabsTextToSpeechModel
- All Implemented Interfaces:
StreamingTextToSpeechModel,TextToSpeechModel,Model<TextToSpeechPrompt,,TextToSpeechResponse> StreamingModel<TextToSpeechPrompt,TextToSpeechResponse>
Implementation of the
TextToSpeechModel interface for ElevenLabs TTS API.- Author:
- Alexandros Pappas, Sebastien Deleuze
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions options) ElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions options, org.springframework.core.retry.RetryTemplate retryTemplate) ElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions options, org.springframework.core.retry.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry) Creates a model that reports its calls to the given observation registry. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()call(TextToSpeechPrompt prompt) Executes a method call to the AI model.Deprecated, for removal: This API element is subject to removal in a future version.Gets the options for this model.voidsetObservationConvention(TextToSpeechModelObservationConvention observationConvention) Use the provided convention for reporting observation data.reactor.core.publisher.Flux<TextToSpeechResponse>stream(TextToSpeechPrompt prompt) Executes a method call to the AI model.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.audio.tts.StreamingTextToSpeechModel
stream, streamMethods inherited from interface org.springframework.ai.audio.tts.TextToSpeechModel
call
-
Constructor Details
-
ElevenLabsTextToSpeechModel
public ElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions options) -
ElevenLabsTextToSpeechModel
public ElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions options, org.springframework.core.retry.RetryTemplate retryTemplate) -
ElevenLabsTextToSpeechModel
public ElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions options, org.springframework.core.retry.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry) Creates a model that reports its calls to the given observation registry.- Parameters:
elevenLabsApi- the ElevenLabs API clientoptions- the default optionsretryTemplate- the retry templateobservationRegistry- the observation registry,ObservationRegistry.NOOPfor none- Since:
- 2.0.2
-
-
Method Details
-
setObservationConvention
Use the provided convention for reporting observation data.- Parameters:
observationConvention- the provided convention- Since:
- 2.0.2
-
builder
-
call
Description copied from interface:ModelExecutes a method call to the AI model.- Specified by:
callin interfaceModel<TextToSpeechPrompt,TextToSpeechResponse> - Specified by:
callin interfaceTextToSpeechModel- Parameters:
prompt- the request object to be sent to the AI model- Returns:
- the response from the AI model
-
stream
Description copied from interface:StreamingModelExecutes a method call to the AI model.- Specified by:
streamin interfaceStreamingModel<TextToSpeechPrompt,TextToSpeechResponse> - Specified by:
streamin interfaceStreamingTextToSpeechModel- Parameters:
prompt- the request object to be sent to the AI model- Returns:
- the streaming response from the AI model
-
getOptions
Description copied from interface:TextToSpeechModelGets the options for this model.- Specified by:
getOptionsin interfaceTextToSpeechModel- Returns:
- the options
- Since:
- 2.0.0
-
getDefaultOptions
Deprecated, for removal: This API element is subject to removal in a future version.usegetOptions()instead.- Specified by:
getDefaultOptionsin interfaceTextToSpeechModel
-
getOptions()instead.