(modelId: string)
| 80 | export const DEFAULT_MODEL = MODELS.find((model) => model.id === "grok-4.3")?.id ?? MODELS[0]?.id ?? "grok-4.3"; |
| 81 | |
| 82 | export function normalizeModelId(modelId: string): string { |
| 83 | const trimmed = modelId.trim(); |
| 84 | if (!trimmed) return trimmed; |
| 85 | |
| 86 | const withoutProviderPrefix = trimmed.replace(PROVIDER_PREFIX_RE, ""); |
| 87 | return aliasMap.get(withoutProviderPrefix.toLowerCase()) ?? withoutProviderPrefix; |
| 88 | } |
| 89 | |
| 90 | export function getModelInfo(modelId: string): ModelInfo | undefined { |
| 91 | const normalized = normalizeModelId(modelId); |
no test coverage detected