Class ToolContext


public class ToolContext extends CallbackContext
ToolContext object provides a structured context for executing tools or functions.
  • Method Details

    • actions

      public EventActions actions()
    • setActions

      public void setActions(EventActions actions)
    • functionCallId

      public Optional<String> functionCallId()
    • functionCallId

      public void functionCallId(String functionCallId)
    • toolConfirmation

      public Optional<ToolConfirmation> toolConfirmation()
    • toolConfirmation

      public void toolConfirmation(ToolConfirmation toolConfirmation)
    • requestConfirmation

      public void requestConfirmation(@Nullable String hint, @Nullable Object payload)
      Requests confirmation for the given function call.
      Parameters:
      hint - A hint to the user on how to confirm the tool call.
      payload - The payload used to confirm the tool call.
    • requestConfirmation

      public void requestConfirmation(@Nullable String hint)
      Requests confirmation for the given function call.
      Parameters:
      hint - A hint to the user on how to confirm the tool call.
    • requestConfirmation

      public void requestConfirmation()
      Requests confirmation for the given function call.
    • searchMemory

      public io.reactivex.rxjava3.core.Single<SearchMemoryResponse> searchMemory(String query)
      Searches the memory of the current user.
    • builder

      public static ToolContext.Builder builder(InvocationContext invocationContext)
    • toBuilder

      public ToolContext.Builder toBuilder()
    • toString

      public String toString()
      Overrides:
      toString in class Object