mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
fix: 尝试修复错误直接对话没了的问题(不知道好使不)
This commit is contained in:
parent
3121b0e463
commit
0755b54486
1 changed files with 30 additions and 26 deletions
|
|
@ -674,33 +674,37 @@ export default class SydneyAIClient {
|
||||||
}
|
}
|
||||||
ws.send(`${messageJson}`)
|
ws.send(`${messageJson}`)
|
||||||
|
|
||||||
const {
|
try {
|
||||||
message: reply,
|
const {
|
||||||
conversationExpiryTime
|
message: reply,
|
||||||
} = await messagePromise
|
conversationExpiryTime
|
||||||
|
} = await messagePromise
|
||||||
|
const replyMessage = {
|
||||||
|
id: crypto.randomUUID(),
|
||||||
|
parentMessageId: userMessage.id,
|
||||||
|
role: 'Bing',
|
||||||
|
message: reply.text,
|
||||||
|
details: reply
|
||||||
|
}
|
||||||
|
if (!Config.sydneyApologyIgnored || !apology) {
|
||||||
|
conversation.messages.push(userMessage)
|
||||||
|
conversation.messages.push(replyMessage)
|
||||||
|
}
|
||||||
|
|
||||||
const replyMessage = {
|
return {
|
||||||
id: crypto.randomUUID(),
|
conversationSignature,
|
||||||
parentMessageId: userMessage.id,
|
conversationId,
|
||||||
role: 'Bing',
|
clientId,
|
||||||
message: reply.text,
|
invocationId: invocationId + 1,
|
||||||
details: reply
|
messageId: replyMessage.id,
|
||||||
}
|
conversationExpiryTime,
|
||||||
if (!Config.sydneyApologyIgnored || !apology) {
|
response: reply.text,
|
||||||
conversation.messages.push(userMessage)
|
details: reply,
|
||||||
conversation.messages.push(replyMessage)
|
apology: Config.sydneyApologyIgnored && apology
|
||||||
}
|
}
|
||||||
await this.conversationsCache.set(conversationKey, conversation)
|
} catch (err) {
|
||||||
return {
|
await this.conversationsCache.set(conversationKey, conversation)
|
||||||
conversationSignature,
|
throw err
|
||||||
conversationId,
|
|
||||||
clientId,
|
|
||||||
invocationId: invocationId + 1,
|
|
||||||
messageId: replyMessage.id,
|
|
||||||
conversationExpiryTime,
|
|
||||||
response: reply.text,
|
|
||||||
details: reply,
|
|
||||||
apology: Config.sydneyApologyIgnored && apology
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue