Interface BaseMemoryService

All Known Implementing Classes:
FirestoreMemoryService, InMemoryMemoryService

public interface BaseMemoryService
用于内存服务的基础合同。

该服务提供了将会话数据加载到内存中的功能,这样就可以利用这些内存数据来处理用户的查询请求了。

  • 方法概述

    Modifier and Type
    Method
    Description
    io.reactivex.rxjava3.core.Completable
    将一个会话添加到内存服务中。
    io.reactivex.rxjava3.core.Single<SearchMemoryResponse>
    searchMemory(String appName, String userId, String query)
    异步地搜索与查询条件匹配的会话(session)。
  • 方法详细信息(Method Details)

    • addSessionToMemory

      io.reactivex.rxjava3.core.Completable addSessionToMemory(Session session)
      将一个会话添加到内存服务中。

      在一个会话的生命周期内,它可以被多次添加(即:该会话可以被多次创建或重新激活)。

      Parameters:
      session - The session to add.
    • searchMemory

      io.reactivex.rxjava3.core.Single<SearchMemoryResponse> searchMemory(String appName, String userId, String query)
      异步地搜索与查询条件匹配的会话(session)。
      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.