mirror of
https://github.com/jie65535/JChatGPT.git
synced 2025-07-28 18:59:20 +08:00
Update memory structure
This commit is contained in:
parent
6cba3cca22
commit
eda932b4e9
@ -15,9 +15,9 @@ object PluginData : AutoSavePluginData("data") {
|
||||
fun appendContactMemory(contactId: Long, newMemory: String) {
|
||||
val memory = contactMemory[contactId]
|
||||
if (memory.isNullOrEmpty()) {
|
||||
contactMemory[contactId] = "* $newMemory"
|
||||
contactMemory[contactId] = newMemory
|
||||
} else {
|
||||
contactMemory[contactId] = "$memory\n* $newMemory"
|
||||
contactMemory[contactId] = "$memory\n$newMemory"
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ object PluginData : AutoSavePluginData("data") {
|
||||
fun replaceContactMemory(contactId: Long, oldMemory: String, newMemory: String) {
|
||||
val memory = contactMemory[contactId]
|
||||
if (memory.isNullOrEmpty()) {
|
||||
contactMemory[contactId] = "* $newMemory"
|
||||
contactMemory[contactId] = newMemory
|
||||
} else {
|
||||
contactMemory[contactId] = memory.replace(oldMemory, newMemory)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user