Skip to content

Commit b98cfaf

Browse files
zhangyunan1994yaohuitc
authored andcommitted
refactor(tool): Add the missing @ToolParam annotations to RoutingByToolCallsExample. (agentscope-ai#479)
1 parent 68e7fb1 commit b98cfaf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

agentscope-examples/advanced/src/main/java/io/agentscope/examples/advanced/RoutingByToolCallsExample.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import io.agentscope.core.model.DashScopeChatModel;
2525
import io.agentscope.core.model.GenerateOptions;
2626
import io.agentscope.core.tool.Tool;
27+
import io.agentscope.core.tool.ToolParam;
2728
import io.agentscope.core.tool.Toolkit;
2829
import io.agentscope.examples.advanced.util.MsgUtils;
2930

@@ -85,7 +86,9 @@ public static class SimpleTools {
8586
@Tool(
8687
name = "generate_Python_code",
8788
description = "Generate Python code based on the demand")
88-
public Msg generatePython(String demand) {
89+
public Msg generatePython(
90+
@ToolParam(name = "demand", description = "The demand for the Python code")
91+
String demand) {
8992
System.out.println("I am PythonAgent,now generating Python code for demand: " + demand);
9093
String apiKey = ExampleUtils.getDashScopeApiKey();
9194
ReActAgent agent =
@@ -124,7 +127,9 @@ public Msg generatePython(String demand) {
124127
* @param demand The demand for the poem.
125128
*/
126129
@Tool(name = "generate_poem", description = "Generate a poem based on the demand")
127-
public Msg generatePoem(String demand) {
130+
public Msg generatePoem(
131+
@ToolParam(name = "demand", description = "The demand for the poem")
132+
String demand) {
128133
System.out.println("I am PoemAgent,now generating a poem for demand: " + demand);
129134
String apiKey = ExampleUtils.getDashScopeApiKey();
130135
ReActAgent agent =

0 commit comments

Comments
 (0)