Skip to content

Commit 6a48ba4

Browse files
ClassicOldSongjosStorer
authored andcommitted
Fix custom api
1 parent 771188e commit 6a48ba4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/services/apis/custom-api.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ export async function generateAnswersWithCustomApi(port, question, session, apiK
6060
console.debug('json error', error)
6161
return
6262
}
63-
if (data.response) answer = data.response
63+
64+
answer +=
65+
data.choices[0]?.delta?.content ||
66+
data.choices[0]?.message?.content ||
67+
data.choices[0]?.text ||
68+
data.response ||
69+
''
6470
port.postMessage({ answer: answer, done: false, session: null })
6571
},
6672
async onStart() {},

0 commit comments

Comments
 (0)