mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
Fix 35 ruff errors (E722, F841, B904, B905, B007, E741, S202, S310, S306, S110, TID251, UP042, F401) and run black on 526 files. Co-authored-by: Hanzo Dev <[email protected]>
26 lines
693 B
Python
26 lines
693 B
Python
import asyncio
|
|
|
|
from agents import Agent, Runner, WebSearchTool, trace
|
|
|
|
|
|
async def main():
|
|
agent = Agent(
|
|
name="Web searcher",
|
|
instructions="You are a helpful agent.",
|
|
tools=[
|
|
WebSearchTool(user_location={"type": "approximate", "city": "New York"})
|
|
],
|
|
)
|
|
|
|
with trace("Web search example"):
|
|
result = await Runner.run(
|
|
agent,
|
|
"search the web for 'local sports news' and give me 1 interesting update in a sentence.",
|
|
)
|
|
print(result.final_output)
|
|
# The New York Giants are reportedly pursuing quarterback Aaron Rodgers after his ...
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|