mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
feat: Apply generic model settings when no exact model match found
This commit is contained in:
parent
76f8791f3c
commit
2a80d9c555
1 changed files with 6 additions and 0 deletions
|
@ -850,14 +850,20 @@ class Model(ModelSettings):
|
||||||
self._copy_fields(self.default_model_settings)
|
self._copy_fields(self.default_model_settings)
|
||||||
|
|
||||||
# Look for exact model match
|
# Look for exact model match
|
||||||
|
exact_match = False
|
||||||
for ms in MODEL_SETTINGS:
|
for ms in MODEL_SETTINGS:
|
||||||
# direct match, or match "provider/<model>"
|
# direct match, or match "provider/<model>"
|
||||||
if model == ms.name:
|
if model == ms.name:
|
||||||
self._copy_fields(ms, skip_name=False)
|
self._copy_fields(ms, skip_name=False)
|
||||||
|
exact_match = True
|
||||||
break # Continue to apply overrides
|
break # Continue to apply overrides
|
||||||
|
|
||||||
model = model.lower()
|
model = model.lower()
|
||||||
|
|
||||||
|
# If no exact match, try generic settings
|
||||||
|
if not exact_match:
|
||||||
|
self.apply_generic_model_settings(model)
|
||||||
|
|
||||||
# Apply override settings last if they exist
|
# Apply override settings last if they exist
|
||||||
if self.override_model_settings:
|
if self.override_model_settings:
|
||||||
self._copy_fields(self.override_model_settings)
|
self._copy_fields(self.override_model_settings)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue