Package org.springframework.ai.openai
Class OpenAiAudioSpeechModel
java.lang.Object
org.springframework.ai.openai.OpenAiAudioSpeechModel
- All Implemented Interfaces:
org.springframework.ai.audio.tts.StreamingTextToSpeechModel,org.springframework.ai.audio.tts.TextToSpeechModel,org.springframework.ai.model.Model<org.springframework.ai.audio.tts.TextToSpeechPrompt,,org.springframework.ai.audio.tts.TextToSpeechResponse> org.springframework.ai.model.StreamingModel<org.springframework.ai.audio.tts.TextToSpeechPrompt,org.springframework.ai.audio.tts.TextToSpeechResponse>
public final class OpenAiAudioSpeechModel
extends Object
implements org.springframework.ai.audio.tts.TextToSpeechModel
OpenAI audio speech client implementation using the OpenAI Java SDK.
- Author:
- Ahmed Yousri, Hyunjoon Choi, Thomas Vitale, Jonghoon Park, Ilayaperumal Gopinathan, Sebastien Deleuze, guan xu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for creating OpenAiAudioSpeechModel instances. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a new builder instance with default configuration.byte[]org.springframework.ai.audio.tts.TextToSpeechResponsecall(org.springframework.ai.audio.tts.TextToSpeechPrompt prompt) org.springframework.ai.audio.tts.TextToSpeechOptionsDeprecated, for removal: This API element is subject to removal in a future version.mutate()Creates a builder initialized with this model's configuration.reactor.core.publisher.Flux<org.springframework.ai.audio.tts.TextToSpeechResponse>stream(org.springframework.ai.audio.tts.TextToSpeechPrompt prompt) 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, stream
-
Method Details
-
builder
Creates a new builder instance with default configuration.- Returns:
- A new builder instance
-
mutate
Creates a builder initialized with this model's configuration.- Returns:
- A builder for creating a modified copy
-
call
- Specified by:
callin interfaceorg.springframework.ai.audio.tts.TextToSpeechModel
-
call
public org.springframework.ai.audio.tts.TextToSpeechResponse call(org.springframework.ai.audio.tts.TextToSpeechPrompt prompt) - Specified by:
callin interfaceorg.springframework.ai.model.Model<org.springframework.ai.audio.tts.TextToSpeechPrompt,org.springframework.ai.audio.tts.TextToSpeechResponse> - Specified by:
callin interfaceorg.springframework.ai.audio.tts.TextToSpeechModel
-
stream
public reactor.core.publisher.Flux<org.springframework.ai.audio.tts.TextToSpeechResponse> stream(org.springframework.ai.audio.tts.TextToSpeechPrompt prompt) - Specified by:
streamin interfaceorg.springframework.ai.model.StreamingModel<org.springframework.ai.audio.tts.TextToSpeechPrompt,org.springframework.ai.audio.tts.TextToSpeechResponse> - Specified by:
streamin interfaceorg.springframework.ai.audio.tts.StreamingTextToSpeechModel
-
getOptions
- Specified by:
getOptionsin interfaceorg.springframework.ai.audio.tts.TextToSpeechModel- Since:
- 2.0.0
-
getDefaultOptions
@Deprecated(forRemoval=true) public org.springframework.ai.audio.tts.TextToSpeechOptions getDefaultOptions()Deprecated, for removal: This API element is subject to removal in a future version.usegetOptions()instead.- Specified by:
getDefaultOptionsin interfaceorg.springframework.ai.audio.tts.TextToSpeechModel
-
getOptions()instead.