| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Implemented StructuredOutputChatOptions interface in BedrockChatOptions to provide the foundation for native structured output support on Amazon Bedrock. - Implement StructuredOutputChatOptions interface - Add outputSchema field with getter/setter - Add outputSchema() method to Builder - Add outputSchema copy logic to fromOptions() Closes spring-projectsgh-5445 Signed-off-by: CHANHAN <130114269+chanani@users.noreply.github.com>
Added unit tests to verify outputSchema functionality in BedrockChatOptions. - Add outputSchema assertions to existing tests (builder, copy, setter, defaultValues) - Add test for StructuredOutputChatOptions interface implementation - Add tests for outputSchema set/get and overwrite Signed-off-by: CHANHAN <130114269+chanani@users.noreply.github.com>
- Add buildOutputConfig() to convert outputSchema into AWS OutputConfig - Add outputConfig to ConverseRequest in createRequest() - Add outputConfig to ConverseStreamRequest in internalStream() - Add outputSchema merge logic between runtime/default options in buildRequestPrompt() - Upgrade AWS bedrockruntime SDK from 2.36.3 to 2.41.22 Signed-off-by: CHANHAN <130114269+chanani@users.noreply.github.com>
|
@chanani, thank you for your contribution. |
Sorry, something went wrong.
|
It looks ok. I will do the rebasing before the merge. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Add StructuredOutputChatOptions support to BedrockChatOptions
Summary
This PR implements the StructuredOutputChatOptions interface in BedrockChatOptions to provide the foundation for native structured output support on Amazon Bedrock.
Resolves gh-5445
Motivation
Amazon Bedrock now supports native structured output via the outputConfig.textFormat field in the Converse API. To enable AdvisorParams.ENABLE_NATIVE_STRUCTURED_OUTPUT for Bedrock, BedrockChatOptions needs to implement StructuredOutputChatOptions, which is the unified abstraction layer used across all providers (Anthropic, Google GenAI, Mistral, OpenAI, etc.).
Changes
BedrockChatOptions.java
BedrockChatOptionsTests.java
Note
The current AWS SDK version (2.36.3) used by Spring AI does not yet include the OutputConfig class for the Converse API. Therefore, this PR stores the output schema as a plain String field, consistent with the approach used by other providers like Google GenAI. Once the AWS SDK is upgraded to a version that includes OutputConfig, the BedrockProxyChatModel can read this field and pass it to the Converse API request.