Fix/gemini app endpoint (#4017)

* fix: support custom api endpoint

* fix: attach api key to google gemini
This commit is contained in:
fred-bf 2024-02-07 13:46:52 +08:00 committed by GitHub
parent b8f0822214
commit d74f636558
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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),