diff options
| author | sasha-gitg <[email protected]> | 2025-05-27 10:00:07 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-27 10:00:07 -0700 |
| commit | 3511e84dc3ecdc121ca657e77859f302d514d271 (patch) | |
| tree | 0e3d810ea35d67c65911517144f32a4a532343aa /packages/server/src/core | |
| parent | b3f52e215a98835b752bd3ba3ec08ae44e480eda (diff) | |
fix: default to Gemini API if GEMINI_API_KEY is set and when GOOGLE_GENAI_USE_VERTEXAI is set to True (#566)
Diffstat (limited to 'packages/server/src/core')
| -rw-r--r-- | packages/server/src/core/client.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/server/src/core/client.ts b/packages/server/src/core/client.ts index 8823012e..341ce021 100644 --- a/packages/server/src/core/client.ts +++ b/packages/server/src/core/client.ts @@ -36,8 +36,11 @@ export class GeminiClient { constructor(private config: Config) { const userAgent = config.getUserAgent(); const apiKeyFromConfig = config.getApiKey(); + const vertexaiFlag = config.getVertexAI(); + this.client = new GoogleGenAI({ apiKey: apiKeyFromConfig === '' ? undefined : apiKeyFromConfig, + vertexai: vertexaiFlag, httpOptions: { headers: { 'User-Agent': userAgent, |
