mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-06-27 17:47:56 +08:00
chore
This commit is contained in:
@@ -67,6 +67,7 @@ export async function generateAnswersWithCustomApi(port, question, session, apiK
|
||||
pushRecord(session, question, answer)
|
||||
console.debug('conversation history', { content: session.conversationRecords })
|
||||
port.postMessage({ answer: null, done: true, session: session })
|
||||
return
|
||||
}
|
||||
|
||||
if (data.response) answer = data.response
|
||||
|
||||
@@ -75,6 +75,7 @@ export async function generateAnswersWithGptCompletionApi(
|
||||
pushRecord(session, question, answer)
|
||||
console.debug('conversation history', { content: session.conversationRecords })
|
||||
port.postMessage({ answer: null, done: true, session: session })
|
||||
return
|
||||
}
|
||||
|
||||
answer += data.choices[0].text
|
||||
@@ -170,6 +171,7 @@ export async function generateAnswersWithChatgptApiCompat(
|
||||
pushRecord(session, question, answer)
|
||||
console.debug('conversation history', { content: session.conversationRecords })
|
||||
port.postMessage({ answer: null, done: true, session: session })
|
||||
return
|
||||
}
|
||||
|
||||
const delta = data.choices[0]?.delta?.content
|
||||
|
||||
Reference in New Issue
Block a user