`Class FirestoreMemoryService`
java.lang.Object
com.google.adk.memory.FirestoreMemoryService
- All Implemented Interfaces:
BaseMemoryService
`FirestoreMemoryService` 是 `BaseMemoryService` 的一个实现版本,它利用 `Firestore` 来存储和检索会话内存数据(即与用户会话相关的数据)。
-
构造函数概述
ConstructorsConstructorDescriptionFirestoreMemoryService(com.google.cloud.firestore.Firestore firestore) FirestoreMemoryService 的构造函数 -
方法概述
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.CompletableaddSessionToMemory(Session session) 将一个会话(session)添加到内存中。io.reactivex.rxjava3.core.Single<SearchMemoryResponse> searchMemory(String appName, String userId, String query) 在内存中搜索与查询关键词匹配的、包含指定应用程序名称(appName)和用户ID(userId)的条目。
-
构造函数详细信息
-
FirestoreMemoryService
public FirestoreMemoryService(com.google.cloud.firestore.Firestore firestore) FirestoreMemoryService 的构造函数
-
-
方法详细信息(Method Details)
-
addSessionToMemory
将一个会话(session)添加到内存中。对于 FirestoreMemoryService 来说,这个操作实际上没有任何效果(即不会执行任何实际操作),因为 FirestoreSessionService 在添加事件时已经会对相关关键词进行了索引处理。- Specified by:
addSessionToMemoryin interfaceBaseMemoryService- Parameters:
session- The session to add.
-
searchMemory
public io.reactivex.rxjava3.core.Single<SearchMemoryResponse> searchMemory(String appName, String userId, String query) 在内存中搜索与查询关键词匹配的、包含指定应用程序名称(appName)和用户ID(userId)的条目。- Specified by:
searchMemoryin interfaceBaseMemoryService- Parameters:
appName- The name of the application.userId- The id of the user.query- The query to search for.- Returns:
- A
SearchMemoryResponsecontaining the matching memories.
-