mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: API3 conversation bug
This commit is contained in:
parent
b342e47e8a
commit
4ba1c80cc0
2 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue