fix: API3 conversation bug

This commit is contained in:
ikechan8370 2023-02-15 00:52:15 +08:00
parent 4ba1c80cc0
commit bd934fd970

View file

@ -18,7 +18,7 @@ export class OfficialChatGPTClient {
async sendMessage (prompt, opts = {}) {
let {
timeoutMs = this._timeoutMs,
conversationId = uuidv4(),
conversationId,
parentMessageId = uuidv4(),
messageId = uuidv4(),
action = 'next'
@ -40,10 +40,12 @@ export class OfficialChatGPTClient {
}
}
],
conversation_id: conversationId,
model: Config.plus ? 'text-davinci-002-render-sha' : 'text-davinci-002-render-sha',
parent_message_id: parentMessageId
}
if (conversationId) {
body.conversation_id = conversationId
}
let option = {
method: 'POST',
body: JSON.stringify(body),