mirror of
https://github.com/jie65535/JChatGPT.git
synced 2026-06-23 00:49:31 +08:00
Add Memory Agent
This commit is contained in:
@@ -61,6 +61,7 @@ object JChatGPT : KotlinPlugin(
|
||||
// 注册聊天权限
|
||||
PermissionService.INSTANCE.register(chatPermission, "JChatGPT Chat Permission")
|
||||
PluginConfig.reload()
|
||||
PluginData.reload()
|
||||
|
||||
// 设置Token
|
||||
LargeLanguageModels.reload()
|
||||
@@ -144,6 +145,14 @@ object JChatGPT : KotlinPlugin(
|
||||
"与 \"${event.senderName}\" 私聊中"
|
||||
}
|
||||
}
|
||||
|
||||
replace("{memory}") {
|
||||
val memoryText = PluginData.contactMemory[event.subject.id]
|
||||
if (memoryText.isNullOrEmpty()) {
|
||||
"暂无相关记忆"
|
||||
} else memoryText
|
||||
}
|
||||
|
||||
return prompt.toString()
|
||||
}
|
||||
|
||||
@@ -663,6 +672,9 @@ object JChatGPT : KotlinPlugin(
|
||||
// 发送组合消息
|
||||
SendCompositeMessage(),
|
||||
|
||||
// 记忆代理
|
||||
MemoryAgent(),
|
||||
|
||||
// 结束循环
|
||||
StopLoopAgent(),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user