From f89872b833d27c48b33281e60157640037e17a99 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Fri, 25 Oct 2024 18:12:09 +0800 Subject: [PATCH 1/2] hotfix for gemini invald argument #5715 --- app/client/platforms/google.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/client/platforms/google.ts b/app/client/platforms/google.ts index 7265a500b97..14fecb8f289 100644 --- a/app/client/platforms/google.ts +++ b/app/client/platforms/google.ts @@ -192,7 +192,9 @@ export class GeminiProApi implements LLMApi { requestPayload, getHeaders(), // @ts-ignore - [{ functionDeclarations: tools.map((tool) => tool.function) }], + tools.length > 0 + ? [{ functionDeclarations: tools.map((tool) => tool.function) }] + : [], funcs, controller, // parseSSE From f0b3e10a6caf55bf91325183b5ad84de2a05db04 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Fri, 25 Oct 2024 18:19:22 +0800 Subject: [PATCH 2/2] hotfix for gemini invald argument #5715 --- app/client/platforms/google.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/client/platforms/google.ts b/app/client/platforms/google.ts index 14fecb8f289..a4b594ddfed 100644 --- a/app/client/platforms/google.ts +++ b/app/client/platforms/google.ts @@ -193,7 +193,8 @@ export class GeminiProApi implements LLMApi { getHeaders(), // @ts-ignore tools.length > 0 - ? [{ functionDeclarations: tools.map((tool) => tool.function) }] + ? // @ts-ignore + [{ functionDeclarations: tools.map((tool) => tool.function) }] : [], funcs, controller,