mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 08:14:59 +00:00
style: Apply linter formatting to models.py
This commit is contained in:
parent
ea4ad2ea4d
commit
67cc215ed3
1 changed files with 4 additions and 4 deletions
|
@ -65,15 +65,16 @@ ANTHROPIC_MODELS = [ln.strip() for ln in ANTHROPIC_MODELS.splitlines() if ln.str
|
|||
|
||||
def track_init_fields(cls):
|
||||
original_init = cls.__init__
|
||||
|
||||
|
||||
@wraps(original_init)
|
||||
def __init__(self, **kwargs):
|
||||
self._set_fields = set(kwargs.keys())
|
||||
original_init(self, **kwargs)
|
||||
|
||||
|
||||
cls.__init__ = __init__
|
||||
return cls
|
||||
|
||||
|
||||
@track_init_fields
|
||||
@dataclass
|
||||
class ModelSettings:
|
||||
|
@ -96,7 +97,6 @@ class ModelSettings:
|
|||
editor_edit_format: Optional[str] = None
|
||||
|
||||
|
||||
|
||||
# https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
|
||||
# https://platform.openai.com/docs/models/gpt-3-5-turbo
|
||||
# https://openai.com/pricing
|
||||
|
@ -856,7 +856,7 @@ class Model(ModelSettings):
|
|||
if skip_name and field.name == "name":
|
||||
continue
|
||||
# Only copy fields that were explicitly set in the source
|
||||
if hasattr(source, '_set_fields') and field.name in source._set_fields:
|
||||
if hasattr(source, "_set_fields") and field.name in source._set_fields:
|
||||
val = getattr(source, field.name)
|
||||
setattr(self, field.name, val)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue