diff --git a/integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat/adapters.py b/integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat/adapters.py index 6d8bb8e30..eaa064a3b 100644 --- a/integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat/adapters.py +++ b/integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/chat/adapters.py @@ -229,7 +229,8 @@ def _extract_messages_from_response(self, response_body: Dict[str, Any]) -> List if response_body.get("type") == "message": for content in response_body["content"]: if content.get("type") == "text": - messages.append(ChatMessage.from_assistant(content["text"])) + meta = {k: v for k, v in response_body.items() if k not in ["type", "content", "role"]} + messages.append(ChatMessage.from_assistant(content["text"], meta=meta)) return messages def _extract_token_from_stream(self, chunk: Dict[str, Any]) -> str: