Skip to content

Commit 4d215dd

Browse files
committed
Update
1 parent 3ff0244 commit 4d215dd

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,5 +255,5 @@ def test_tool_call_list_parameters():
255255
tool_calls.extend(msg.tool_calls)
256256
for call in tool_calls:
257257
if call.get("type", "") == "function":
258-
assert call["function"]["name"] in ["get_contents", "exa_answer", "search_exa"]
258+
assert call["function"]["name"] in ["get_contents", "exa_answer", "search_exa", "find_similar"]
259259
assert response.content is not None

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,28 @@ def test_parallel_tool_calls():
153153

154154
def test_multiple_tool_calls():
155155
"""Test multiple different tool types with the responses API."""
156+
def get_the_weather(city: str):
157+
return f"It is currently 70 degrees and cloudy in {city}"
158+
159+
def get_favourite_city():
160+
return "Tokyo"
161+
156162
agent = Agent(
157163
model=OpenAIResponses(id="gpt-4.1-mini"),
158-
tools=[YFinanceTools(cache_results=True), DuckDuckGoTools(cache_results=True)],
164+
tools=[get_the_weather, get_favourite_city],
159165
markdown=True,
160166
telemetry=False,
161167
monitoring=False,
162168
)
163169

164-
response = agent.run("Find the latest price of TSLA. Then, based on the price, find the latest news about it.")
170+
response = agent.run("Find my favourite city. Then, get the weather in that city.")
165171

166172
# Verify tool usage
167173
tool_calls = [msg.tool_calls for msg in response.messages if msg.tool_calls]
168-
assert len(tool_calls) >= 2 # At least two messages have tool calls
169-
assert sum(len(calls) for calls in tool_calls) >= 2 # Total of 2 tool calls made
174+
assert len(tool_calls) >= 2 # At least one message has tool calls
175+
assert sum(len(calls) for calls in tool_calls) >= 1 # Total of 1 tool calls made
170176
assert response.content is not None
171-
assert "TSLA" in response.content and "latest news" in response.content.lower()
177+
assert "Tokyo" in response.content and "70" in response.content
172178

173179

174180
def test_tool_call_custom_tool_no_parameters():

libs/agno/tests/integration/models/xai/test_basic.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,15 @@ def test_basic():
2929

3030

3131
def test_basic_stream():
32-
agent = Agent(model=xAI(id="grok-3-mini-fast"), markdown=True, telemetry=False, monitoring=False)
32+
agent = Agent(model=xAI(id="grok-3-mini"), markdown=True, telemetry=False, monitoring=False)
3333

3434
response_stream = agent.run("Share a 2 sentence horror story", stream=True)
3535

3636
# Verify it's an iterator
3737
assert hasattr(response_stream, "__iter__")
3838

39-
responses = list(response_stream)
40-
assert len(responses) > 0
41-
for response in responses:
42-
assert response.content is not None
39+
for response in response_stream:
40+
assert response.content is not None or response.reasoning_content is not None
4341

4442
_assert_metrics(agent.run_response)
4543

@@ -63,7 +61,7 @@ async def test_async_basic_stream():
6361
response_stream = await agent.arun("Share a 2 sentence horror story", stream=True)
6462

6563
async for response in response_stream:
66-
assert response.content is not None
64+
assert response.content is not None or response.reasoning_content is not None
6765

6866
_assert_metrics(agent.run_response)
6967

0 commit comments

Comments
 (0)