Package org.bsc.spring.agentexecutor
Class ToolService
java.lang.Object
org.bsc.spring.agentexecutor.ToolService
-
Constructor Summary
ConstructorDescriptionToolService
(org.springframework.context.ApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescription<I,
O> Optional<AgentFunctionCallbackWrapper<I, O>> agentFunction
(@NonNull String name) List<org.springframework.ai.model.function.FunctionCallback>
org.springframework.ai.chat.messages.ToolResponseMessage
buildToolResponseMessage
(org.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse response) CompletableFuture<org.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse>
executeFunction
(org.springframework.ai.chat.messages.AssistantMessage.ToolCall toolCall) CompletableFuture<org.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse>
executeFunction
(org.springframework.ai.chat.messages.AssistantMessage.ToolCall toolCall, Map<String, Object> toolContextMap) <O> Optional<O>
getFunctionResult
(org.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse response)
-
Constructor Details
-
ToolService
public ToolService(org.springframework.context.ApplicationContext applicationContext)
-
-
Method Details
-
agentFunctionsCallback
-
agentFunction
public <I,O> Optional<AgentFunctionCallbackWrapper<I,O>> agentFunction(@NonNull @NonNull String name) -
getFunctionResult
public <O> Optional<O> getFunctionResult(@NonNull org.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse response) -
buildToolResponseMessage
public org.springframework.ai.chat.messages.ToolResponseMessage buildToolResponseMessage(@NonNull org.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse response) -
executeFunction
public CompletableFuture<org.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse> executeFunction(org.springframework.ai.chat.messages.AssistantMessage.ToolCall toolCall, Map<String, Object> toolContextMap) -
executeFunction
public CompletableFuture<org.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse> executeFunction(org.springframework.ai.chat.messages.AssistantMessage.ToolCall toolCall)
-