From d74f63655832cca789fc864d06ec96ee741fe225 Mon Sep 17 00:00:00 2001 From: fred-bf <157469842+fred-bf@users.noreply.github.com> Date: Wed, 7 Feb 2024 13:46:52 +0800 Subject: [PATCH] Fix/gemini app endpoint (#4017) * fix: support custom api endpoint * fix: attach api key to google gemini --- app/client/platforms/google.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/client/platforms/google.ts b/app/client/platforms/google.ts index aeb91ba7c02..6832400ca58 100644 --- a/app/client/platforms/google.ts +++ b/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),