mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-19 14:30:52 -07:00
fix: default to Gemini API if GEMINI_API_KEY is set and when GOOGLE_GENAI_USE_VERTEXAI is set to True (#566)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user