From 8ec7433685b3d22db19f683617ed305c1908b1c4 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 18 Dec 2024 17:15:25 +0100 Subject: [PATCH] remove vertex changes from this PR --- .../components/generators/google_vertex/chat/gemini.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 845e24f5f..2309ca718 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 @@ -280,10 +280,12 @@ def _get_response(self, response_body: GenerationResponse) -> List[ChatMessage]: # Remove content from metadata metadata.pop("content", None) if part._raw_part.text != "": - replies.append(ChatMessage.from_assistant(part._raw_part.text, meta=metadata)) + replies.append(ChatMessage.from_assistant(content=part._raw_part.text, meta=metadata)) elif part.function_call: metadata["function_call"] = part.function_call - new_message = ChatMessage.from_assistant(json.dumps(dict(part.function_call.args)), meta=metadata) + new_message = ChatMessage.from_assistant( + content=json.dumps(dict(part.function_call.args)), meta=metadata + ) new_message.name = part.function_call.name replies.append(new_message) return replies