mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-12 07:27:37 +08:00
improve compatibility
This commit is contained in:
@@ -60,13 +60,15 @@ export async function generateAnswersWithCustomApi(port, question, session, apiK
|
||||
console.debug('json error', error)
|
||||
return
|
||||
}
|
||||
|
||||
answer +=
|
||||
data.choices[0]?.delta?.content ||
|
||||
data.choices[0]?.message?.content ||
|
||||
data.choices[0]?.text ||
|
||||
data.response ||
|
||||
''
|
||||
|
||||
if (data.response)
|
||||
answer = data.response
|
||||
else
|
||||
answer +=
|
||||
data.choices[0]?.delta?.content ||
|
||||
data.choices[0]?.message?.content ||
|
||||
data.choices[0]?.text ||
|
||||
''
|
||||
port.postMessage({ answer: answer, done: false, session: null })
|
||||
},
|
||||
async onStart() {},
|
||||
|
||||
Reference in New Issue
Block a user