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
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions defaultOptions) ElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions defaultOptions, org.springframework.core.retry.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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface StreamingTextToSpeechModel
stream, streamMethods inherited from interface TextToSpeechModel
call
-
Constructor Details
-
ElevenLabsTextToSpeechModel
public ElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions defaultOptions) -
ElevenLabsTextToSpeechModel
public ElevenLabsTextToSpeechModel(ElevenLabsApi elevenLabsApi, ElevenLabsTextToSpeechOptions defaultOptions, org.springframework.core.retry.RetryTemplate retryTemplate)
-
-
Method Details
-
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
-
getDefaultOptions
- Specified by:
getDefaultOptionsin interfaceTextToSpeechModel
-