Skip to content

Commit 7092ce8

Browse files
committed
update
1 parent d3f8935 commit 7092ce8

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""Run `pip install duckduckgo-search` to install dependencies."""
2+
3+
from agno.agent import Agent
4+
from agno.models.openai import OpenAIResponses
5+
6+
agent = Agent(
7+
model=OpenAIResponses(id="gpt-4o", web_search=True),
8+
markdown=True,
9+
)
10+
agent.print_response("Whats happening in France?")

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

+20
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,23 @@ def test_web_search_built_in_tool_stream():
262262

263263
assert "medal" in final_response.lower()
264264
assert any(term in final_response.lower() for term in ["olympic", "games", "gold", "medal"])
265+
266+
267+
def test_web_search_built_in_tool_with_other_tools():
268+
"""Test the built-in web search tool in the Responses API."""
269+
agent = Agent(
270+
model=OpenAIResponses(id="gpt-4o-mini", web_search=True),
271+
tools=[YFinanceTools()],
272+
show_tool_calls=True,
273+
markdown=True,
274+
telemetry=False,
275+
monitoring=False,
276+
)
277+
278+
response = agent.run("What is the current price of TSLA and the latest news about it?")
279+
280+
tool_calls = [msg.tool_calls for msg in response.messages if msg.tool_calls]
281+
assert len(tool_calls) >= 1 # At least one message has tool calls
282+
assert response.content is not None
283+
assert "TSLA" in response.content
284+
assert "news" in response.content.lower()

0 commit comments

Comments
 (0)