Class LoadMemoryTool
java.lang.Object
com.google.adk.tools.BaseTool
com.google.adk.tools.FunctionTool
com.google.adk.tools.LoadMemoryTool
A tool that loads memory for the current user.
NOTE: Currently this tool only uses text part from the memory.
-
Nested Class Summary
Nested classes/interfaces inherited from class BaseTool
BaseTool.ToolArgsConfig, BaseTool.ToolConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.reactivex.rxjava3.core.Single<LoadMemoryResponse> loadMemory(String query, ToolContext toolContext) Loads the memory for the current user.io.reactivex.rxjava3.core.CompletableprocessLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) Processes the outgoingLlmRequest.Builder.Methods inherited from class FunctionTool
callLive, create, create, create, create, create, create, create, create, create, create, create, create, declaration, func, isStreaming, runAsyncMethods inherited from class BaseTool
customMetadata, description, fromConfig, longRunning, name, setCustomMetadata
-
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:BaseToolProcesses the outgoingLlmRequest.Builder.This implementation adds the current tool's
BaseTool.declaration()to theGenerateContentConfigwithin 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:
processLlmRequestin classBaseTool
-