Package org.springframework.ai.openai
Class OpenAiAudioTranscriptionModel.Builder
java.lang.Object
org.springframework.ai.openai.OpenAiAudioTranscriptionModel.Builder
- Enclosing class:
- OpenAiAudioTranscriptionModel
Builder for creating
OpenAiAudioTranscriptionModel instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newOpenAiAudioTranscriptionModelinstance.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(com.openai.client.OpenAIClient openAiClient) Sets the OpenAI client.options(OpenAiAudioTranscriptionOptions options) Sets the transcription options.
-
Method Details
-
openAiClient
public OpenAiAudioTranscriptionModel.Builder openAiClient(com.openai.client.OpenAIClient openAiClient) Sets the OpenAI client.- Parameters:
openAiClient- the OpenAI client- Returns:
- this builder
-
options
Sets the transcription options.- Parameters:
options- the transcription options- Returns:
- this builder
-
httpClientBuilderCustomizer
public OpenAiAudioTranscriptionModel.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 OpenAiAudioTranscriptionModel.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 a newOpenAiAudioTranscriptionModelinstance.- Returns:
- the configured transcription model
-