mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 05:42:54 -07:00
feat(vertex): add settings for Vertex AI request routing (#25513)
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
createContentGeneratorConfig,
|
||||
type ContentGenerator,
|
||||
type ContentGeneratorConfig,
|
||||
type VertexAiRoutingConfig,
|
||||
} from '../core/contentGenerator.js';
|
||||
import type { OverageStrategy } from '../billing/billing.js';
|
||||
import { PromptRegistry } from '../prompts/prompt-registry.js';
|
||||
@@ -731,6 +732,7 @@ export interface ConfigParameters {
|
||||
billing?: {
|
||||
overageStrategy?: OverageStrategy;
|
||||
};
|
||||
vertexAiRouting?: VertexAiRoutingConfig;
|
||||
}
|
||||
|
||||
export class Config implements McpContext, AgentLoopContext {
|
||||
@@ -936,6 +938,7 @@ export class Config implements McpContext, AgentLoopContext {
|
||||
private readonly billing: {
|
||||
overageStrategy: OverageStrategy;
|
||||
};
|
||||
private readonly vertexAiRouting: VertexAiRoutingConfig | undefined;
|
||||
|
||||
private readonly enableAgents: boolean;
|
||||
private agents: AgentSettings;
|
||||
@@ -1362,6 +1365,7 @@ export class Config implements McpContext, AgentLoopContext {
|
||||
this.billing = {
|
||||
overageStrategy: params.billing?.overageStrategy ?? 'ask',
|
||||
};
|
||||
this.vertexAiRouting = params.vertexAiRouting;
|
||||
|
||||
if (params.contextFileName) {
|
||||
setGeminiMdFilename(params.contextFileName);
|
||||
@@ -1549,6 +1553,7 @@ export class Config implements McpContext, AgentLoopContext {
|
||||
apiKey,
|
||||
baseUrl,
|
||||
customHeaders,
|
||||
this.vertexAiRouting,
|
||||
);
|
||||
this.contentGenerator = await createContentGenerator(
|
||||
newContentGeneratorConfig,
|
||||
|
||||
Reference in New Issue
Block a user