Describe the bug
AttributeError Traceback (most recent call last)
Cell In[5], line 15
11 "If the tool is successful, present the weather report clearly."
12 "You can help the user find what city has better weather based on their preferences using the preload memory tool.",
13 tools=[
14 get_weather,
---> 15 adk.tools.preload_memory_tool.PreloadMemoryTool(),
16 ], # Pass the function directly
17 )
18
File c:\Users\GetInfo\Documents\express-mode-weather-agent.venv\Lib\site-packages\google\adk\tools_init_.py:102, in getattr(name)
100 """Lazy loads tools to avoid expensive imports."""
101 if name not in _LAZY_MAPPING:
--> 102 raise AttributeError(f'module {name!r} has no attribute {name!r}')
104 module_path, attr_name = _LAZY_MAPPING[name]
105 # name is google.adk.tools and we are doing a relative import
106 # from there.
AttributeError: module 'google.adk.tools' has no attribute 'preload_memory_tool'
To Reproduce
Steps to reproduce the behavior:
- Open file directory using VS Code
- Run following comands
uv init uv add google-adk
- Open express-mode-weather-agent.ipynb
- Select recommended python interpreter (it must be the .venv related)
- Run each cell up to cell code "5"
A clear and concise description of what you expected to happen.
Versions
- OS: Windows 11
- ADK version: 1.34.0
- Python version: 3.14
Fix
Replace by
from google.adk.tools.preload_memory_tool import PreloadMemoryTool memory_tool = PreloadMemoryTool()
Reference:
https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/memory-bank/adk-quickstart?hl=pt-br#define_a_memory_retrieval_tool
Describe the bug
AttributeError Traceback (most recent call last)
Cell In[5], line 15
11 "If the tool is successful, present the weather report clearly."
12 "You can help the user find what city has better weather based on their preferences using the preload memory tool.",
13 tools=[
14 get_weather,
---> 15 adk.tools.preload_memory_tool.PreloadMemoryTool(),
16 ], # Pass the function directly
17 )
18
File c:\Users\GetInfo\Documents\express-mode-weather-agent.venv\Lib\site-packages\google\adk\tools_init_.py:102, in getattr(name)
100 """Lazy loads tools to avoid expensive imports."""
101 if name not in _LAZY_MAPPING:
--> 102 raise AttributeError(f'module {name!r} has no attribute {name!r}')
104 module_path, attr_name = _LAZY_MAPPING[name]
105 # name is
google.adk.toolsand we are doing a relative import106 # from there.
AttributeError: module 'google.adk.tools' has no attribute 'preload_memory_tool'
To Reproduce
Steps to reproduce the behavior:
uv init uv add google-adkA clear and concise description of what you expected to happen.
Versions
Fix
Replace by
from google.adk.tools.preload_memory_tool import PreloadMemoryTool memory_tool = PreloadMemoryTool()Reference:
https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/memory-bank/adk-quickstart?hl=pt-br#define_a_memory_retrieval_tool