mirror of
https://github.com/jie65535/JChatGPT.git
synced 2025-06-02 17:39:10 +08:00
Fix chat context
This commit is contained in:
parent
72443ccc01
commit
7c26c8e590
@ -108,7 +108,7 @@ object JChatGPT : KotlinPlugin(
|
|||||||
if (quote != null) {
|
if (quote != null) {
|
||||||
val msg = quote.source.originalMessage.plainText()
|
val msg = quote.source.originalMessage.plainText()
|
||||||
if (msg.isNotEmpty()) {
|
if (msg.isNotEmpty()) {
|
||||||
context = mutableListOf(ChatMessage(ChatRole.User, msg))
|
context = listOf(ChatMessage(ChatRole.User, msg))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,8 +124,7 @@ object JChatGPT : KotlinPlugin(
|
|||||||
history.add(ChatMessage(ChatRole.System, PluginConfig.prompt))
|
history.add(ChatMessage(ChatRole.System, PluginConfig.prompt))
|
||||||
}
|
}
|
||||||
val msg = message.plainText()
|
val msg = message.plainText()
|
||||||
if (history.isEmpty()) {
|
if (msg.isNotEmpty()) {
|
||||||
if (msg.isEmpty()) return
|
|
||||||
history.add(ChatMessage(ChatRole.User, msg))
|
history.add(ChatMessage(ChatRole.User, msg))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user