Class AgentService

java.lang.Object
org.bsc.spring.agentexecutor.AgentService

@Service public class AgentService extends Object
Service class that uses the ChatClient and the ToolService to execute an LLM request.
  • Field Details

  • Constructor Details

    • AgentService

      public AgentService(org.springframework.ai.chat.client.ChatClient.Builder chatClientBuilder, ToolService toolService)
      Constructs an instance of AgentService.
      Parameters:
      chatClientBuilder - The builder for the ChatClient 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.