-
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
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,11 @@ | ||
from phi.agent import Agent, RunResponse # noqa | ||
from phi.model.openai import OpenAIChat | ||
|
||
agent = Agent(model=OpenAIChat(id="o1-preview")) | ||
|
||
# Get the response in a variable | ||
# run: RunResponse = agent.run("What is the closest galaxy to milky way?") | ||
# print(run.content) | ||
|
||
# Print the response in the terminal | ||
agent.print_response("What is the closest galaxy to milky way?") |
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,13 @@ | ||
from typing import Iterator # noqa | ||
from phi.agent import Agent, RunResponse # noqa | ||
from phi.model.openai import OpenAIChat | ||
|
||
agent = Agent(model=OpenAIChat(id="o1-preview")) | ||
|
||
# Get the response in a variable | ||
# run_response: Iterator[RunResponse] = agent.run("What is the closest galaxy to milky way?", stream=True) | ||
# for chunk in run_response: | ||
# print(chunk.content) | ||
|
||
# Print the response in the terminal | ||
agent.print_response("What is the closest galaxy to milky way?", stream=True) |