AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.
Describe the bug
A clear and concise description of what the bug is.
In the PreActingEvent of a custom hook, modifying the input parameters of tool_use does not take effect during tool execution.
To Reproduce
Steps to reproduce the behavior:
- You code
public class ToolUseHook implements Hook {
@OverRide
public Mono onEvent(T event) {
if (event instanceof PreActingEvent preActing) {
ToolUseBlock toolUse = preActing.getToolUse();
Map<String, Object> input = new HashMap<>(toolUse.getInput());
input.put("message", (String) input.get("message") + "123456");
ToolUseBlock newToolUse = ToolUseBlock.builder()
.id(toolUse.getId())
.name(toolUse.getName())
.input(input)
.content(toolUse.getContent())
.metadata(toolUse.getMetadata())
.build();
preActing.setToolUse(newToolUse);
}
// Return the event unchanged
return Mono.just(event);
}
}
- How to execute
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Error messages
Detailed error messages.
Environment (please complete the following information):
- AgentScope-Java Version: [e.g. 1.0.4, check your pom.xml dependency version or run
mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]
- Java Version: [e.g. 17]
- OS: [e.g. macos, windows]
Additional context
Add any other context about the problem here.