Repository navigation
Closed
Description
I have a agent that uses 'load_memory' to recall previous conversation. the 'load_memory' tool uses a arg 'query' to find relevent conversation. But multiple time the function call doesn't have any args.
root_agent = LlmAgent(
name="Supervisor",
model="gemini-2.0-flash",
description=(
"You are a supervisor agent that delegates survey modification tasks to other agents."
),
instruction=(
"You are a supervisor agent that delegates survey question modification tasks to other agents."
"all queries are about survey discussed in the previous conversation."
"use 'load_memory' with appropriate `query` when you want to access survey questions discussed in past conversation."
),
tools=[ask_query, load_memory],
)
session = session_service.create_session(
app_name=APP_NAME,
user_id=USER_ID,
session_id=SESSION_ID
)
news_list: list[str] = [
"What is the latest news in technology?",
"What are the top headlines in sports?",
...
]
session_service.append_event(session, Event(
invocation_id=SESSION_ID,
author="user",
content=Content(
parts=[
Part(
text=news
)
for news in news_list
]
)
))
runner = Runner(
agent=root_agent,
app_name=APP_NAME,
session_service=session_service,
memory_service=memory_service
)
memory_service.add_session_to_memory(session)on certain queries the load_memory gets successfully called with correct args. but sometime it doesn't
** successfull function call**:
[Event] Author: Supervisor, Type: Event, Final: False, Content: parts=[Part(video_metadata=None, thought=None, code_execution_result=None, executable_code=None, file_data=None, function_call=FunctionCall(id=<adk-id>, args={'query': 'news about India'}, name='load_memory'), function_response=None, inline_data=None, text=None)] role='model'
** failed function call**:
[Event] Author: Supervisor, Type: Event, Final: False, Content: parts=[Part(video_metadata=None, thought=None, code_execution_result=None, executable_code=None, file_data=None, function_call=FunctionCall(id=<adk-id>, args={}, name='load_memory'), function_response=None, inline_data=None, text=None)] role='model'
How do i ensure that function call happens correctly or request again for correct function call?
Metadata
Metadata
Assignees
Labels
tools[Component] This issue is related to tools
Activity
shu8hamrajput commentedon Apr 25, 2025
I am not sure if it's right way or not But I fixed this issue for myself by making query a required field in
load_modeldeclartion in filegoogle/adk/tools/load_memory_tool.py:60the updated class looks like:
shu8hamrajput commentedon Apr 25, 2025
raised a PR with changes #389
seanzhou1023 commentedon May 28, 2025
@shu8hamrajput thanks for the fix, approved.