mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +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)
|
// await this.reply('chatgpt初始化出错:' + e.msg, true)
|
||||||
// }
|
// }
|
||||||
let previousConversation = await redis.get(`CHATGPT:CONVERSATIONS:${e.sender.user_id}`)
|
let previousConversation = await redis.get(`CHATGPT:CONVERSATIONS:${e.sender.user_id}`)
|
||||||
let conversation = null
|
let conversation = {}
|
||||||
if (!previousConversation) {
|
if (!previousConversation) {
|
||||||
let ctime = new Date()
|
let ctime = new Date()
|
||||||
previousConversation = {
|
previousConversation = {
|
||||||
|
|
@ -256,6 +256,9 @@ export class chatgpt extends plugin {
|
||||||
}
|
}
|
||||||
const use = await redis.get('CHATGPT:USE')
|
const use = await redis.get('CHATGPT:USE')
|
||||||
try {
|
try {
|
||||||
|
if (Config.debug) {
|
||||||
|
logger.mark(conversation)
|
||||||
|
}
|
||||||
let chatMessage = await this.sendMessage(prompt, conversation, use)
|
let chatMessage = await this.sendMessage(prompt, conversation, use)
|
||||||
previousConversation.conversation = {
|
previousConversation.conversation = {
|
||||||
conversationId: chatMessage.conversationId
|
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',
|
model: Config.plus ? 'text-davinci-002-render-sha' : 'text-davinci-002-render-sha',
|
||||||
parent_message_id: parentMessageId
|
parent_message_id: parentMessageId
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue