mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-01 05:00:46 +00: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:
parent
b3f52e215a
commit
3511e84dc3
3 changed files with 13 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ export class Config {
|
|||
private userMemory: string = '', // Made mutable for refresh
|
||||
private geminiMdFileCount: number = 0,
|
||||
private alwaysSkipModificationConfirmation: boolean = false,
|
||||
private readonly vertexai?: boolean,
|
||||
) {
|
||||
// toolRegistry still needs initialization based on the instance
|
||||
this.toolRegistry = createToolRegistry(this);
|
||||
|
|
@ -139,6 +140,10 @@ export class Config {
|
|||
setAlwaysSkipModificationConfirmation(skip: boolean): void {
|
||||
this.alwaysSkipModificationConfirmation = skip;
|
||||
}
|
||||
|
||||
getVertexAI(): boolean | undefined {
|
||||
return this.vertexai;
|
||||
}
|
||||
}
|
||||
|
||||
function findEnvFile(startDir: string): string | null {
|
||||
|
|
@ -186,6 +191,7 @@ export function createServerConfig(
|
|||
userMemory?: string,
|
||||
geminiMdFileCount?: number,
|
||||
alwaysSkipModificationConfirmation?: boolean,
|
||||
vertexai?: boolean,
|
||||
): Config {
|
||||
return new Config(
|
||||
apiKey,
|
||||
|
|
@ -204,6 +210,7 @@ export function createServerConfig(
|
|||
userMemory ?? '',
|
||||
geminiMdFileCount ?? 0,
|
||||
alwaysSkipModificationConfirmation ?? false,
|
||||
vertexai,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue