mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 03:05:00 +00:00
SwitchModel -> SwitchCoder
This commit is contained in:
parent
4537e6c16a
commit
f440479c48
2 changed files with 14 additions and 7 deletions
|
@ -15,7 +15,7 @@ from aider.utils import is_image_file
|
|||
from .dump import dump # noqa: F401
|
||||
|
||||
|
||||
class SwitchModel(Exception):
|
||||
class SwitchCoder(Exception):
|
||||
def __init__(self, model=None, edit_format=None):
|
||||
self.model = model
|
||||
self.edit_format = edit_format
|
||||
|
@ -43,7 +43,7 @@ class Commands:
|
|||
model_name = args.strip()
|
||||
model = models.Model(model_name)
|
||||
models.sanity_check_models(self.io, model)
|
||||
raise SwitchModel(model=model)
|
||||
raise SwitchCoder(model=model)
|
||||
|
||||
def cmd_mode(self, args):
|
||||
"Switch to a new editing mode"
|
||||
|
@ -52,10 +52,12 @@ class Commands:
|
|||
valid_formats = "diff udiff whole".split()
|
||||
|
||||
if ef not in valid_formats:
|
||||
self.io.tool_error(f"Invalid edit format: {ef}. Valid formats are: {', '.join(valid_formats)}")
|
||||
self.io.tool_error(
|
||||
f"Invalid edit format: {ef}. Valid formats are: {', '.join(valid_formats)}"
|
||||
)
|
||||
return
|
||||
|
||||
raise SwitchModel(edit_format=ef)
|
||||
raise SwitchCoder(edit_format=ef)
|
||||
|
||||
def completions_model(self):
|
||||
models = litellm.model_cost.keys()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue