Created
November 9, 2024 00:59
-
-
Save amosgyamfi/7c137dd45791893cc34da9461f4a86d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from phi.agent import Agent | |
from phi.model.openai import OpenAIChat | |
from phi.tools.duckduckgo import DuckDuckGo | |
from phi.tools.yfinance import YFinanceTools | |
web_search_agent = Agent( | |
name="Web Search Agent", | |
role="Search the web for information", | |
model=OpenAIChat(id="gpt-4o"), | |
tools=[DuckDuckGo()], | |
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"), | |
tools=[ | |
YFinanceTools(stock_price=True, analyst_recommendations=True, company_info=True) | |
], | |
instructions=["Use tables to display data"], | |
show_tool_calls=True, | |
markdown=True, | |
) | |
multi_ai_agent = Agent( | |
team=[web_search_agent, finance_agent], | |
instructions=["Always include sources", "Use tables to display data"], | |
show_tool_calls=True, | |
markdown=True, | |
) | |
multi_ai_agent.print_response( | |
"Summarize analyst recommendations and share the latest news for NVDA", stream=True | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment