Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 31, 2024
2 parents be1f752 + c9eb9f3 commit 6f23a2a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/client/platforms/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ export class GeminiProApi implements LLMApi {
baseUrl = accessStore.googleUrl;
}

const isApp = !!getClientConfig()?.isApp;
if (baseUrl.length === 0) {
const isApp = !!getClientConfig()?.isApp;
baseUrl = isApp
? DEFAULT_API_HOST + `/api/proxy/google?key=${accessStore.googleApiKey}`
: ApiPath.Google;
baseUrl = isApp ? DEFAULT_API_HOST + `/api/proxy/google` : ApiPath.Google;
}
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.slice(0, baseUrl.length - 1);
Expand All @@ -43,6 +41,10 @@ export class GeminiProApi implements LLMApi {
let chatPath = [baseUrl, path].join("/");

chatPath += chatPath.includes("?") ? "&alt=sse" : "?alt=sse";
// if chatPath.startsWith('http') then add key in query string
if (chatPath.startsWith("http") && accessStore.googleApiKey) {
chatPath += `&key=${accessStore.googleApiKey}`;
}
return chatPath;
}
extractMessage(res: any) {
Expand Down

0 comments on commit 6f23a2a

Please sign in to comment.