-
Notifications
You must be signed in to change notification settings - Fork 279
Open
Labels
bugSomething isn't workingSomething isn't working
Description
code like this:
Toolkit toolkit = new Toolkit();
SkillBox skillBox = new SkillBox(toolkit);
AgentSkill dataSkill = AgentSkill.builder()
.name("data_analysis")
.description("Comprehensive data analysis capabilities")
.skillContent("# Data Analysis\n " +
"You can generate, load, preprocess, and analyze data using the available tools.\n" +
"\n" +
"## Available Tools\n" +
"1. generateData: Generate synthetic data based on specified parameters.\n" +
"2. loadData: Load and preprocess data for analysis.\n" +
"3. analyzeData: Perform statistical analysis and visualization on the data.\n")
.build();
AgentTool loadDataTool = new AgentTool() {
@Override
public String getName() {
return "loadData";
}
@Override
public String getDescription() {
return "Load and preprocess data for analysis";
}
@Override
public Map<String, Object> getParameters() {
return Map.of(
"dataSource", "The source of the data to be loaded",
"preprocessingSteps", "Steps to preprocess the data"
);
}
@Override
public Mono<ToolResultBlock> callAsync(ToolCallParam param) {
log.info("Executing loadDataTool with param: {}", param);
return Mono.just(ToolResultBlock.builder()
.output(TextBlock.builder().text("Data loaded and preprocessed successfully").build())
.build());
}
};
skillBox.registration()
.skill(dataSkill)
.tool(loadDataTool)
.apply();
ReActAgent agent = ReActAgent.builder()
.name("Assistant")
.sysPrompt("你是一个有帮助的 AI 助手。")
.model(OpenAIChatModel.builder()
.apiKey("xxxx")
.baseUrl("https://xxx")
.stream(true)
.modelName("DeepSeek-V3.2")
.build())
.toolkit(toolkit)
.skillBox(skillBox)
.build();
Msg response = agent.call(Msg.builder()
.textContent("帮我生成一批数据,并进行分析")
.build()).block();
log.info(response.getTextContent());
output:
2026-02-09 17:53:48.664 [main] INFO io.agentscope.core.skill.SkillBox - Registered skill 'data_analysis_custom'
2026-02-09 17:53:48.667 [main] INFO i.a.core.tool.ToolGroupManager - Created tool group 'data_analysis_custom_skill_tools': data_analysis_custom_skill_tools
2026-02-09 17:53:48.667 [main] INFO io.agentscope.core.tool.Toolkit - Registered tool 'loadData' in group 'data_analysis_custom_skill_tools'
2026-02-09 17:53:48.913 [main] INFO i.a.core.tool.ToolGroupManager - Created tool group 'skill-build-in-tools': skill build-in tools, could contain(load_skill_through_path)
2026-02-09 17:53:48.914 [main] INFO io.agentscope.core.tool.Toolkit - Registered tool 'load_skill_through_path' in group 'skill-build-in-tools'
2026-02-09 17:53:48.914 [main] INFO io.agentscope.core.skill.SkillBox - Registered skill load tools to toolkit
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "io.agentscope.core.message.Msg.getTextContent()" because "response" is null
at cn.pomit.agent.TestAgent.main(TestAgent.java:85)
2026-02-09 17:53:49.866 [HttpTransportFactory-ShutdownHook] INFO i.a.c.m.t.HttpTransportFactory - Shutting down 1 managed HttpTransport(s)
and pom is:
<dependency>
<groupId>io.agentscope</groupId>
<artifactId>agentscope</artifactId>
<version>1.0.8</version>
</dependency>
just the demo, just no error, no output. and It is ok when no skillbox.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Backlog