agentscope-java
agentscope-java copied to clipboard
[Feature Request] Support returnDirect behavior for ReActAgent tools
Background
In the current ReActAgent flow, after a tool is executed, the agent always performs another reasoning/model call to generate the final response.
Feature Request
I would like to support a returnDirect-like option for tools, similar to Spring AI.
When a tool is configured with this option, ReActAgent should:
- Execute the tool.
- Return the tool result directly.
- Skip the next reasoning/model call.
- End the current agent execution.
For example:
@Tool(returnDirect = true)
public String getUserProfile(...) {
...
}
This behavior should be configurable per tool, while preserving the current behavior by default for existing tools.
Is there currently a recommended way to achieve this in ReActAgent? If not, could support for this behavior be added?
重复的 issue,见 https://github.com/agentscope-ai/agentscope-java/issues/1408