Async Team with Tools

Run a team asynchronously with `aprint_response()` while a HackerNews agent and a YFinance agent gather information as members.

Create an async team where each agent uses its own tools to gather information.

Code

async_team_with_tools.py
import asyncio

from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.team import Team
from agno.tools.hackernews import HackerNewsTools
from agno.tools.yfinance import YFinanceTools

# HackerNews agent
news_agent = Agent(
    name="News Agent",
    role="Search HackerNews for tech news",
    model=OpenAIResponses(id="gpt-5.2"),
    tools=[HackerNewsTools()],
    instructions=[
        "Find the latest tech news and discussions",
    ],
)

# Finance agent
finance_agent = Agent(
    name="Finance Agent",
    role="Get stock prices and financial data",
    model=OpenAIResponses(id="gpt-5.2"),
    tools=[YFinanceTools()],
    instructions=[
        "Get stock prices and financial information",
    ],
)

# Create the research team
research_team = Team(
    name="Research Team",
    model=OpenAIResponses(id="gpt-5.2"),
    members=[
        news_agent,
        finance_agent,
    ],
    markdown=True,
    instructions=[
        "You are a team that researches companies.",
        "Use the news agent to find recent discussions and the finance agent for stock data.",
    ],
    show_members_responses=True,
)

if __name__ == "__main__":
    asyncio.run(
        research_team.aprint_response(
            "Research NVIDIA - get the current stock price and find any recent HackerNews discussions about the company.",
            stream=True,
        )
    )

Usage

Create a Python file

Create async_team_with_tools.py with the code above.

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Install dependencies

uv pip install -U agno openai yfinance

Export your OpenAI API key

export OPENAI_API_KEY="your_openai_api_key_here"

Run Team

python async_team_with_tools.py