Skip to content

fix(bedrock): tolerate gateway cost frame in converse stream - #129

Open
radu-mocanu wants to merge 1 commit into
mainfrom
fix/bedrock-converse-gateway-cost-metadata
Open

fix(bedrock): tolerate gateway cost frame in converse stream#129
radu-mocanu wants to merge 1 commit into
mainfrom
fix/bedrock-converse-gateway-cost-metadata

Conversation

@radu-mocanu

@radu-mocanu radu-mocanu commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • streamed UiPathChatBedrockConverse runs no longer fail when the LLM Gateway is configured to report per-call cost
  • the per-call cost now reaches the stream's response_metadata (for example associated_dollar_cost), the same place it already lands on non-streamed converse responses
  • ordinary Converse events are forwarded untouched and in order, so existing chunks are unchanged
  • affects the langchain package only (uipath-langchain-client 1.18.1)

The LLM Gateway appends a `costMetadata` event-stream frame that AWS does
not define, and langchain_aws raises on any stream event it cannot parse,
so streamed Bedrock Converse runs died after producing text. Gateway-only
frames are now filtered out and the cost payload is folded into the
terminal `metadata` event, reaching `response_metadata`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant