fix: API3 conversation bug

This commit is contained in:
ikechan8370 2023-02-15 00:49:48 +08:00
parent b342e47e8a
commit 4ba1c80cc0
2 changed files with 5 additions and 2 deletions

View file

@ -234,7 +234,7 @@ export class chatgpt extends plugin {
// await this.reply('chatgpt初始化出错' + e.msg, true)
// }
let previousConversation = await redis.get(`CHATGPT:CONVERSATIONS:${e.sender.user_id}`)
let conversation = null
let conversation = {}
if (!previousConversation) {
let ctime = new Date()
previousConversation = {
@ -256,6 +256,9 @@ export class chatgpt extends plugin {
}
const use = await redis.get('CHATGPT:USE')
try {
if (Config.debug) {
logger.mark(conversation)
}
let chatMessage = await this.sendMessage(prompt, conversation, use)
previousConversation.conversation = {
conversationId: chatMessage.conversationId

View file

@ -40,7 +40,7 @@ export class OfficialChatGPTClient {
}
}
],
conversationId,
conversation_id: conversationId,
model: Config.plus ? 'text-davinci-002-render-sha' : 'text-davinci-002-render-sha',
parent_message_id: parentMessageId
}