-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Expected Behavior
Including the spring-ai-starter-model-azure-openai starter causes
AzureOpenAiClientBuilderConfiguration to eagerly create an
OpenAIClientBuilder even when no Azure OpenAI properties are defined and Azure OpenAI is not used as a model provider.
This leads to startup failures when applications include the starter
but - depending on the Spring profile used - use a different AI model provider or none at all. I would expect the startup to not fail as long as no Azure OpenAI model is required.
I'm not sure in what situations the OpenAIClientBuilder is used. The guard in AzureOpenAiEmbeddingAutoConfiguration works by checking the Spring property spring.ai.model.embedding for the value azure-openai. See here. Maybe the same guard could be used to decide whether a OpenAIClientBuilder needs to be created.
Current Behavior
For the application start to work, we need to set a dummy value for spring.ai.azure.openai.endpoint. Without this workaround, the start fails because of this assertion.
It would be nice if no such workaround is required in order for the application start to succeed.