File tree 1 file changed +5
-3
lines changed
langchain4j/src/test/java/org/bsc/langgraph4j
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 4
4
import com .google .gson .internal .LinkedTreeMap ;
5
5
import dev .langchain4j .agent .tool .*;
6
6
import dev .langchain4j .data .message .ToolExecutionResultMessage ;
7
+ import dev .langchain4j .model .chat .request .json .JsonObjectSchema ;
7
8
import dev .langchain4j .service .tool .ToolExecutor ;
8
9
import org .bsc .langgraph4j .langchain4j .tool .ToolNode ;
9
10
import org .junit .jupiter .api .Test ;
10
11
11
12
import java .util .Map ;
12
13
import java .util .Optional ;
13
14
14
- import static dev .langchain4j .agent .tool .JsonSchemaProperty .description ;
15
15
import static java .lang .String .format ;
16
16
import static org .junit .jupiter .api .Assertions .assertEquals ;
17
17
import static org .junit .jupiter .api .Assertions .assertTrue ;
@@ -47,8 +47,10 @@ public void invokeToolNode() {
47
47
48
48
toolSpecification = ToolSpecification .builder ()
49
49
.name ("specialSumTwoNumbers" )
50
- .addParameter ("operand1" , JsonSchemaProperty .type ("float" ), description ("Operand 1 for specialK operation" ))
51
- .addParameter ("operand2" , JsonSchemaProperty .type ("float" ), description ("Operand 2 for specialK operation" ))
50
+ .parameters (JsonObjectSchema .builder ()
51
+ .addNumberProperty ("operand1" ,"Operand 1 for specialK operation" )
52
+ .addNumberProperty ( "operand2" , "Operand 2 for specialK operation" )
53
+ .build ())
52
54
.description ("Returns a Float - sum of two numbers" )
53
55
.build ();
54
56
You can’t perform that action at this time.
0 commit comments