There is a circular reference in OpenAIProperties
public static class Embedding {
private final OpenAiProperties openAiProperties;
Investigate.
Comment From: tzolov
As with other model clients we need a dedicated property classes for the chat and the embedding models and use a common connection properties for both models:
- OpenAiConnectionProperties (baseUrl, apiKey) with prefix
spring.ai.openai.*
. - OpenAiChatProperties (model, temperature) with prefix
spring.ai.openai.chat
. - OpenAiEmbeddingProperties (model) with prefix
spring.ai.openai.embedding.*
Additionally the OpenAiChatProperties and OpenAiEmbeddingProperties should be allowed to override the OpenAiConnectionProperties so that we can use the Chat model from one Provider and the Embedding model from another. For example chat OpenAi and TAS/Llama2+OpenAIAPI for embedding.
https://docs.spring.io/spring-ai/reference/api/clients/openai.html#_openai_properties