From 0a9cc244c84011d4030e434f5195ab0a61e9b748 Mon Sep 17 00:00:00 2001 From: Hemang Date: Fri, 21 Mar 2025 00:44:20 +0100 Subject: [PATCH] Add tool_result type in the coverter test for Anthropic. --- .../converters/test_anthropic_to_invariant.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/unit_tests/converters/test_anthropic_to_invariant.py b/tests/unit_tests/converters/test_anthropic_to_invariant.py index 718270a..8ca9d2d 100644 --- a/tests/unit_tests/converters/test_anthropic_to_invariant.py +++ b/tests/unit_tests/converters/test_anthropic_to_invariant.py @@ -60,6 +60,16 @@ def test_convert_messages_with_tool_call(): }, ], }, + { + "role": "user", + "content": [ + { + "type": "tool_result", + "content": "Paris is the capital of France.", + "tool_use_id": "toolu_013btUg7dbaEq7NbPGzw4K9u", + } + ], + }, ] converted_messages = convert_anthropic_to_invariant_message_format(messages) @@ -84,4 +94,9 @@ def test_convert_messages_with_tool_call(): } ], }, + { + "role": "tool", + "content": "Paris is the capital of France.", + "tool_call_id": "toolu_013btUg7dbaEq7NbPGzw4K9u", + }, ]