mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
refac
This commit is contained in:
parent
4d3fc3de7e
commit
43ba638ac4
2 changed files with 4 additions and 4 deletions
|
@ -81,7 +81,7 @@ class Coder:
|
|||
self.console = Console(force_terminal=True, no_color=True)
|
||||
|
||||
main_model = models.Model(main_model)
|
||||
if not main_model.is_always_available():
|
||||
if not main_model.always_available:
|
||||
if not self.check_model_availability(main_model):
|
||||
if main_model != models.GPT4:
|
||||
self.io.tool_error(
|
||||
|
|
|
@ -2,6 +2,8 @@ import re
|
|||
|
||||
|
||||
class Model:
|
||||
always_available = False
|
||||
|
||||
def __init__(self, name, tokens=None):
|
||||
self.name = name
|
||||
if tokens is None:
|
||||
|
@ -19,6 +21,7 @@ class Model:
|
|||
|
||||
if self.is_gpt35():
|
||||
self.edit_format = "whole"
|
||||
self.always_available = True
|
||||
return
|
||||
|
||||
raise ValueError(f"Unsupported model: {name}")
|
||||
|
@ -29,9 +32,6 @@ class Model:
|
|||
def is_gpt35(self):
|
||||
return self.name.startswith("gpt-3.5-turbo")
|
||||
|
||||
def is_always_available(self):
|
||||
return self.is_gpt35()
|
||||
|
||||
|
||||
GPT4 = Model("gpt-4", 8)
|
||||
GPT35 = Model("gpt-3.5-turbo")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue