About below code:

chatClient = ChatClient.create(chatModel);
chatClient = ChatClient.builder(chatModel).build();

It's working for OpenAiChatModel and OllamaChatModel

Actually, it was working for AzureOpenAiChatModel as well before spring-ai-azure-openai-1.0.0-20240925 , but I'm not sure what date the jar was from. But it isn't working for AzureOpenAiChatModel now, due to the following error: "responseFormat must not be null"

It's from the following class: spring-ai-azure-openai/1.0.0-SNAPSHOT /spring-ai-azure-openai-1.0.0-20240925.165056-619.jar! /org/springframework/ai/azure/openai/AzureOpenAiChatOptions.class

Assert.notNull(responseFormat, "responseFormat must not be null");

Is there a default AzureOpenAiChatOptions available?

Issue Category

  • [ ] Enhancement
  • [ ] Bug
  • [-] Question
  • [ ] Documentation gap/issue

Product Versions

  • 3.2.5
  • 1.0.0-SNAPSHOT

Desired Behavior

Actually, I want to use the default AzureOpenAiChatOptions without having to set them myself, as I don't know how to properly configure them. I currently don't care about these options, but: - "Function names must not be null" - "responseFormat must not be null" - "logprobs must not be null" - "topLogprobs must not be null" - "enhancements must not be null"

Is there a default AzureOpenAiChatOptions available?

Observed Behavior

I've tried below approach but it's not working:

AzureOpenAiChatOptions.ResponseFormat responseFormat = AzureOpenAiChatOptions.ResponseFormat.TEXT;
AzureOpenAiChatOptions chatOptions = AzureOpenAiChatOptions.builder()
    .withDeploymentName("gpt-4o")
    .withTemperature(0.7)
    .withResponseFormat(responseFormat)
    .build();

I got the following error: "seed must not be null"

Comment From: bala-ayalur

I faced the same issue and switched back to the 1.0.0-20240919.222959-603 version of spring-ai-azure-openai for now.

Comment From: sobychacko

This was a bug and was fixed very recently via https://github.com/spring-projects/spring-ai/commit/e29d38d987d9aabdb35cf87321b13bb33dbdb871. Please try the latest snapshots. Thanks!