Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/sessions/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,13 @@ When a memory service is configured, your agent can use a tool or callback to re
=== "Python"
```python
from google.adk.agents import Agent
from google.adk.tools.preload_memory_tool import PreloadMemoryTool
from google.adk.tools import preload_memory

agent = Agent(
model=MODEL_ID,
name='weather_sentiment_agent',
instruction="...",
tools=[PreloadMemoryTool()]
tools=[preload_memory]
)
```

Expand Down Expand Up @@ -418,7 +418,7 @@ To extract memories from your session, you need to call `add_session_to_memory`.
=== "Python"
```python
from google.adk.agents import Agent
from google import adk
from google.adk.tools import preload_memory

async def auto_save_session_to_memory_callback(callback_context):
await callback_context.add_session_to_memory()
Expand All @@ -427,7 +427,7 @@ To extract memories from your session, you need to call `add_session_to_memory`.
model=MODEL,
name="Generic_QA_Agent",
instruction="Answer the user's questions",
tools=[adk.tools.preload_memory_tool.PreloadMemoryTool()],
tools=[preload_memory],
after_agent_callback=auto_save_session_to_memory_callback,
)
```
Expand Down
4 changes: 2 additions & 2 deletions examples/python/notebooks/express-mode-weather-agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"# @title Import necessary libraries\n",
"import os\n",
"import asyncio\n",
"from google import adk\n",
"from google.adk.tools import preload_memory\n",
"from google.adk.agents import Agent\n",
"from google.adk.sessions import VertexAiSessionService\n",
"from google.adk.memory import VertexAiMemoryBankService\n",
Expand Down Expand Up @@ -268,7 +268,7 @@
" \"You can help the user find what city has better weather based on their preferences using the preload memory tool.\",\n",
" tools=[\n",
" get_weather,\n",
" adk.tools.preload_memory_tool.PreloadMemoryTool(),\n",
" preload_memory,\n",
" ], # Pass the function directly\n",
")\n",
"\n",
Expand Down
Loading