`Class FirestoreMemoryService`

java.lang.Object
com.google.adk.memory.FirestoreMemoryService
All Implemented Interfaces:
BaseMemoryService

public class FirestoreMemoryService extends Object implements BaseMemoryService
`FirestoreMemoryService` 是 `BaseMemoryService` 的一个实现版本,它利用 `Firestore` 来存储和检索会话内存数据(即与用户会话相关的数据)。
  • 构造函数详细信息

    • FirestoreMemoryService

      public FirestoreMemoryService(com.google.cloud.firestore.Firestore firestore)
      FirestoreMemoryService 的构造函数
  • 方法详细信息(Method Details)

    • addSessionToMemory

      public io.reactivex.rxjava3.core.Completable addSessionToMemory(Session session)
      将一个会话(session)添加到内存中。对于 FirestoreMemoryService 来说,这个操作实际上没有任何效果(即不会执行任何实际操作),因为 FirestoreSessionService 在添加事件时已经会对相关关键词进行了索引处理。
      Specified by:
      addSessionToMemory in interface BaseMemoryService
      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:
      searchMemory in interface BaseMemoryService
      Parameters:
      appName - The name of the application.
      userId - The id of the user.
      query - The query to search for.
      Returns:
      A SearchMemoryResponse containing the matching memories.