Interface ToolExecutionEligibilityChecker

All Superinterfaces:
Function<ChatResponse,Boolean>

public interface ToolExecutionEligibilityChecker extends Function<ChatResponse,Boolean>
Interface for determining when tool execution should be performed based on model responses.
Author:
Christian Tzolov
  • Method Details

    • isToolExecutionRequired

      default boolean isToolExecutionRequired(ChatOptions promptOptions, ChatResponse chatResponse)
      Determines if tool execution should be performed based on the prompt options and chat response.
      Parameters:
      promptOptions - The options from the prompt
      chatResponse - The response from the chat model
      Returns:
      true if tool execution should be performed, false otherwise
    • isToolCallResponse

      default boolean isToolCallResponse(ChatResponse chatResponse)
      Determines if the response is a tool call message response.
      Parameters:
      chatResponse - The response from the chat model call
      Returns:
      true if the response is a tool call message response, false otherwise
    • isInternalToolExecutionEnabled

      default boolean isInternalToolExecutionEnabled(ChatOptions chatOptions)
      Determines if tool execution should be performed by the Spring AI or by the client.
      Parameters:
      chatOptions - The options from the chat
      Returns:
      true if tool execution should be performed by Spring AI, false if it should be performed by the client