Class AgentFunctionCallbackWrapper<I,O>

java.lang.Object
org.bsc.spring.agentexecutor.function.AgentFunctionCallbackWrapper<I,O>
All Implemented Interfaces:
BiFunction<I,org.springframework.ai.chat.model.ToolContext,O>, org.springframework.ai.model.function.FunctionCallback

public class AgentFunctionCallbackWrapper<I,O> extends Object implements BiFunction<I,org.springframework.ai.chat.model.ToolContext,O>, org.springframework.ai.model.function.FunctionCallback
  • Constructor Details

    • AgentFunctionCallbackWrapper

      protected AgentFunctionCallbackWrapper(String name, String description, String inputTypeSchema, Class<I> inputType, Function<O,String> responseConverter, com.fasterxml.jackson.databind.ObjectMapper objectMapper, BiFunction<I,org.springframework.ai.chat.model.ToolContext,O> function)
  • Method Details

    • convertResponse

      public O convertResponse(org.springframework.ai.chat.messages.ToolResponseMessage.ToolResponse toolResponse)
    • call

      public String call(String functionInput, org.springframework.ai.chat.model.ToolContext toolContext)
      Specified by:
      call in interface org.springframework.ai.model.function.FunctionCallback
    • call

      public String call(String functionArguments)
      Specified by:
      call in interface org.springframework.ai.model.function.FunctionCallback
    • apply

      public O apply(I input, org.springframework.ai.chat.model.ToolContext context)
      Specified by:
      apply in interface BiFunction<I,org.springframework.ai.chat.model.ToolContext,O>
    • builder

      public static <I, O> AgentFunctionCallbackWrapper.Builder<I,O> builder(BiFunction<I,org.springframework.ai.chat.model.ToolContext,O> biFunction)
    • builder

      public static <I, O> AgentFunctionCallbackWrapper.Builder<I,O> builder(Function<I,O> function)