Package org.springframework.ai.openai
Class OpenAiAudioSpeechOptions
java.lang.Object
org.springframework.ai.openai.AbstractOpenAiOptions
org.springframework.ai.openai.OpenAiAudioSpeechOptions
- All Implemented Interfaces:
TextToSpeechOptions,ModelOptions
Configuration options for OpenAI text-to-speech using the OpenAI Java SDK.
- Author:
- Ahmed Yousri, Hyunjoon Choi, Jonghoon Park, Ilayaperumal Gopinathan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic final classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Doublestatic final StringFields inherited from class org.springframework.ai.openai.AbstractOpenAiOptions
DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()copy()Returns a copy of thisTextToSpeechOptions.boolean@Nullable StringReturns the output format for the generated audio.@Nullable StringgetInput()@Nullable StringgetModel()Returns the model to use for text-to-speech.@Nullable String@Nullable DoublegetSpeed()Returns the speed of the generated speech.@Nullable StringgetVoice()Returns the voice to use for text-to-speech.inthashCode()voidvoidvoidsetResponseFormat(@Nullable String responseFormat) voidsetResponseFormat(@Nullable OpenAiAudioSpeechOptions.AudioResponseFormat responseFormat) voidvoidvoidsetVoice(@Nullable OpenAiAudioSpeechOptions.Voice voice) toString()Methods inherited from class org.springframework.ai.openai.AbstractOpenAiOptions
getApiKey, getBaseUrl, getCredential, getCustomHeaders, getDeploymentName, getMaxRetries, getMicrosoftDeploymentName, getMicrosoftFoundryServiceVersion, getOrganizationId, getProxy, getTimeout, isGitHubModels, isMicrosoftFoundry, setApiKey, setBaseUrl, setCredential, setCustomHeaders, setDeploymentName, setGitHubModels, setMaxRetries, setMicrosoftDeploymentName, setMicrosoftFoundry, setMicrosoftFoundryServiceVersion, setOrganizationId, setProxy, setTimeout
-
Field Details
-
DEFAULT_SPEECH_MODEL
- See Also:
-
DEFAULT_VOICE
-
DEFAULT_RESPONSE_FORMAT
-
DEFAULT_SPEED
-
-
Constructor Details
-
OpenAiAudioSpeechOptions
public OpenAiAudioSpeechOptions()
-
-
Method Details
-
builder
-
getModel
Description copied from interface:TextToSpeechOptionsReturns the model to use for text-to-speech.- Specified by:
getModelin interfaceTextToSpeechOptions- Overrides:
getModelin classAbstractOpenAiOptions- Returns:
- The model name.
-
setModel
- Overrides:
setModelin classAbstractOpenAiOptions
-
getInput
-
setInput
-
getVoice
Description copied from interface:TextToSpeechOptionsReturns the voice to use for text-to-speech.- Specified by:
getVoicein interfaceTextToSpeechOptions- Returns:
- The voice identifier.
-
setVoice
-
setVoice
-
getResponseFormat
-
setResponseFormat
-
setResponseFormat
public void setResponseFormat(@Nullable OpenAiAudioSpeechOptions.AudioResponseFormat responseFormat) -
getSpeed
Description copied from interface:TextToSpeechOptionsReturns the speed of the generated speech.- Specified by:
getSpeedin interfaceTextToSpeechOptions- Returns:
- The speech speed.
-
setSpeed
-
getFormat
Description copied from interface:TextToSpeechOptionsReturns the output format for the generated audio.- Specified by:
getFormatin interfaceTextToSpeechOptions- Returns:
- The output format (e.g., "mp3", "wav").
-
copy
Description copied from interface:TextToSpeechOptionsReturns a copy of thisTextToSpeechOptions.- Specified by:
copyin interfaceTextToSpeechOptions- Returns:
- a copy of this
TextToSpeechOptions
-
equals
-
hashCode
public int hashCode() -
toString
-