Skip to content

Commit

Permalink
refactor(langchain4jToolNodeTest.java): remove deprecation in update …
Browse files Browse the repository at this point in the history
…tool parameters definition
  • Loading branch information
bsorrentino committed Feb 11, 2025
1 parent 4f2f10d commit f043629
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import com.google.gson.internal.LinkedTreeMap;
import dev.langchain4j.agent.tool.*;
import dev.langchain4j.data.message.ToolExecutionResultMessage;
import dev.langchain4j.model.chat.request.json.JsonObjectSchema;
import dev.langchain4j.service.tool.ToolExecutor;
import org.bsc.langgraph4j.langchain4j.tool.ToolNode;
import org.junit.jupiter.api.Test;

import java.util.Map;
import java.util.Optional;

import static dev.langchain4j.agent.tool.JsonSchemaProperty.description;
import static java.lang.String.format;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down Expand Up @@ -47,8 +47,10 @@ public void invokeToolNode() {

toolSpecification = ToolSpecification.builder()
.name("specialSumTwoNumbers")
.addParameter("operand1", JsonSchemaProperty.type("float"), description("Operand 1 for specialK operation"))
.addParameter("operand2", JsonSchemaProperty.type("float"), description("Operand 2 for specialK operation"))
.parameters(JsonObjectSchema.builder()
.addNumberProperty("operand1","Operand 1 for specialK operation" )
.addNumberProperty( "operand2", "Operand 2 for specialK operation" )
.build())
.description("Returns a Float - sum of two numbers")
.build();

Expand Down

0 comments on commit f043629

Please sign in to comment.