fix: add httpOptions with headers field to CCPA client and set User-Agent header (#1103)

This commit is contained in:
Marlon Gamez
2025-06-16 12:03:06 -07:00
committed by GitHub
parent bf62c3b21a
commit 42329e0258
3 changed files with 26 additions and 12 deletions

View File

@@ -7,13 +7,15 @@
import { ContentGenerator } from '../core/contentGenerator.js';
import { getOauthClient } from './oauth2.js';
import { setupUser } from './setup.js';
import { CodeAssistServer } from './server.js';
import { CodeAssistServer, HttpOptions } from './server.js';
export async function createCodeAssistContentGenerator(): Promise<ContentGenerator> {
export async function createCodeAssistContentGenerator(
httpOptions: HttpOptions,
): Promise<ContentGenerator> {
const oauth2Client = await getOauthClient();
const projectId = await setupUser(
oauth2Client,
process.env.GOOGLE_CLOUD_PROJECT,
);
return new CodeAssistServer(oauth2Client, projectId);
return new CodeAssistServer(oauth2Client, projectId, httpOptions);
}