Merged via squash. Prepared head SHA: 095e645ea58b2259b25c923aeaf11bbcb2990c8f Co-authored-by: Jaaneek <25470423+Jaaneek@users.noreply.github.com> Co-authored-by: huntharo <5617868+huntharo@users.noreply.github.com> Reviewed-by: @huntharo
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
// Keep model ID normalization dependency-free so config parsing and other
|
|
// startup-only paths do not pull in provider discovery or plugin loading.
|
|
export function normalizeGoogleModelId(id: string): string {
|
|
if (id === "gemini-3-pro") {
|
|
return "gemini-3-pro-preview";
|
|
}
|
|
if (id === "gemini-3-flash") {
|
|
return "gemini-3-flash-preview";
|
|
}
|
|
if (id === "gemini-3.1-pro") {
|
|
return "gemini-3.1-pro-preview";
|
|
}
|
|
if (id === "gemini-3.1-flash-lite") {
|
|
return "gemini-3.1-flash-lite-preview";
|
|
}
|
|
// Preserve compatibility with earlier OpenClaw docs/config that pointed at a
|
|
// non-existent Gemini Flash preview ID. Google's current Flash text model is
|
|
// `gemini-3-flash-preview`.
|
|
if (id === "gemini-3.1-flash" || id === "gemini-3.1-flash-preview") {
|
|
return "gemini-3-flash-preview";
|
|
}
|
|
return id;
|
|
}
|
|
|
|
export function normalizeXaiModelId(id: string): string {
|
|
if (id === "grok-4.20-experimental-beta-0304-reasoning") {
|
|
return "grok-4.20-reasoning";
|
|
}
|
|
if (id === "grok-4.20-experimental-beta-0304-non-reasoning") {
|
|
return "grok-4.20-non-reasoning";
|
|
}
|
|
return id;
|
|
}
|