Skip to content

Remove common ChatOptions setters calls#5957

Merged
sdeleuze merged 2 commits intospring-projects:mainfrom
ericbottard:remove-common-options-setters
May 7, 2026
Merged

Remove common ChatOptions setters calls#5957
sdeleuze merged 2 commits intospring-projects:mainfrom
ericbottard:remove-common-options-setters

Conversation

@ericbottard
Copy link
Copy Markdown
Member

After this commit, there are no explicit setters being called in production code.

Setters may still be used by tests, and reflectively when options are used as @ConfigurationProperties

This is in preparation of making the options immutable.

Change the advisor to return a new prompt with new
options rather than modifying the options in place.

Adapt tests that used a lot of mocking to use
real objects instead, introducing DefaultStructuredOutputChatOptions
for that purpose.

Signed-off-by: Eric Bottard <eric.bottard@broadcom.com>
In preparation of making the options immutable,
remove the use of mutating setter in favor of
creating a new prompt with new copied options in
the advisor.

Signed-off-by: Eric Bottard <eric.bottard@broadcom.com>
@ericbottard ericbottard requested a review from sdeleuze May 6, 2026 14:59
@ilayaperumalg ilayaperumalg added this to the 2.0.0-M6 milestone May 7, 2026
@sdeleuze sdeleuze merged commit 0fbaf9b into spring-projects:main May 7, 2026
3 of 4 checks passed
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.

3 participants