from agno.agent import Agent from agno.models.litellm import LiteLLM from agno.tools.yfinance import YFinanceTools openai_agent = Agent( model=LiteLLM( id="gpt-4o", name="LiteLLM", ), markdown=True, tools=[YFinanceTools()], ) # Ask a question that would likely trigger tool use openai_agent.print_response("How is TSLA stock doing right now?")
Create a virtual environment
Terminal
python3 -m venv .venv source .venv/bin/activate
Set your API key
export LITELLM_API_KEY=xxx
Install libraries
pip install -U litellm openai agno
Run Agent
python cookbook/models/litellm/tool_use.py
Was this page helpful?