See https://github.com/spring-projects/spring-ai/issues/262 for initial discussion.

Comment From: emileastih1

Can I take this issue by creating a new PR ?

Comment From: emileastih1

I was looking at this issue, and I think the way that the class is created is sufficient and doesn't need any change because they are using constructor chaining to initialize a new instance of the OpenAiEmbeddingClient class.

Also there is already two constructors that takes "OpenAiEmbeddingOptions".

I was thinking about adding a new method called "withDefaultOptions" like what is suggested in the spring ai documentation but this is not needed because the initialization of the default options is done withing the constructors if the user didn't specify any, so it is already handled.

Finally, I think we could update the SpringAI documentation to match the actual code of the OpenAiEmbeddingClient class, but the only thing that is bugging me is to have different APIs (To initialize a new instance) for the OpenAiEmbeddingClient and for example OllamaEmbeddingClient which should practically be implemented in the same manner.

What do you think?

Comment From: emileastih1

The same thing goes for OpenAiChatClient.java

Comment From: jehyn923

Is anyone working on this issue?

Comment From: emileastih1

Hello @jehyn923 , I am the last one who commented on this issue and was waiting for a reply from [markpollack] to check how to move forward with the issue.

Comment From: markpollack

Apologies for my poor project management skills. Looks like we are good now.

    public AzureOpenAiEmbeddingModel(OpenAIClient azureOpenAiClient, MetadataMode metadataMode,
            AzureOpenAiEmbeddingOptions options) {