Class LoadMemoryTool


public class LoadMemoryTool extends FunctionTool
A tool that loads memory for the current user.

NOTE: Currently this tool only uses text part from the memory.

  • Constructor Details

    • LoadMemoryTool

      public LoadMemoryTool()
  • Method Details

    • loadMemory

      public static io.reactivex.rxjava3.core.Single<LoadMemoryResponse> loadMemory(String query, ToolContext toolContext)
      Loads the memory for the current user.
      Parameters:
      query - The query to load memory for.
      Returns:
      A list of memory results.
    • processLlmRequest

      public io.reactivex.rxjava3.core.Completable processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext)
      Description copied from class: BaseTool
      Processes the outgoing LlmRequest.Builder.

      This implementation adds the current tool's BaseTool.declaration() to the GenerateContentConfig within the builder. If a tool with function declarations already exists, the current tool's declaration is merged into it. Otherwise, a new tool definition with the current tool's declaration is created. The current tool itself is also added to the builder's internal list of tools. Override this method for processing the outgoing request.

      Overrides:
      processLlmRequest in class BaseTool