[Feature]: Support passing user-defined fields in `SubAgentTool`
Problem Description
Currently, SubAgentTool is implemented solely based on conversation history. Consequently, users cannot pass external parameters (e.g., userId) to the sub-agent securely or accurately.
Proposed Solution
We need to design a mechanism that allows users to define and pass specific fields to the SubAgentTool explicitly.
@AlbumenJ I'm interested in this issue. Please assign it to me.
@AlbumenJ
I have gone through the code in SubAgentTool.java, and I have a few questions I’d like to ask:
- How will these
external parametersbe used? For example, if auserIdis passed to a sub-agent, how specifically will the sub-agent utilize it? - How should I handle these
external parameters? Should I concatenate them with theuserMsg?https://github.com/agentscope-ai/agentscope-java/blob/b317f0329c1b08074699c98882cb613f88adaae9/agentscope-core/src/main/java/io/agentscope/core/tool/subagent/SubAgentTool.java#L152-L157
It's better to define a custom Msg. We also support call(List<Msg>).
The Msg can contain custom parameters. I would like to extract this key as a Tool parameter, which can be injected either by the model or via the ToolExecutionContext.
I'm also stuck here now, is there any progress?