Package org.springframework.ai.openai
Class OpenAiAudioSpeechModel.Builder
java.lang.Object
org.springframework.ai.openai.OpenAiAudioSpeechModel.Builder
- Enclosing class:
- OpenAiAudioSpeechModel
Builder for creating OpenAiAudioSpeechModel instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the OpenAiAudioSpeechModel instance.Registers anOpenAiHttpClientBuilderCustomizerthat mutates the underlying OkHttp client builder before the OpenAI clients are constructed.Sets the full list ofcustomizersto apply, replacing any customizers registered earlier on this builder.openAiClient(@Nullable com.openai.client.OpenAIClient openAiClient) Sets the OpenAIClient.options(@Nullable OpenAiAudioSpeechOptions options) Sets the default options.
-
Method Details
-
openAiClient
public OpenAiAudioSpeechModel.Builder openAiClient(@Nullable com.openai.client.OpenAIClient openAiClient) Sets the OpenAIClient.- Parameters:
openAiClient- The OpenAIClient to use- Returns:
- This builder
-
options
Sets the default options.- Parameters:
options- The default options to use- Returns:
- This builder
-
httpClientBuilderCustomizer
public OpenAiAudioSpeechModel.Builder httpClientBuilderCustomizer(OpenAiHttpClientBuilderCustomizer customizer) Registers anOpenAiHttpClientBuilderCustomizerthat mutates the underlying OkHttp client builder before the OpenAI clients are constructed. Use this to attach OkHttp interceptors (e.g. OAuth2 bearer-token injection), swap the dispatcher executor, or tweak any other OkHttp setting. Customizers are applied in the order they are registered, after Spring AI's own defaults, so user code wins. -
httpClientBuilderCustomizers
public OpenAiAudioSpeechModel.Builder httpClientBuilderCustomizers(List<OpenAiHttpClientBuilderCustomizer> customizers) Sets the full list ofcustomizersto apply, replacing any customizers registered earlier on this builder. The order of the list is preserved when invoking the customizers. -
build
Builds the OpenAiAudioSpeechModel instance.- Returns:
- A new OpenAiAudioSpeechModel instance
-