Class LC4jToolService

java.lang.Object
org.bsc.langgraph4j.langchain4j.tool.LC4jToolService

public final class LC4jToolService extends Object
  • Method Details

    • builder

      public static LC4jToolService.Builder builder()
    • toolSpecifications

      public List<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications()
      Returns a list of ToolSpecifications that can be executed by this node
      Returns:
      a list of tool specifications
    • execute

      public Optional<dev.langchain4j.data.message.ToolExecutionResultMessage> execute(dev.langchain4j.agent.tool.ToolExecutionRequest request, Object memoryId)
      Executes the first matching tool
      Parameters:
      request - the request to execute
      memoryId - the memory id to pass to the tool
      Returns:
      the result of the tool
    • execute

      public Optional<dev.langchain4j.data.message.ToolExecutionResultMessage> execute(Collection<dev.langchain4j.agent.tool.ToolExecutionRequest> requests, Object memoryId)
      Executes the first matching tool
      Parameters:
      requests - the requests to execute
      memoryId - the memory id to pass to the tool
      Returns:
      the result of the tool
    • execute

      public Optional<dev.langchain4j.data.message.ToolExecutionResultMessage> execute(dev.langchain4j.agent.tool.ToolExecutionRequest request)
      Executes the first matching tool
      Parameters:
      request - the request to execute
      Returns:
      the result of the tool
    • execute

      public Optional<dev.langchain4j.data.message.ToolExecutionResultMessage> execute(Collection<dev.langchain4j.agent.tool.ToolExecutionRequest> requests)
      Executes the first matching tool
      Parameters:
      requests - the requests to execute
      Returns:
      the result of the tool