mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-20 12:14:45 +08:00
fix bug that gemini has multiple candidates part
This commit is contained in:
@@ -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 ||
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user