Package dev.langchain4j.service.tool
Class ToolService
java.lang.Object
dev.langchain4j.service.tool.ToolService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecuteInferenceAndToolsLoop
(ChatResponse chatResponse, ChatRequestParameters parameters, List<ChatMessage> messages, ChatLanguageModel chatModel, ChatMemory chatMemory, Object memoryId, Map<String, ToolExecutor> toolExecutors) executionContext
(Object memoryId, UserMessage userMessage) void
hallucinatedToolNameStrategy
(Function<ToolExecutionRequest, ToolExecutionResultMessage> toolHallucinationStrategy) void
void
toolProvider
(ToolProvider toolProvider) void
tools
(Collection<Object> objectsWithTools) void
tools
(Map<ToolSpecification, ToolExecutor> tools)
-
Constructor Details
-
ToolService
public ToolService()
-
-
Method Details
-
hallucinatedToolNameStrategy
public void hallucinatedToolNameStrategy(Function<ToolExecutionRequest, ToolExecutionResultMessage> toolHallucinationStrategy) -
toolProvider
-
tools
-
tools
-
initTools
public void initTools() -
executionContext
-
executeInferenceAndToolsLoop
public ToolExecutionResult executeInferenceAndToolsLoop(ChatResponse chatResponse, ChatRequestParameters parameters, List<ChatMessage> messages, ChatLanguageModel chatModel, ChatMemory chatMemory, Object memoryId, Map<String, ToolExecutor> toolExecutors) -
toolSpecifications
-
toolExecutors
-
toolProvider
-