From b755b312b994a48ab25f84f5154c5aa3471b9109 Mon Sep 17 00:00:00 2001 From: Amna Mubashar Date: Mon, 23 Sep 2024 22:18:09 +0200 Subject: [PATCH] Fix for metadata --- .../components/generators/google_vertex/chat/gemini.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/chat/gemini.py b/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/chat/gemini.py index e8de0b006..5fecfbde6 100644 --- a/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/chat/gemini.py +++ b/integrations/google_vertex/src/haystack_integrations/components/generators/google_vertex/chat/gemini.py @@ -231,9 +231,9 @@ def _get_response(self, response_body: GenerationResponse) -> List[ChatMessage]: """ replies: List[ChatMessage] = [] for candidate in response_body.candidates: + metadata = candidate.to_dict() for part in candidate.content.parts: # Remove content from metadata - metadata = part.to_dict() metadata.pop("content", None) if part._raw_part.text != "": replies.append(