Files
gemini-cli/packages/core/src/code_assist/codeAssist.ts

22 lines
632 B
TypeScript
Raw Normal View History

2025-06-10 16:00:13 -07:00
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { ContentGenerator } from '../core/contentGenerator.js';
2025-06-11 13:26:41 -07:00
import { getOauthClient } from './oauth2.js';
2025-06-10 16:00:13 -07:00
import { setupUser } from './setup.js';
import { CodeAssistServer, HttpOptions } from './server.js';
2025-06-10 16:00:13 -07:00
export async function createCodeAssistContentGenerator(
httpOptions: HttpOptions,
): Promise<ContentGenerator> {
2025-06-11 13:26:41 -07:00
const oauth2Client = await getOauthClient();
2025-06-10 16:00:13 -07:00
const projectId = await setupUser(
oauth2Client,
process.env.GOOGLE_CLOUD_PROJECT,
);
return new CodeAssistServer(oauth2Client, projectId, httpOptions);
2025-06-10 16:00:13 -07:00
}