You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
java.lang.NullPointerException: Cannot invoke "io.agentscope.core.tool.Toolkit.getToolSchemas()" because "this.toolkit" is null #3
public static void main(String[] args) {
Model model = DashScopeChatModel.builder()
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
.modelName("qwen-max")
.build();
ReActAgent agent = ReActAgent.builder()
.name("hello-world-agent")
.sysPrompt("You are a helpful AI assistant. Be concise and friendly. " +
"When thinking through problems, use <thinking>...</thinking> tags to show your reasoning.")
.model(model)
.memory(new InMemoryMemory())
.formatter(new DashScopeChatFormatter())
.build();
Msg userMessage = Msg.builder()
.role(MsgRole.USER)
.textContent("Hello, please introduce yourself.")
.build();
Msg response = agent.reply(userMessage).block();
System.out.println("Agent Response: " + response.getTextContent());
}
抛出异常:
[main] WARN io.agentscope.core.hook.HookManager -- Hook execution failed for reply
java.lang.NullPointerException: Cannot invoke "io.agentscope.core.tool.Toolkit.getToolSchemas()" because "this.toolkit" is null
at io.agentscope.core.ReActAgent.lambda$reasoning$3(ReActAgent.java:121)
at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:153)
at reactor.core.publisher.MonoFlatMapMany.subscribeOrReturn(MonoFlatMapMany.java:49)
at reactor.core.publisher.Flux.subscribe(Flux.java:8876)
at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:202)
at reactor.core.publisher.MonoFlatMapMany.subscribeOrReturn(MonoFlatMapMany.java:49)
at reactor.core.publisher.Flux.subscribe(Flux.java:8876)
at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onComplete(FluxConcatArray.java:238)
Activity
fix(ReActAgent): add default toolkit (agentscope-ai#5)
fix(extensions-mongodb): address review findings from xzxiaoshan