Skip to content

Conversation

@sobychacko
Copy link
Contributor

This is related to #889

This commit addresses a bug where certain fields were being made indirectly mandatory due to Assert.notNull checks in the Builder's with* methods. Specifically:

  • Removed Assert.notNull checks from withResponseFormat, withSeed, withLogprobs, withTopLogprobs, and withEnhancements methods.

These checks were causing exceptions in AzureOpenAiChatModel.getDefaultOptions when not all fields were set, leading to failures in methods like ChatClient.create, even when using the AzureOpenAiChatModel constructor with OpenAIClient.

The removal of these checks aligns with the @JsonInclude(Include.NON_NULL) annotation on AzureOpenAiChatOptions, which already ignores null options. This change maintains the intended flexibility while preventing unintended mandatory requirements.

This is related to spring-projects#889

This commit addresses a bug where certain fields were being made
indirectly mandatory due to Assert.notNull checks in the Builder's
with* methods. Specifically:

- Removed Assert.notNull checks from withResponseFormat, withSeed,
  withLogprobs, withTopLogprobs, and withEnhancements methods.

These checks were causing exceptions in AzureOpenAiChatModel.getDefaultOptions
when not all fields were set, leading to failures in methods like
ChatClient.create, even when using the AzureOpenAiChatModel constructor
with OpenAIClient.

The removal of these checks aligns with the @JsonInclude(Include.NON_NULL)
annotation on AzureOpenAiChatOptions, which already ignores null options.
This change maintains the intended flexibility while preventing unintended
mandatory requirements.
@markpollack
Copy link
Member

merged e29d38d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants