Skip to content

Chat Response Metadata Aggergration Stop Reason is not Populated for Bedrock's MessageStop EventΒ #3251

@saadswift

Description

@saadswift

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BedrockbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions