Skip to content

Build and run agents you can see, understand and trust.

ci(formatter): improve the current unittests for formatters with consistent tool use and tool result ID (#1043)

qbc19cba5ce88b4
diff --git a/tests/formatter_anthropic_test.py b/tests/formatter_anthropic_test.py
index 98643f7e8..f68c0f0d1 100644
--- a/tests/formatter_anthropic_test.py
+++ b/tests/formatter_anthropic_test.py
@@ -118,7 +118,7 @@ class TestAnthropicChatFormatterFormatter(IsolatedAsyncioTestCase):
[
ToolResultBlock(
type="tool_result",
- id="1",
+ id="2",
name="get_capital",
output="The capital of South Korea is Seoul.",
),
@@ -434,7 +434,7 @@ class TestAnthropicChatFormatterFormatter(IsolatedAsyncioTestCase):
"content": [
{
"type": "tool_result",
- "tool_use_id": "1",
+ "tool_use_id": "2",
"content": [
{
"type": "text",
diff --git a/tests/formatter_deepseek_test.py b/tests/formatter_deepseek_test.py
index a8b769012..7e967e078 100644
--- a/tests/formatter_deepseek_test.py
+++ b/tests/formatter_deepseek_test.py
@@ -114,7 +114,7 @@ class TestDeepSeekFormatter(IsolatedAsyncioTestCase):
[
ToolResultBlock(
type="tool_result",
- id="1",
+ id="2",
name="get_capital",
output=[
TextBlock(
@@ -321,7 +321,7 @@ class TestDeepSeekFormatter(IsolatedAsyncioTestCase):
},
{
"role": "tool",
- "tool_call_id": "1",
+ "tool_call_id": "2",
"content": "The capital of South Korea is Seoul.",
"name": "get_capital",
},
diff --git a/tests/formatter_gemini_test.py b/tests/formatter_gemini_test.py
index 7530ad404..cf0a27e72 100644
--- a/tests/formatter_gemini_test.py
+++ b/tests/formatter_gemini_test.py
@@ -159,7 +159,7 @@ class TestGeminiFormatter(IsolatedAsyncioTestCase):
[
ToolUseBlock(
type="tool_use",
- id="1",
+ id="2",
name="get_capital",
input={"country": "South Korea"},
),
@@ -171,7 +171,7 @@ class TestGeminiFormatter(IsolatedAsyncioTestCase):
[
ToolResultBlock(
type="tool_result",
- id="1",
+ id="2",
name="get_capital",
output=[
TextBlock(
@@ -532,7 +532,7 @@ class TestGeminiFormatter(IsolatedAsyncioTestCase):
"parts": [
{
"function_call": {
- "id": "1",
+ "id": "2",
"name": "get_capital",
"args": {
"country": "South Korea",
@@ -546,7 +546,7 @@ class TestGeminiFormatter(IsolatedAsyncioTestCase):
"parts": [
{
"function_response": {
- "id": "1",
+ "id": "2",
"name": "get_capital",
"response": {
"output": "- The capital of South Korea is "
diff --git a/tests/formatter_ollama_test.py b/tests/formatter_ollama_test.py
index 546de34d3..6645e39aa 100644
--- a/tests/formatter_ollama_test.py
+++ b/tests/formatter_ollama_test.py
@@ -131,7 +131,7 @@ class TestOllamaFormatter(IsolatedAsyncioTestCase):
[
ToolResultBlock(
type="tool_result",
- id="1",
+ id="2",
name="get_capital",
output=[
TextBlock(
@@ -354,7 +354,7 @@ class TestOllamaFormatter(IsolatedAsyncioTestCase):
},
{
"role": "tool",
- "tool_call_id": "1",
+ "tool_call_id": "2",
"content": "- The capital of South Korea is Seoul.\n- The "
"returned image can be found at: ./image.png",
"name": "get_capital",