Class ElevenLabsTextToSpeechModel
java.lang.Object
org.springframework.ai.elevenlabs.ElevenLabsTextToSpeechModel
- All Implemented Interfaces:
StreamingTextToSpeechModel
,TextToSpeechModel
,Model<TextToSpeechPrompt,
,TextToSpeechResponse> StreamingModel<TextToSpeechPrompt,
TextToSpeechResponse>
public class ElevenLabsTextToSpeechModel
extends Object
implements TextToSpeechModel, StreamingTextToSpeechModel
Implementation of the
TextToSpeechModel
and StreamingTextToSpeechModel
interfaces- Author:
- Alexandros Pappas
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionElevenLabsTextToSpeechModel
(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions defaultOptions) ElevenLabsTextToSpeechModel
(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions defaultOptions, org.springframework.retry.support.RetryTemplate retryTemplate) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
call
(TextToSpeechPrompt prompt) Executes a method call to the AI model.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, wait
Methods inherited from interface org.springframework.ai.audio.tts.StreamingTextToSpeechModel
stream, stream
Methods inherited from interface org.springframework.ai.audio.tts.TextToSpeechModel
call
-
Constructor Details
-
ElevenLabsTextToSpeechModel
public ElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions defaultOptions) -
ElevenLabsTextToSpeechModel
public ElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions defaultOptions, org.springframework.retry.support.RetryTemplate retryTemplate)
-
-
Method Details
-
builder
-
call
Description copied from interface:Model
Executes a method call to the AI model.- Specified by:
call
in interfaceModel<TextToSpeechPrompt,
TextToSpeechResponse> - Specified by:
call
in 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:StreamingModel
Executes a method call to the AI model.- Specified by:
stream
in interfaceStreamingModel<TextToSpeechPrompt,
TextToSpeechResponse> - Specified by:
stream
in interfaceStreamingTextToSpeechModel
- Parameters:
prompt
- the request object to be sent to the AI model- Returns:
- the streaming response from the AI model
-
getDefaultOptions
- Specified by:
getDefaultOptions
in interfaceTextToSpeechModel
-