We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f9f67a commit 0dab60eCopy full SHA for 0dab60e
1 file changed
integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat/utils.py
@@ -678,7 +678,8 @@ def _convert_chunks_to_messages(chunks: list[StreamingChunk]) -> list[ChatMessag
678
679
# the trace are ignored in _convert_streaming_chunks_to_chat_message
680
# so we need to process them separately
681
- if chunks and (last_chunk := chunks[-1]) and last_chunk.meta and "trace" in last_chunk.meta:
+ last_chunk = chunks[-1] if chunks else None
682
+ if last_chunk and last_chunk.meta and "trace" in last_chunk.meta:
683
reply.meta["trace"] = last_chunk.meta["trace"]
684
685
return [reply]
0 commit comments