Skip to content

[Bug]:智能体to工具只保留最后一个的bug,注册多个时,前面的会丢 #1140

@wuxianjun66

Description

@wuxianjun66

智能体to工具只保留最后一个的bug,注册多个时,前面的会丢

--- 代码
ReActAgent sxls = ReActAgent.builder()
.name("数学老师")
.sysPrompt("你是一个数学老师")
.description("只处理数学相关的问题")
.hooks(List.of(
new LoggingHook(),new AssistantToUser()
))
.model(model)
.memory(new InMemoryMemory())
.build();
ReActAgent ywls = ReActAgent.builder()
.name("语文老师")
.sysPrompt("你是一个语文老师")
.description("只处理语文相关问题")
.hooks(List.of(
new LoggingHook(),new AssistantToUser()
))
.model(model)
.memory(new InMemoryMemory())
.build();
ReActAgent yyls = ReActAgent.builder()
.name("英语老师")
.sysPrompt("你是一个英语老师")
.description("只处理英语相关问题")
.hooks(List.of(
new LoggingHook(),new AssistantToUser()
))
.model(model)
.memory(new InMemoryMemory())
.build();

    Toolkit toolkit = new Toolkit();
    toolkit.createToolGroup("experts", "老师智能体", true);
    toolkit.registration()
            .subAgent(() -> ywls)
            .group("experts")
            .apply();
    toolkit.registration()
            .subAgent(() -> sxls)
            .group("experts")
            .apply();
    toolkit.registration()
            .subAgent(() -> yyls)
            .group("experts")
            .apply();

    System.out.println(JSONObject.toJSONString(toolkit));

--- 输出
{"activeGroups":["experts"],"toolNames":["call_____"],"toolSchemas":[{"description":"只处理英语相关问题","name":"call_____","parameters":{"type":"object","properties":{"session_id":{"description":"Session ID for multi-turn dialogue. Omit to start a NEW session. To CONTINUE an existing session and retain memory, you MUST extract the session_id from the previous response and pass it here.","type":"string"},"message":{"description":"Message to send to the agent","type":"string"}},"required":["message"]}}]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions