fix: Reference issue when position list type is optional.

pull/20183/head
zxy 1 year ago
parent a86c3b1a9a
commit 2b6bc1e30e

@ -810,7 +810,7 @@ class ProviderConfiguration(BaseModel):
def get_sort_key(model: ModelWithProviderEntity):
# Get the position list for the current model type
positions = model_type_positions.get(model.model_type.value, [])
positions = model_type_positions.get(model.model_type.value, []) or []
# If the model name is in the position list, use its index for sorting
# Otherwise use a large value (list length) to place undefined models at the end

Loading…
Cancel
Save