From fc5263dad816b5f1c63407c7ad8af26367962dca Mon Sep 17 00:00:00 2001 From: nsosio Date: Mon, 10 Jun 2024 12:34:33 +0200 Subject: [PATCH] fixes --- prem_utils/connectors/anthropic.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/prem_utils/connectors/anthropic.py b/prem_utils/connectors/anthropic.py index 1fdedb4..56be38c 100644 --- a/prem_utils/connectors/anthropic.py +++ b/prem_utils/connectors/anthropic.py @@ -1,4 +1,5 @@ from collections.abc import Sequence +from uuid import uuid4 from anthropic import ( Anthropic, @@ -91,7 +92,12 @@ def _get_content(self, response, tools=False): "content": "", "role": "assistant", "tool_calls": [ - {"function_arguments": tool_message.input, "name": tool_message.name, "type": "function"} + { + "function_arguments": tool_message.input, + "name": tool_message.name, + "type": "function", + "id": str(uuid4()), + } for tool_message in tool_messages ], }