Sfoglia il codice sorgente

Fix/gemini app endpoint (#4017)

* fix: support custom api endpoint

* fix: attach api key to google gemini
fred-bf 1 anno fa
parent
commit
d74f636558
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      app/client/platforms/google.ts

+ 4 - 4
app/client/platforms/google.ts

@@ -86,13 +86,13 @@ export class GeminiProApi implements LLMApi {
 
       if (!baseUrl) {
         baseUrl = isApp
-          ? DEFAULT_API_HOST +
-            "/api/proxy/google/" +
-            Google.ChatPath +
-            `?key=${accessStore.googleApiKey}`
+          ? DEFAULT_API_HOST + "/api/proxy/google/" + Google.ChatPath
           : chatPath;
       }
 
+      if (isApp) {
+        baseUrl += `?key=${accessStore.googleApiKey}`;
+      }
       const chatPayload = {
         method: "POST",
         body: JSON.stringify(requestPayload),