JsonStorage class.
Usage
json_storage_for_agent.py
Params
| Parameter | Type | Default | Description |
|---|---|---|---|
dir_path | str | - | Path to the folder to be used to store the JSON files. |
Developer Resources
- View Cookbook
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
You are viewing v1 docs. For the latest documentation, visit docs.agno.com
JsonStorage class.
"""Run `pip install duckduckgo-search openai` to install dependencies."""
from agno.agent import Agent
from agno.storage.json import JsonStorage
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
storage=JsonStorage(dir_path="tmp/agent_sessions_json"),
tools=[DuckDuckGoTools()],
add_history_to_messages=True,
)
agent.print_response("How many people live in Canada?")
agent.print_response("What is their national anthem called?")
| Parameter | Type | Default | Description |
|---|---|---|---|
dir_path | str | - | Path to the folder to be used to store the JSON files. |
Was this page helpful?