mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-19 12:10:17 +09:00
fix bug that gemini has multiple candidates part
This commit is contained in:
parent
f156430cc5
commit
3fe55b4f7f
@ -69,9 +69,16 @@ export class GeminiProApi implements LLMApi {
|
|||||||
.join("\n\n");
|
.join("\n\n");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let content = "";
|
||||||
|
if (Array.isArray(res)) {
|
||||||
|
res.map((item) => {
|
||||||
|
content += getTextFromParts(item?.candidates?.at(0)?.content?.parts);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
getTextFromParts(res?.candidates?.at(0)?.content?.parts) ||
|
getTextFromParts(res?.candidates?.at(0)?.content?.parts) ||
|
||||||
getTextFromParts(res?.at(0)?.candidates?.at(0)?.content?.parts) ||
|
content || //getTextFromParts(res?.at(0)?.candidates?.at(0)?.content?.parts) ||
|
||||||
res?.error?.message ||
|
res?.error?.message ||
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user