Async FinanceTools

Every FinanceTools tool has an async variant registered under the same name, so `agent.arun()` / `agent.aprint_response()` use them automatically.

Every FinanceTools tool has an async variant registered under the same name, so agent.arun() / agent.aprint_response() use them automatically. Providers with a native async client (financialdatasets.ai via httpx) run without a thread; sync-only providers (yfinance) run in a worker thread.

async.py
"""
Async FinanceTools
==================
Every FinanceTools tool has an async variant registered under the same name,
so `agent.arun()` / `agent.aprint_response()` use them automatically. Providers
with a native async client (financialdatasets.ai via httpx) run without a
thread; sync-only providers (yfinance) run in a worker thread.

This example fans out three tickers concurrently with one agent.
"""

import asyncio

from agno.agent import Agent
from agno.tools.finance import FinanceTools

# ---------------------------------------------------------------------------
# Create the Agent (reused across all runs - never create agents in a loop)
# ---------------------------------------------------------------------------
agent = Agent(
    name="Finance Agent",
    model="openai:gpt-5.6",
    tools=[FinanceTools()],
    instructions="Answer in three bullets: price and day change, valuation, one notable headline.",
    markdown=True,
)

async def main() -> None:
    tickers = ["NVDA", "AMD", "AVGO"]
    outputs = await asyncio.gather(
        *(agent.arun(f"Quick take on {ticker}") for ticker in tickers)
    )
    for ticker, output in zip(tickers, outputs):
        print(f"\n===== {ticker} =====\n{output.content}")

# ---------------------------------------------------------------------------
# Run the Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    asyncio.run(main())

This script starts three agent runs concurrently and prints their results in the original ticker order after all finish. Its default provider is Yahoo Finance because the setup installs yfinance; no Financial Datasets key is required. With no database or history enabled, this is a parallel brief example rather than a persisted conversation.

Run the Example

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 API keys

export OPENAI_API_KEY="your_openai_api_key_here"

Run the example

Save the code above as async.py, then run:

python async.py

Full source: cookbook/91_tools/finance/05_async.py