-
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.
Merge pull request #1271 from phidatahq/storage-cookbooks-phi-1703
storage-cookbooks-phi-1703
- Loading branch information
Showing
10 changed files
with
102 additions
and
60 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
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,14 @@ | ||
"""Run `pip install duckduckgo-search boto3 openai` to install dependencies.""" | ||
|
||
from phi.agent import Agent | ||
from phi.tools.duckduckgo import DuckDuckGo | ||
from phi.storage.agent.dynamodb import DynamoDbAgentStorage | ||
|
||
agent = Agent( | ||
storage=DynamoDbAgentStorage(table_name="agent_sessions", region_name="us-east-1"), | ||
tools=[DuckDuckGo()], | ||
add_history_to_messages=True, | ||
debug_mode=True, | ||
) | ||
agent.print_response("How many people live in Canada?") | ||
agent.print_response("What is their national anthem called?") |
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,15 @@ | ||
"""Run `pip install duckduckgo-search sqlalchemy openai` to install dependencies.""" | ||
|
||
from phi.agent import Agent | ||
from phi.tools.duckduckgo import DuckDuckGo | ||
from phi.storage.agent.postgres import PgAgentStorage | ||
|
||
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai" | ||
|
||
agent = Agent( | ||
storage=PgAgentStorage(table_name="agent_sessions", db_url=db_url), | ||
tools=[DuckDuckGo()], | ||
add_history_to_messages=True, | ||
) | ||
agent.print_response("How many people live in Canada?") | ||
agent.print_response("What is their national anthem called?") |
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
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
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