mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-03 08:24:10 -07:00
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import type { Config } from '../../config/config.js';
|
|
import type { BaseLlmClient } from '../../core/baseLlmClient.js';
|
|
import type {
|
|
RoutingContext,
|
|
RoutingDecision,
|
|
TerminalStrategy,
|
|
} from '../routingStrategy.js';
|
|
import { resolveModel } from '../../config/models.js';
|
|
import type { LocalLiteRtLmClient } from '../../core/localLiteRtLmClient.js';
|
|
|
|
export class DefaultStrategy implements TerminalStrategy {
|
|
readonly name = 'default';
|
|
|
|
async route(
|
|
_context: RoutingContext,
|
|
config: Config,
|
|
_baseLlmClient: BaseLlmClient,
|
|
_localLiteRtLmClient: LocalLiteRtLmClient,
|
|
): Promise<RoutingDecision> {
|
|
const defaultModel = resolveModel(
|
|
config.getModel(),
|
|
config.getGemini31LaunchedSync?.() ?? false,
|
|
false,
|
|
config.getHasAccessToPreviewModel?.() ?? true,
|
|
config,
|
|
);
|
|
return {
|
|
model: defaultModel,
|
|
metadata: {
|
|
source: this.name,
|
|
latencyMs: 0,
|
|
reasoning: `Routing to default model: ${defaultModel}`,
|
|
},
|
|
};
|
|
}
|
|
}
|