public abstract class ChatMemory extends Object implements Memory
| Constructor and Description |
|---|
ChatMemory(MemoryStoreConfig config)
初始化实例
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
清理
|
protected abstract void |
clearMemory()
根据不同的记忆策略,清理相关内容
|
void |
saveContext(Object input,
String output)
保存上下文
|
protected abstract void |
saveMemoryContext(Object input,
String output)
根据不同的记忆策略,保存额外的相关内容
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitloadMemoryVariables, memoryVariablespublic ChatMemory(MemoryStoreConfig config)
config - 配置项public void saveContext(Object input, String output)
saveContext in interface Memoryinput - 用户输入output - AI输出protected abstract void saveMemoryContext(Object input, String output)
input - 用户内容output - 机器回答protected abstract void clearMemory()
Copyright © 2024. All rights reserved.