Base未来内存服务(Service)

Java-friendly base for implementing a MemoryService. The engine's methods are suspend; a Java subclass returns CompletableFutures instead. addEventsToMemoryAsync and addMemoryAsync are optional -- their default throws UnsupportedOperationException (as the engine does), so override them only if the service supports those writes. Return each future promptly and do any blocking work inside it, not before returning it.

构造函数(Constructors)

Link copied to clipboard
constructor()

函数

Link copied to clipboard
suspend override fun addEventsToMemory(appName: String, userId: String, events: List<Event>, sessionId: String? = null, customMetadata: Map<String, Any?>? = null)

向内存服务中添加一个明确指定的事件列表。

Link copied to clipboard
suspend override fun addMemory(appName: String, userId: String, memories: List<MemoryEntry>, customMetadata: Map<String, Any?>? = null)

将明确指定的内存项直接添加到内存服务中。

Link copied to clipboard
suspend override fun addSessionToMemory(session: Session)

将一个会话添加到内存服务中。

Link copied to clipboard
suspend override fun searchMemory(appName: String, userId: String, query: String): SearchMemoryResponse

异步地搜索与查询条件匹配的会话(session)。