This commit is contained in:
Paul Gauthier 2023-06-20 15:46:22 -07:00
parent 4d3fc3de7e
commit 43ba638ac4
2 changed files with 4 additions and 4 deletions

View file

@ -81,7 +81,7 @@ class Coder:
self.console = Console(force_terminal=True, no_color=True) self.console = Console(force_terminal=True, no_color=True)
main_model = models.Model(main_model) 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 not self.check_model_availability(main_model):
if main_model != models.GPT4: if main_model != models.GPT4:
self.io.tool_error( self.io.tool_error(

View file

@ -2,6 +2,8 @@ import re
class Model: class Model:
always_available = False
def __init__(self, name, tokens=None): def __init__(self, name, tokens=None):
self.name = name self.name = name
if tokens is None: if tokens is None:
@ -19,6 +21,7 @@ class Model:
if self.is_gpt35(): if self.is_gpt35():
self.edit_format = "whole" self.edit_format = "whole"
self.always_available = True
return return
raise ValueError(f"Unsupported model: {name}") raise ValueError(f"Unsupported model: {name}")
@ -29,9 +32,6 @@ class Model:
def is_gpt35(self): def is_gpt35(self):
return self.name.startswith("gpt-3.5-turbo") return self.name.startswith("gpt-3.5-turbo")
def is_always_available(self):
return self.is_gpt35()
GPT4 = Model("gpt-4", 8) GPT4 = Model("gpt-4", 8)
GPT35 = Model("gpt-3.5-turbo") GPT35 = Model("gpt-3.5-turbo")