Describe the Bug:
Use of built-in load_memory tool results in error when an agent is configured to use the VertexAiSessionService for managing session events. In particular, the error is raised when appending the resulting function_response event to the session service.
Steps to Reproduce:
- Configure the VertexAI Sessions service and set agent launcher to use it
- Register the built-in ADK
load_memory tool on the agent
- Launch adk agent via the ADK web UI
- Submit a query to the agent that produces a
load_memory tool call
Reproducing code snippet provided below.
...
// Initialise Vertex AI Engine Session Service
sessionService, err := vertexai.NewSessionService(ctx, vertexai.VertexAIServiceConfig{
ProjectID: "PROJECT",
Location: "LOCATION",
ReasoningEngine: "REASONING_ENGINE",
})
if err != nil {
log.Fatalf("failed to create session service")
}
// Create new agent
adkAgent, err := llmagent.New(llmagent.Config{
Name: "agent",
Model: model,
Description: "Description",
Instruction: "You are a helpful assistant..",
Tools: []tool.Tool{
loadmemorytool.New(),
},
})
if err != nil {
log.Fatalf("failed to create agent: %v", err)
}
// Configure launcher
config := &launcher.Config{
AgentLoader: agent.NewSingleLoader(adkAgent),
SessionService: sessionService,
MemoryService: memory.InMemoryService(),
}
...
Expected Behavior:
The agent should process the request, generate a load_memory function call event, execute the tool to retrieve results, generate a load_memory function response and successfully store the resulting function response event in the sessions service.
Observed Behavior:
The agent loop fails with the below error, indicating that the created function response event could not be successfully appended to the session service.
Additional Context:
Further debugging revealed that the source of the error is linked to the attempted conversion of the returned function response result to structpb.Struct type within the underlying session service VertexAI client setup. [memory.Entry] is not a valid type that the NewStruct() function is able to successfully handle.
Environment Details:
- ADK Library Version: 1.2.0
Model Information:
Describe the Bug:
Use of built-in
load_memorytool results in error when an agent is configured to use theVertexAiSessionServicefor managing session events. In particular, the error is raised when appending the resultingfunction_responseevent to the session service.Steps to Reproduce:
load_memorytool on the agentload_memorytool callReproducing code snippet provided below.
Expected Behavior:
The agent should process the request, generate a
load_memoryfunction call event, execute the tool to retrieve results, generate aload_memoryfunction response and successfully store the resulting function response event in the sessions service.Observed Behavior:
The agent loop fails with the below error, indicating that the created function response event could not be successfully appended to the session service.
Additional Context:
Further debugging revealed that the source of the error is linked to the attempted conversion of the returned function response result to
structpb.Structtype within the underlying session service VertexAI client setup.[memory.Entry]is not a valid type that the NewStruct() function is able to successfully handle.Environment Details:
Model Information: