Skip to content

Commit a91203a

Browse files
committed
update
1 parent 0a1b0d3 commit a91203a

File tree

36 files changed

+11
-76
lines changed

36 files changed

+11
-76
lines changed

libs/agno/tests/integration/models/aimlapi/test_tool_use.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def test_tool_use_stream():
4141
tool_call_seen = False
4242

4343
for chunk in response_stream:
44-
4544
responses.append(chunk)
4645
if chunk.tools:
4746
if any(tc.get("tool_name") for tc in chunk.tools):
@@ -87,7 +86,6 @@ async def test_async_tool_use_stream():
8786
tool_call_seen = False
8887

8988
async for chunk in response_stream:
90-
9189
responses.append(chunk)
9290
if chunk.tools:
9391
if any(tc.get("tool_name") for tc in chunk.tools):

libs/agno/tests/integration/models/anthropic/test_tool_use.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def test_tool_use_stream():
4141
tool_call_seen = False
4242

4343
for chunk in response_stream:
44-
4544
responses.append(chunk)
4645
if chunk.tools:
4746
if any(tc.tool_name for tc in chunk.tools):
@@ -88,7 +87,6 @@ async def test_async_tool_use_stream():
8887
tool_call_seen = False
8988

9089
async for chunk in response_stream:
91-
9290
responses.append(chunk)
9391
if chunk.tools:
9492
if any(tc.tool_name for tc in chunk.tools):

libs/agno/tests/integration/models/aws/bedrock/test_tool_use.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def test_tool_use_stream():
3838
tool_call_seen = False
3939

4040
for chunk in response_stream:
41-
4241
responses.append(chunk)
4342
if chunk.tools:
4443
if any(tc.tool_name for tc in chunk.tools):

libs/agno/tests/integration/models/aws/claude/test_tool_use.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def test_tool_use_stream():
4040
tool_call_seen = False
4141

4242
for chunk in response_stream:
43-
4443
responses.append(chunk)
4544
if chunk.tools:
4645
if any(tc.tool_name for tc in chunk.tools):
@@ -88,7 +87,6 @@ async def test_async_tool_use_stream():
8887
tool_call_seen = False
8988

9089
async for chunk in response_stream:
91-
9290
responses.append(chunk)
9391
if chunk.tools:
9492
if any(tc.tool_name for tc in chunk.tools):

libs/agno/tests/integration/models/azure/ai_foundry/test_tool_use.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def test_tool_use_stream():
4040
tool_call_seen = False
4141

4242
for chunk in response_stream:
43-
4443
responses.append(chunk)
4544
if chunk.tools:
4645
if any(tc.tool_name for tc in chunk.tools):
@@ -85,7 +84,6 @@ async def test_async_tool_use_stream():
8584
tool_call_seen = False
8685

8786
async for chunk in response_stream:
88-
8987
responses.append(chunk)
9088
if chunk.tools:
9189
if any(tc.tool_name for tc in chunk.tools):

libs/agno/tests/integration/models/azure/openai/test_tool_use.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def test_tool_use_stream():
4040
tool_call_seen = False
4141

4242
for chunk in response_stream:
43-
4443
responses.append(chunk)
4544
if chunk.tools:
4645
if any(tc.tool_name for tc in chunk.tools):
@@ -85,7 +84,6 @@ async def test_async_tool_use_stream():
8584
tool_call_seen = False
8685

8786
async for chunk in response_stream:
88-
8987
responses.append(chunk)
9088
if chunk.tools:
9189
if any(tc.tool_name for tc in chunk.tools):

libs/agno/tests/integration/models/cerebras/test_tool_use.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ def test_tool_use_stream():
3535
tool_call_seen = False
3636

3737
for chunk in response_stream:
38-
3938
responses.append(chunk)
40-
if chunk.tools:
41-
if any(tc.tool_name for tc in chunk.tools):
39+
40+
# Check for ToolCallStartedEvent or ToolCallCompletedEvent
41+
if chunk.event in ["ToolCallStarted", "ToolCallCompleted"] and hasattr(chunk, "tool") and chunk.tool:
42+
if chunk.tool.tool_name:
4243
tool_call_seen = True
4344

4445
assert len(responses) > 0
4546
assert tool_call_seen, "No tool calls observed in stream"
46-
assert any("France" in r.content for r in responses if r.content)
47+
assert any("France" in r.content for r in responses if hasattr(r, "content") and r.content)
4748

4849

4950
@pytest.mark.asyncio
@@ -78,15 +79,16 @@ async def test_async_tool_use_stream():
7879
tool_call_seen = False
7980

8081
async for chunk in response_stream:
81-
8282
responses.append(chunk)
83-
if chunk.tools:
84-
if any(tc.tool_name for tc in chunk.tools):
83+
84+
# Check for ToolCallStartedEvent or ToolCallCompletedEvent
85+
if chunk.event in ["ToolCallStarted", "ToolCallCompleted"] and hasattr(chunk, "tool") and chunk.tool:
86+
if chunk.tool.tool_name:
8587
tool_call_seen = True
8688

8789
assert len(responses) > 0
8890
assert tool_call_seen, "No tool calls observed in stream"
89-
assert any("France" in r.content for r in responses if r.content)
91+
assert any("France" in r.content for r in responses if hasattr(r, "content") and r.content)
9092

9193

9294
def test_tool_use_with_content():

libs/agno/tests/integration/models/cerebras_openai/test_tool_use.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def test_tool_use_stream():
3535
tool_call_seen = False
3636

3737
for chunk in response_stream:
38-
3938
responses.append(chunk)
4039
if chunk.tools:
4140
if any(tc.tool_name for tc in chunk.tools):
@@ -78,7 +77,6 @@ async def test_async_tool_use_stream():
7877
tool_call_seen = False
7978

8079
async for chunk in response_stream:
81-
8280
responses.append(chunk)
8381
if chunk.tools:
8482
if any(tc.tool_name for tc in chunk.tools):

libs/agno/tests/integration/models/cohere/test_tool_use.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def test_tool_use_stream():
4040
tool_call_seen = False
4141

4242
for chunk in response_stream:
43-
4443
responses.append(chunk)
4544
if chunk.tools:
4645
if any(tc.tool_name for tc in chunk.tools):
@@ -88,7 +87,6 @@ async def test_async_tool_use_stream():
8887
tool_call_seen = False
8988

9089
async for chunk in response_stream:
91-
9290
responses.append(chunk)
9391
if chunk.tools:
9492
if any(tc.tool_name for tc in chunk.tools):

libs/agno/tests/integration/models/deepinfra/test_tool_use.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def test_tool_use_stream():
4141
tool_call_seen = False
4242

4343
for chunk in response_stream:
44-
4544
responses.append(chunk)
4645
if chunk.tools:
4746
if any(tc.tool_name for tc in chunk.tools):
@@ -91,7 +90,6 @@ async def test_async_tool_use_stream():
9190
tool_call_seen = False
9291

9392
async for chunk in response_stream:
94-
9593
responses.append(chunk)
9694
if chunk.tools:
9795
if any(tc.tool_name for tc in chunk.tools):

0 commit comments

Comments
 (0)