From 26c2598f56b82b0b1082aeb05b58aacdb2de0cd9 Mon Sep 17 00:00:00 2001 From: YeungYeah Date: Thu, 18 Jul 2024 23:41:20 +0800 Subject: [PATCH] fix: fix bug in generating wrong gemini request url --- app/client/platforms/google.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/client/platforms/google.ts b/app/client/platforms/google.ts index 100067e8e21..dbcc3579b68 100644 --- a/app/client/platforms/google.ts +++ b/app/client/platforms/google.ts @@ -123,8 +123,10 @@ export class GeminiProApi implements LLMApi { const controller = new AbortController(); options.onController?.(controller); try { - if (!baseUrl && isApp) { - baseUrl = DEFAULT_API_HOST + "/api/proxy/google/"; + if (!baseUrl) { + baseUrl = isApp + ? DEFAULT_API_HOST + "/api/proxy/google/" + : this.path(""); } baseUrl = `${baseUrl}/${Google.ChatPath(modelConfig.model)}`.replaceAll( "//",