mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
fix: add httpOptions with headers field to CCPA client and set User-Agent header (#1103)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user