From a6a648b7d5fcec60786ea1a1571ed86d785cab53 Mon Sep 17 00:00:00 2001 From: Amna Mubashar Date: Tue, 27 Aug 2024 16:05:08 +0200 Subject: [PATCH] Add googleai fix --- .../components/generators/google_ai/chat/gemini.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py b/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py index 20e143ba7..d81dea552 100644 --- a/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py +++ b/integrations/google_ai/src/haystack_integrations/components/generators/google_ai/chat/gemini.py @@ -326,7 +326,7 @@ def _get_response(self, response_body: GenerateContentResponse) -> List[ChatMess for candidate in response_body.candidates: for part in candidate.content.parts: if part.text != "": - replies.append(ChatMessage.from_system(part.text)) + replies.append(ChatMessage.from_assistant(part.text)) elif part.function_call is not None: replies.append( ChatMessage( @@ -354,4 +354,4 @@ def _get_stream_response( responses.append(content) combined_response = "".join(responses).lstrip() - return [ChatMessage.from_system(content=combined_response)] + return [ChatMessage.from_assistant(content=combined_response)]