소스 검색

hotfix for gemini invald argument #5715

lloydzhou 1 년 전
부모
커밋
f89872b833
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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