Fix conditional access

This commit is contained in:
Cohee 2024-01-14 19:40:12 +02:00
parent 0751d746db
commit d592e26e24
1 changed files with 1 additions and 1 deletions

View File

@ -334,7 +334,7 @@ async function sendMakerSuiteRequest(request, response) {
} }
const responseContent = candidates[0].content ?? candidates[0].output; const responseContent = candidates[0].content ?? candidates[0].output;
const responseText = typeof responseContent === 'string' ? responseContent : responseContent.parts?.[0]?.text; const responseText = typeof responseContent === 'string' ? responseContent : responseContent?.parts?.[0]?.text;
if (!responseText) { if (!responseText) {
let message = 'MakerSuite Candidate text empty'; let message = 'MakerSuite Candidate text empty';
console.log(message, generateResponseJson); console.log(message, generateResponseJson);