Class LC4jToolService
java.lang.Object
org.bsc.langgraph4j.langchain4j.tool.LC4jToolService
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic LC4jToolService.Builder
builder()
Optional<dev.langchain4j.data.message.ToolExecutionResultMessage>
execute
(dev.langchain4j.agent.tool.ToolExecutionRequest request) Executes the first matching toolOptional<dev.langchain4j.data.message.ToolExecutionResultMessage>
Executes the first matching toolOptional<dev.langchain4j.data.message.ToolExecutionResultMessage>
execute
(Collection<dev.langchain4j.agent.tool.ToolExecutionRequest> requests) Executes the first matching toolOptional<dev.langchain4j.data.message.ToolExecutionResultMessage>
execute
(Collection<dev.langchain4j.agent.tool.ToolExecutionRequest> requests, Object memoryId) Executes the first matching toolList<dev.langchain4j.agent.tool.ToolSpecification>
Returns a list ofToolSpecification
s that can be executed by this node
-
Method Details
-
builder
-
toolSpecifications
Returns a list ofToolSpecification
s 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 executememoryId
- 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 executememoryId
- 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
-