mirror of https://github.com/langgenius/dify.git
fix: the model list encountered two children with the same key (#27956)
Co-authored-by: haokai <haokai@shuwen.com>
This commit is contained in:
parent
560833adb8
commit
21e036a1f2
|
|
@ -1533,6 +1533,9 @@ class ProviderConfiguration(BaseModel):
|
|||
# Return composite sort key: (model_type value, model position index)
|
||||
return (model.model_type.value, position_index)
|
||||
|
||||
# Deduplicate
|
||||
provider_models = list({(m.model, m.model_type, m.fetch_from): m for m in provider_models}.values())
|
||||
|
||||
# Sort using the composite sort key
|
||||
return sorted(provider_models, key=get_sort_key)
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ const ModelList: FC<ModelListProps> = ({
|
|||
{
|
||||
models.map(model => (
|
||||
<ModelListItem
|
||||
key={`${model.model}-${model.fetch_from}`}
|
||||
key={`${model.model}-${model.model_type}-${model.fetch_from}`}
|
||||
{...{
|
||||
model,
|
||||
provider,
|
||||
|
|
|
|||
Loading…
Reference in New Issue