Spaces:
Running
Running
from agno.agent import Agent | |
from agno.models.openai import OpenAIChat | |
from agno.tools.duckduckgo import DuckDuckGoTools | |
from agno.tools.yfinance import YFinanceTools | |
import os | |
from dotenv import load_dotenv | |
load_dotenv() | |
os.environ["OPENAI_API_KEY"]=os.getenv("OPENAI_API_KEY") | |
web_agent = Agent( | |
name="Web Agent", | |
role="Search the web for information", | |
model=OpenAIChat(id="gpt-4o"), | |
tools=[DuckDuckGoTools()], | |
instructions="Always include sources", | |
show_tool_calls=True, | |
markdown=True, | |
) | |
finance_agent = Agent( | |
name="Finance Agent", | |
role="Get financial data", | |
model=OpenAIChat(id="gpt-4o-mini"), | |
tools=[YFinanceTools(stock_price=True, analyst_recommendations=True,stock_fundamentals=True,company_info=True)], | |
instructions="Use tables to display data", | |
show_tool_calls=True, | |
markdown=True, | |
) | |
agent_team = Agent( | |
team=[web_agent, finance_agent], | |
model=OpenAIChat(id="gpt-4o-mini"), | |
instructions=["Always include sources", "Use tables to display data"], | |
show_tool_calls=True, | |
markdown=True, | |
) | |
agent_team.print_response("analyze the market outlook and financial performance of AI semiconductor company NVDA And Tesla And sugggest whether I ahve to buy or not?", stream=True) |