From ce6a11a47f86ca69905e4c266b23e8b772786e93 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 18 Dec 2024 18:13:01 +0100 Subject: [PATCH] fix: make Ollama Chat Generator compatible with new ChatMessage --- .../components/generators/ollama/chat/chat_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/ollama/src/haystack_integrations/components/generators/ollama/chat/chat_generator.py b/integrations/ollama/src/haystack_integrations/components/generators/ollama/chat/chat_generator.py index f598a6e42..daae552e5 100644 --- a/integrations/ollama/src/haystack_integrations/components/generators/ollama/chat/chat_generator.py +++ b/integrations/ollama/src/haystack_integrations/components/generators/ollama/chat/chat_generator.py @@ -116,7 +116,7 @@ def _build_message_from_ollama_response(self, ollama_response: ChatResponse) -> Converts the non-streaming response from the Ollama API to a ChatMessage. """ response_dict = ollama_response.model_dump() - message = ChatMessage.from_assistant(content=response_dict["message"]["content"]) + message = ChatMessage.from_assistant(response_dict["message"]["content"]) message.meta.update({key: value for key, value in response_dict.items() if key != "message"}) return message