-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Showing
5 changed files
with
43 additions
and
26 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
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 |
---|---|---|
@@ -1,11 +1,17 @@ | ||
from phi.agent import Agent | ||
from phi.agent import Agent, RunResponse # noqa | ||
from phi.model.openai import OpenAIChat | ||
from phi.tools.duckduckgo import DuckDuckGo | ||
from phi.tools.yfinance import YFinanceTools | ||
|
||
agent = Agent( | ||
model=OpenAIChat(model="gpt-4o"), | ||
tools=[DuckDuckGo()], | ||
model=OpenAIChat(id="gpt-4o"), | ||
tools=[YFinanceTools(stock_price=True)], | ||
show_tool_calls=True, | ||
# debug_mode=True, | ||
markdown=True, | ||
) | ||
agent.print_response("Whats happening in France?", markdown=True) | ||
|
||
# Get the response in a variable | ||
# run: RunResponse = agent.run("What is the stock price of NVDA and TSLA") | ||
# print(run.content) | ||
|
||
# Print the response in the terminal | ||
agent.print_response("What is the stock price of NVDA and TSLA") |
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 |
---|---|---|
@@ -1,11 +1,19 @@ | ||
from phi.agent import Agent | ||
from typing import Iterator # noqa | ||
from phi.agent import Agent, RunResponse # noqa | ||
from phi.model.openai import OpenAIChat | ||
from phi.tools.duckduckgo import DuckDuckGo | ||
from phi.tools.yfinance import YFinanceTools | ||
|
||
agent = Agent( | ||
model=OpenAIChat(model="gpt-4o"), | ||
tools=[DuckDuckGo()], | ||
model=OpenAIChat(id="gpt-4o"), | ||
tools=[YFinanceTools(stock_price=True)], | ||
show_tool_calls=True, | ||
# debug_mode=True, | ||
markdown=True, | ||
) | ||
agent.print_response("Whats happening in France?", markdown=True, stream=True) | ||
|
||
# Get the response in a variable | ||
# run_response: Iterator[RunResponse] = agent.run("What is the stock price of NVDA and TSLA", stream=True) | ||
# for chunk in run_response: | ||
# print(chunk.content) | ||
|
||
# Print the response in the terminal | ||
agent.print_response("What is the stock price of NVDA and TSLA", stream=True) |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
from phi.agent import Agent, RunResponse | ||
from phi.agent import Agent, RunResponse # noqa | ||
from phi.model.openai import OpenAIChat | ||
|
||
agent = Agent( | ||
model=OpenAIChat(model="gpt-4o"), | ||
description="You help people with their health and fitness goals.", | ||
) | ||
agent = Agent(model=OpenAIChat(id="gpt-4o"), instructions=["Respond in a southern tone"], markdown=True) | ||
|
||
run: RunResponse = agent.run("Share a healthy breakfast recipe") # type: ignore | ||
# Get the response in a variable | ||
# run: RunResponse = agent.run("Explain simulation theory") | ||
# print(run.content) | ||
|
||
print(run.content) | ||
# Print the response in the terminal | ||
agent.print_response("Explain simulation theory") |
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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
from phi.agent import Agent | ||
from typing import Iterator # noqa | ||
from phi.agent import Agent, RunResponse # noqa | ||
from phi.model.openai import OpenAIChat | ||
|
||
agent = Agent( | ||
model=OpenAIChat(model="gpt-4o"), | ||
description="You help people with their health and fitness goals.", | ||
) | ||
agent = Agent(model=OpenAIChat(id="gpt-4o"), instructions=["Respond in a southern tone"], markdown=True) | ||
|
||
agent.print_response("Share a healthy breakfast recipe", stream=True) | ||
# Get the response in a variable | ||
# run_response: Iterator[RunResponse] = agent.run("Explain simulation theory", stream=True) | ||
# for chunk in run_response: | ||
# print(chunk.content) | ||
|
||
# Print the response in the terminal | ||
agent.print_response("Explain simulation theory", stream=True) |