Package org.springframework.ai.openai
Class OpenAiAudioSpeechModel
java.lang.Object
org.springframework.ai.openai.OpenAiAudioSpeechModel
- All Implemented Interfaces:
StreamingTextToSpeechModel,TextToSpeechModel,Model<TextToSpeechPrompt,,TextToSpeechResponse> StreamingModel<TextToSpeechPrompt,TextToSpeechResponse>
OpenAI audio speech client implementation using the OpenAI Java SDK.
- Author:
- Ahmed Yousri, Hyunjoon Choi, Thomas Vitale, Jonghoon Park, Ilayaperumal Gopinathan
-
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[]call(TextToSpeechPrompt prompt) Executes a method call to the AI model.mutate()Creates a builder initialized with this model's configuration.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, 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 interfaceTextToSpeechModel
-
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
-