Skip to content

Support dynamic disabling of Structured Output Native#5412

Closed
filiphr wants to merge 1 commit intospring-projects:mainfrom
filiphr:support-dynamic-structure-output-disable
Closed

Support dynamic disabling of Structured Output Native#5412
filiphr wants to merge 1 commit intospring-projects:mainfrom
filiphr:support-dynamic-structure-output-disable

Conversation

@filiphr
Copy link
Contributor

@filiphr filiphr commented Feb 5, 2026

With this PR it allows users to dynamically disable Structured Output Native, even if it is globally enabled.

@filiphr filiphr force-pushed the support-dynamic-structure-output-disable branch from 7791917 to 2b02ab6 Compare February 5, 2026 23:43
Signed-off-by: Filip Hrisafov <filip.hrisafov@gmail.com>
@filiphr filiphr force-pushed the support-dynamic-structure-output-disable branch from 2b02ab6 to a9d24cd Compare February 6, 2026 00:08
@filiphr
Copy link
Contributor Author

filiphr commented Feb 9, 2026

Did someone from the Spring AI team manage to have a look at this? Is this something that is acceptable for the team?

My use case is to enable structured outputs globally, but use an advisor and / or disable it in some particular cases. Additionally, I have a commit ready on top of this that would allow any custom StrucuredOutputConverter to participate in this, as currently only the BeanOutputConverter supports the Native Structured Output.

@filiphr
Copy link
Contributor Author

filiphr commented Mar 17, 2026

@ilayaperumalg, @tzolov, @sdeleuze, @ericbottard, Congrats on the 2.0.0-M3 release.

I wanted to check with you whether or not this PR is something that is acceptable for Spring AI, or I should look for an alternative on our side?

@ilayaperumalg
Copy link
Member

@filiphr Sorry about the delay in reviewing this PR. Thanks for the PR and inputs! I will discuss with the team and provide feedback soon.

@filiphr
Copy link
Contributor Author

filiphr commented Mar 17, 2026

Thank you very much @ilayaperumalg. Let me know about the outcome. I'm happy to rebase this on top of main and adjust it if needed

Copy link
Contributor

@tzolov tzolov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement. LGTM.
Thanks @filiphr !

@tzolov tzolov self-assigned this Mar 20, 2026
@ilayaperumalg ilayaperumalg added this to the 2.0.0-M4 milestone Mar 20, 2026
@ilayaperumalg ilayaperumalg self-assigned this Mar 20, 2026
<version>${mockk-jvm.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be test scope. I will fix when merging.

@ilayaperumalg
Copy link
Member

Rebased and merged via 019267f and backported into 1.1.x via 45a1607 (after replacing json-unit-assertj with org.skyscreamer:jsonassert as json-unit-assertj 4.1.0 ships a .kotlin_module file compiled with Kotlin 2.1.0 metadata, which is incompatible with the Kotlin 1.9.x used by 1.1.x)

@filiphr filiphr deleted the support-dynamic-structure-output-disable branch March 22, 2026 21:59
@filiphr
Copy link
Contributor Author

filiphr commented Mar 22, 2026

That's amazing. Thanks a lot @ilayaperumalg and @tzolov

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants