-
Notifications
You must be signed in to change notification settings - Fork 988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AzureOpenAiChatOptions] Unable to set all possible options when calling AzureOpenAiChatModel #889
Comments
…mpletionsOptions Add missing options from Azure ChatCompletionsOptions to Spring AI AzureOpenAiChatOptions. The following fields have been added: - seed - logprobs - topLogprobs - enhancements This change ensures better alignment between the two option sets, improving compatibility and feature parity. Resolves spring-projects#889
Hi All! This change is not working and is breaking things. It is adding the new options but makes more of them indirectly mandatory. The
Since we would anyhow ignore null options with |
will take a look, thanks for reporting. |
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.
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 issue has been fixed. thanks for hanging in there... see 56a41e6 |
Bug description
Consider the attributes that can be set through
AzureOpenAiChatOptions
:The
AzureOpenAiChatOptions
object is used in theAzureOpenAiChatModel
to create the instance ofChatCompletionsOptions
.ChatCompletionsOptions
has the following attributes:In code it seems like there's no way to set options like logprobs, enhancements or seed.
Furthermore, in the method that should merge two
ChatCompletionsOptions
:such options are not taken into account
Expected behavior
I'm expecting the
AzureOpenAiChatOptions
to be aligned with the currently available options for Azure OpenAiThe text was updated successfully, but these errors were encountered: