Add Memory Agent

This commit is contained in:
2025-07-15 10:37:28 +08:00
parent f822999ab4
commit ea4e6123b3
3 changed files with 59 additions and 1 deletions

View File

@@ -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(),