Explorar o código

hotfix for gemini invald argument #5715

lloydzhou hai 1 ano
pai
achega
f89872b833
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      app/client/platforms/google.ts

+ 3 - 1
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