Class AbstractToolCallSupport

java.lang.Object
org.springframework.ai.chat.model.AbstractToolCallSupport
Direct Known Subclasses:
AnthropicChatModel, AzureOpenAiChatModel, BedrockProxyChatModel, FunctionCallingHelper, MiniMaxChatModel, MistralAiChatModel, MoonshotChatModel, OllamaChatModel, OpenAiChatModel, VertexAiGeminiChatModel, ZhiPuAiChatModel

@Deprecated public abstract class AbstractToolCallSupport extends Object
Deprecated.
Use ToolCallingManager instead.
Abstract base class for tool call support. Provides functionality for handling function callbacks and executing functions.
Since:
1.0.0
Author:
Christian Tzolov, Grogdunn, Thomas Vitale, Jihoon Kim
  • Field Details

    • IS_RUNTIME_CALL

      protected static final boolean IS_RUNTIME_CALL
      Deprecated.
      See Also:
    • functionCallbackRegister

      protected final Map<String,FunctionCallback> functionCallbackRegister
      Deprecated.
      The function callback register is used to resolve the function callbacks by name.
    • functionCallbackResolver

      protected final FunctionCallbackResolver functionCallbackResolver
      Deprecated.
      The function callback resolver is used to resolve the function callbacks by name from the Spring context. It is optional and usually used with Spring auto-configuration.
  • Constructor Details

  • Method Details

    • getFunctionCallbackRegister

      @Deprecated public Map<String,FunctionCallback> getFunctionCallbackRegister()
      Deprecated.
    • runtimeFunctionCallbackConfigurations

      @Deprecated protected Set<String> runtimeFunctionCallbackConfigurations(FunctionCallingOptions runtimeFunctionOptions)
      Deprecated.
      Handle the runtime function callback configurations. Register the function callbacks
      Parameters:
      runtimeFunctionOptions - FunctionCallingOptions to handle.
      Returns:
      Set of function names to call.
    • handleToolCalls

      @Deprecated protected List<Message> handleToolCalls(Prompt prompt, ChatResponse response)
      Deprecated.
    • buildToolCallConversation

      @Deprecated protected List<Message> buildToolCallConversation(List<Message> previousMessages, AssistantMessage assistantMessage, ToolResponseMessage toolResponseMessage)
      Deprecated.
    • resolveFunctionCallbacks

      @Deprecated protected List<FunctionCallback> resolveFunctionCallbacks(Set<String> functionNames)
      Deprecated.
      Resolve the function callbacks by name. Retrieve them from the registry or try to resolve them from the Application Context.
      Parameters:
      functionNames - Name of function callbacks to retrieve.
      Returns:
      list of resolved FunctionCallbacks.
    • executeFunctions

      @Deprecated protected ToolResponseMessage executeFunctions(AssistantMessage assistantMessage, ToolContext toolContext)
      Deprecated.
    • isToolCall

      @Deprecated protected boolean isToolCall(ChatResponse chatResponse, Set<String> toolCallFinishReasons)
      Deprecated.
    • isToolCall

      @Deprecated protected boolean isToolCall(Generation generation, Set<String> toolCallFinishReasons)
      Deprecated.
      Check if the generation is a tool call. The tool call finish reasons are used to determine if the generation is a tool call.
      Parameters:
      generation - the generation to check.
      toolCallFinishReasons - the tool call finish reasons to check.
      Returns:
      true if the generation is a tool call, false otherwise.
    • isProxyToolCalls

      @Deprecated protected boolean isProxyToolCalls(Prompt prompt, FunctionCallingOptions defaultOptions)
      Deprecated.
      Check if the proxyToolCalls is enabled for the given prompt or the default tool call options. The prompt options take precedence over the default options. When the proxyToolCalls is enabled the ChatModel implementation will not handle the function calling internally. The tool call and tool response messages are exposed outside the ChatModel implementation.
      Parameters:
      prompt - the prompt to check.
      defaultOptions - the default tool call options to check.
      Returns:
      true if the proxyToolCalls is enabled, false otherwise.