mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-10 15:49:29 +08:00
fix(models): include model name as fallback for id field (#11760)
Add model's name as an additional fallback option when determining the id field in adaptSdkModel to handle cases where neither id nor modelId is available
This commit is contained in:
parent
73fc74d875
commit
adbadf5da6
@ -45,7 +45,7 @@ function normalizeModels<T>(models: T[], transformer: (entry: T) => Model | null
|
|||||||
}
|
}
|
||||||
|
|
||||||
function adaptSdkModel(provider: Provider, model: SdkModel): Model | null {
|
function adaptSdkModel(provider: Provider, model: SdkModel): Model | null {
|
||||||
const id = pickPreferredString([(model as any)?.id, (model as any)?.modelId])
|
const id = pickPreferredString([(model as any)?.id, (model as any)?.modelId, (model as any)?.name])
|
||||||
const name = pickPreferredString([
|
const name = pickPreferredString([
|
||||||
(model as any)?.display_name,
|
(model as any)?.display_name,
|
||||||
(model as any)?.displayName,
|
(model as any)?.displayName,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user