-
Notifications
You must be signed in to change notification settings - Fork 2k
[Enhancement] - Enable passing of requestMetadata to the Bedrock Converse API. #4110
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
[Enhancement] - Enable passing of requestMetadata to the Bedrock Converse API. #4110
Conversation
ca2a531 to
8f89a11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
...drock-converse/src/main/java/org/springframework/ai/bedrock/converse/BedrockChatOptions.java
Show resolved
Hide resolved
a75a707 to
142d5dc
Compare
5e37932 to
ff85ea1
Compare
|
@sunyuhan1998 just checking do you know how to get a review from the maintainers? |
|
@sobychacko any feedback on this one? |
I suppose they'll get to it once they see this PR—after all, the team might be busy with other tasks at times. |
...verse/src/test/java/org/springframework/ai/bedrock/converse/BedrockConverseChatClientIT.java
Outdated
Show resolved
Hide resolved
|
@StuartLox Thanks for the PR! The changes look good; Please check if you can improve the Integration test coverage. Thanks! |
68ad61e to
529c47e
Compare
|
@ilayaperumalg have incorporated your suggestions, by updating the IT to validate the expected metadata is in the response output. |
...verse/src/test/java/org/springframework/ai/bedrock/converse/BedrockConverseChatClientIT.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Stuart Loxton <[email protected]> Signed-off-by: Stuart Loxton <[email protected]>
Signed-off-by: Stuart Loxton <[email protected]> Signed-off-by: Stuart Loxton <[email protected]>
Signed-off-by: Stuart Loxton <[email protected]> Signed-off-by: Stuart Loxton <[email protected]>
Signed-off-by: Stuart Loxton <[email protected]>
Signed-off-by: Stuart Loxton <[email protected]>
Signed-off-by: Stuart Loxton <[email protected]>
Signed-off-by: Stuart Loxton <[email protected]>
Signed-off-by: Stuart Loxton <[email protected]>
181b5a0 to
aeba66d
Compare
|
@ilayaperumalg the problem is that the requestMetadata is not returned in the response, so its not possible to assert any details related to the requestMetadata in the Response unfortunatly: See the Response details here: |
|
@StuartLox ok, thanks for clarifying. I manually verified that request metadata is being passed as part of Converse client request. Will merge this PR soon. |
|
@StuartLox Thanks once again for the changes. Rebased, squashed and merged as 45baa39 |
Description
Currently, SpringAI does not expose a way to pass custom requestMetadata to the Bedrock Converse API.
AWS Bedrock allows including requestMetadata in requests so that additional contextual information can appear in Bedrock audit logs in CloudWatch.
This is particularly useful for tracing requests, where correlation IDs, user session IDs, or other operational tags are required for audit and compliance purposes.
See RequestMetadata in Converse API here: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html
Proposed Change
This change leverages the metadata field from the user prompt Object to provide a mechanism to set the requestMetadata parameter in the ConverseAPI Request.