You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove unnecessary null checks in AzureOpenAiChatOptions.Builder
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.
Copy file name to clipboardExpand all lines: models/spring-ai-azure-openai/src/main/java/org/springframework/ai/azure/openai/AzureOpenAiChatOptions.java
-5Lines changed: 0 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -283,7 +283,6 @@ public Builder withFunction(String functionName) {
0 commit comments