Package org.bsc.spring.agentexecutor
Class AgentService
java.lang.Object
org.bsc.spring.agentexecutor.AgentService
Service class that uses the
ChatClient
and
the ToolService
to execute an LLM request.-
Field Summary
-
Constructor Summary
ConstructorDescriptionAgentService
(org.springframework.ai.chat.client.ChatClient.Builder chatClientBuilder, ToolService toolService) Constructs an instance ofAgentService
. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.ai.chat.model.ChatResponse
execute
(String input, List<AgentExecutor.Step> intermediateSteps) Executes a chat request using the provided input and intermediate steps.
-
Field Details
-
toolService
-
-
Constructor Details
-
AgentService
public AgentService(org.springframework.ai.chat.client.ChatClient.Builder chatClientBuilder, ToolService toolService) Constructs an instance ofAgentService
.- Parameters:
chatClientBuilder
- The builder for theChatClient
to be used.toolService
- The service providing tools and functions that the agent can utilize.
-
-
Method Details
-
execute
public org.springframework.ai.chat.model.ChatResponse execute(String input, List<AgentExecutor.Step> intermediateSteps) Executes a chat request using the provided input and intermediate steps.- Parameters:
input
- The user's input string for the chat request.intermediateSteps
- A list of intermediate steps to generate tool responses.- Returns:
- A
ChatResponse
object containing the response from the chat client.
-