-
Notifications
You must be signed in to change notification settings - Fork 248
Open
Description
Describe the bug
I am invoking a tool and the result is ignored except if I wrap it in the "result" key of the returned map.
Using this:
dependencies {
implementation(group: 'com.google.adk', name: 'google-adk-dev', version: '0.3.0')
implementation(group: 'com.google.adk', name: 'google-adk', version: '0.3.0')
}To Reproduce
With the return Map.of("count", 123L), the agent does not pick up the result.
If i replace it with Map.of("result", 123L), all works well.
public class AdkPOC {
private static final String CLAUDE_MODEL_ID = "claude-haiku-4-5";
public static void main(String[] args) {
var anthropicClient = AnthropicOkHttpClient.builder()
.apiKey(System.getenv("ANTHROPIC_API_KEY"))
.build();
var claudeModel = new Claude(
CLAUDE_MODEL_ID,
anthropicClient
);
var dataAnalyst = LlmAgent.builder()
.name("Data Analyst")
.description("An agent to perform data analytics with multiple tools")
.model(claudeModel)
.tools(FunctionTool.create(AdkPOC.class, "getRowCount"))
.build();
AdkWebServer.start(dataAnalyst);
}
public static Map<String, Object> getRowCount(
@Schema(name = "dataSetName", description = "The name of the dataset to query")
String sheetName
) {
return Map.of("count", 123L);
}
}Expected behavior
I would expect that the structure of the resulting map is not imposed
Metadata
Metadata
Assignees
Labels
No labels