Bug description Described in this issue, the conditional block for Message Stop Event relayed from Bedrock Streaming Response ( AWS doc link) in ConverseUtils Utility is never executed unlike other events outlined. Though, It is observered that the MessageStopEvent Object is initiated.
Which leads not having the StopReason
not populated for Response MetaAggeregation
. As an example of consequence is found in(AdvisorUtils.onFinishReason().test(response)
( See here) where it always returns false
as having result.getMetadata().getFinishReason)
being NULL
. So any Streaming
Advisors's after
method will not be invoked
Environment This issue is present in version M8
Steps to reproduce
1. Configure AWS Bedrock as Chat Model
2. Create a Chat Client Bean and add A streaming Advisor
3. Communicate with Chat Client
4. Enable Trace Logs and add breakpoint in that ConverseUtils 's MessageStopEvent
5. Observe that the code is never executed even though, AWS Bedrock last response have messageStop
6. No after
method is invoked
Expected behavior
The ConverseUtils class needs to populated the StopReason
in MetaAggeration for MessageStopEvent
, so that after
method is invoked for Streamed Advisors