mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 16:19:27 +00:00
fix(cliproxy): add case-insensitive model lookup
Normalize model IDs to lowercase for comparison in findModel()
This commit is contained in:
@@ -153,11 +153,13 @@ export function getProviderCatalog(provider: CLIProxyProvider): ProviderCatalog
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Find model entry by ID
|
* Find model entry by ID
|
||||||
|
* Note: Model IDs are normalized to lowercase for case-insensitive comparison
|
||||||
*/
|
*/
|
||||||
export function findModel(provider: CLIProxyProvider, modelId: string): ModelEntry | undefined {
|
export function findModel(provider: CLIProxyProvider, modelId: string): ModelEntry | undefined {
|
||||||
const catalog = MODEL_CATALOG[provider];
|
const catalog = MODEL_CATALOG[provider];
|
||||||
if (!catalog) return undefined;
|
if (!catalog) return undefined;
|
||||||
return catalog.models.find((m) => m.id === modelId);
|
const normalizedId = modelId.toLowerCase();
|
||||||
|
return catalog.models.find((m) => m.id.toLowerCase() === normalizedId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user