Class AugmentedToolCallback<T extends Record>

java.lang.Object
org.springframework.ai.tool.augment.AugmentedToolCallback<T>
All Implemented Interfaces:
ToolCallback

public class AugmentedToolCallback<T extends Record> extends Object implements ToolCallback
This class wraps an existing ToolCallback and modifies its input schema to include additional fields defined in the provided Record type. It also provides a mechanism to handle these extended arguments, either by consuming them via a provided Consumer or by removing them from the input after processing.
Author:
Christian Tzolov
  • Constructor Details

  • Method Details

    • getToolDefinition

      public ToolDefinition getToolDefinition()
      Description copied from interface: ToolCallback
      Definition used by the AI model to determine when and how to call the tool.
      Specified by:
      getToolDefinition in interface ToolCallback
    • call

      public String call(String toolInput)
      Description copied from interface: ToolCallback
      Execute tool with the given input and return the result to send back to the AI model.
      Specified by:
      call in interface ToolCallback
    • call

      public String call(String toolInput, @Nullable ToolContext tooContext)
      Description copied from interface: ToolCallback
      Execute tool with the given input and context, and return the result to send back to the AI model.
      Specified by:
      call in interface ToolCallback