Fix custom api

This commit is contained in:
Yukino Song
2023-06-05 10:45:32 +08:00
committed by josc146
parent 771188eabd
commit 6a48ba449a
+7 -1
View File
@@ -60,7 +60,13 @@ export async function generateAnswersWithCustomApi(port, question, session, apiK
console.debug('json error', error)
return
}
if (data.response) answer = data.response
answer +=
data.choices[0]?.delta?.content ||
data.choices[0]?.message?.content ||
data.choices[0]?.text ||
data.response ||
''
port.postMessage({ answer: answer, done: false, session: null })
},
async onStart() {},