Package org.springframework.ai.openai
Class OpenAiEmbeddingModel.Builder
java.lang.Object
org.springframework.ai.openai.OpenAiEmbeddingModel.Builder
- Enclosing class:
- OpenAiEmbeddingModel
-
Method Summary
Modifier and TypeMethodDescriptionbuild()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.metadataMode(@Nullable MetadataMode metadataMode) observationRegistry(@Nullable io.micrometer.observation.ObservationRegistry observationRegistry) openAiClient(@Nullable com.openai.client.OpenAIClient openAiClient) options(@Nullable OpenAiEmbeddingOptions options)
-
Method Details
-
openAiClient
public OpenAiEmbeddingModel.Builder openAiClient(@Nullable com.openai.client.OpenAIClient openAiClient) -
options
-
metadataMode
-
observationRegistry
public OpenAiEmbeddingModel.Builder observationRegistry(@Nullable io.micrometer.observation.ObservationRegistry observationRegistry) -
httpClientBuilderCustomizer
public OpenAiEmbeddingModel.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 OpenAiEmbeddingModel.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
-