Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
# By default, require reviews from the maintainers for all files.
* @google-gemini/gemini-cli-maintainers

# Require reviews from the release approvers for critical files.
# These patterns override the rule above.
/package.json @google-gemini/gemini-cli-askmode-approvers
/package-lock.json @google-gemini/gemini-cli-askmode-approvers
/GEMINI.md @google-gemini/gemini-cli-askmode-approvers
/SECURITY.md @google-gemini/gemini-cli-askmode-approvers
/LICENSE @google-gemini/gemini-cli-askmode-approvers
/.github/workflows/ @google-gemini/gemini-cli-askmode-approvers
/packages/cli/package.json @google-gemini/gemini-cli-askmode-approvers
/packages/core/package.json @google-gemini/gemini-cli-askmode-approvers
11 changes: 10 additions & 1 deletion packages/core/src/core/contentGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,19 @@ export type ContentGeneratorConfig = {
vertexai?: boolean;
authType?: AuthType;
proxy?: string;
googleCloudProject?: string;
googleCloudLocation?: string;
};

export async function createContentGeneratorConfig(
config: Config,
authType: AuthType | undefined,
): Promise<ContentGeneratorConfig> {
const geminiApiKey =
(await loadApiKey()) || process.env['GEMINI_API_KEY'] || undefined;
config?.geminiApiKey ||
process.env['GEMINI_API_KEY'] ||
(await loadApiKey()) ||
undefined;
const googleApiKey = process.env['GOOGLE_API_KEY'] || undefined;
const googleCloudProject =
process.env['GOOGLE_CLOUD_PROJECT'] ||
Expand Down Expand Up @@ -99,6 +104,8 @@ export async function createContentGeneratorConfig(
) {
contentGeneratorConfig.apiKey = googleApiKey;
contentGeneratorConfig.vertexai = true;
contentGeneratorConfig.googleCloudProject = googleCloudProject;
contentGeneratorConfig.googleCloudLocation = googleCloudLocation;

return contentGeneratorConfig;
}
Expand Down Expand Up @@ -170,6 +177,8 @@ export async function createContentGenerator(
const googleGenAI = new GoogleGenAI({
apiKey: config.apiKey === '' ? undefined : config.apiKey,
vertexai: config.vertexai,
project: config.googleCloudProject,
location: config.googleCloudLocation,
httpOptions,
});
return new LoggingContentGenerator(googleGenAI.models, gcConfig);
Expand Down