From f89872b833d27c48b33281e60157640037e17a99 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Fri, 25 Oct 2024 18:12:09 +0800 Subject: [PATCH] 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 7265a500b..14fecb8f2 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