-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa4ecaf
commit 5bcfc55
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from phi.agent import Agent | ||
from phi.model.xai import xAI | ||
from phi.tools.duckduckgo import DuckDuckGo | ||
from phi.tools.yfinance import YFinanceTools | ||
|
||
web_agent = Agent( | ||
name="Web Agent", | ||
role="Search the web for information", | ||
model=xAI(id="grok-beta"), | ||
tools=[DuckDuckGo()], | ||
instructions=["Always include sources"], | ||
show_tool_calls=True, | ||
markdown=True, | ||
) | ||
|
||
finance_agent = Agent( | ||
name="Finance Agent", | ||
role="Get financial data", | ||
model=xAI(id="grok-beta"), | ||
tools=[YFinanceTools(stock_price=True, analyst_recommendations=True, company_info=True)], | ||
instructions=["Use tables to display data"], | ||
show_tool_calls=True, | ||
markdown=True, | ||
) | ||
|
||
agent_team = Agent( | ||
team=[web_agent, finance_agent], | ||
instructions=["Always include sources", "Use tables to display data"], | ||
show_tool_calls=True, | ||
markdown=True, | ||
) | ||
|
||
agent_team.print_response("Summarize analyst recommendations and share the latest news for TSLA", stream=True) |