feat(vertex): add settings for Vertex AI request routing (#25513)

This commit is contained in:
Gordon Hui
2026-04-22 01:48:30 +08:00
committed by GitHub
parent aee2cde1a3
commit 27344833cb
9 changed files with 210 additions and 0 deletions
+25
View File
@@ -836,12 +836,37 @@ describe('Server Config (config.ts)', () => {
undefined,
undefined,
undefined,
undefined,
);
// Verify that contentGeneratorConfig is updated
expect(config.getContentGeneratorConfig()).toEqual(mockContentConfig);
expect(GeminiClient).toHaveBeenCalledWith(config);
});
it('should pass Vertex AI routing settings when refreshing auth', async () => {
const vertexAiRouting = {
requestType: 'shared' as const,
sharedRequestType: 'priority' as const,
};
const config = new Config({
...baseParams,
vertexAiRouting,
});
vi.mocked(createContentGeneratorConfig).mockResolvedValue({});
await config.refreshAuth(AuthType.USE_VERTEX_AI);
expect(createContentGeneratorConfig).toHaveBeenCalledWith(
config,
AuthType.USE_VERTEX_AI,
undefined,
undefined,
undefined,
vertexAiRouting,
);
});
it('should reset model availability status', async () => {
const config = new Config(baseParams);
const service = config.getModelAvailabilityService();