from agno.agent import Agent
from agno.models.openai.chat import OpenAIChat
from agno.tools.yfinance import YFinanceTools
agent = Agent(
model=OpenAIChat(id="gpt-4o-mini"),
tools=[YFinanceTools(company_news=True, cache_results=True)],
tool_call_limit=1, # Agent 不会执行超过一次的工具调用。
)
# 将执行第一次工具调用。第二次调用将优雅地失败。
agent.print_response(
"Find me the current price of TSLA, then after that find me the latest news about Tesla.",
stream=True,
)