Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions agentscope-core/src/main/java/io/agentscope/core/tool/Toolkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,16 @@ public void createToolGroup(String groupName, String description) {
groupManager.createToolGroup(groupName, description);
}

/**
* Add a tool to a group.
*
* @param toolName Tool name
* @param groupName Group name
*/
public void addToolToGroup(String toolName, String groupName) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToolGroupManager maintains the mapping between tools and groups.

If we call ToolGroup.addTool() directly, the association will be missing, which causes isActiveTool and isGroupedTool to return incorrect results.

Therefore, want to expose the ToolGroupManager.addToolToGroup method instead.
image
image

groupManager.addToolToGroup(toolName, groupName);
}

/**
* Update the activation status of tool groups.
*
Expand Down
Loading
Loading