Abstract the default model name so it applies to scripting #537

This commit is contained in:
Paul Gauthier 2024-04-11 06:42:38 -07:00
parent cf7dfa816e
commit 5c10944054
4 changed files with 5 additions and 2 deletions

View file

@ -69,7 +69,7 @@ class Coder:
from . import EditBlockCoder, UnifiedDiffCoder, WholeFileCoder
if not main_model:
main_model = models.GPT4
main_model = models.Model.create(models.DEFAULT_MODEL_NAME)
if not skip_model_availabily_check and not main_model.always_available:
if not check_model_availability(io, client, main_model):

View file

@ -159,7 +159,7 @@ def main(argv=None, input=None, output=None, force_git_root=None):
env_var="OPENAI_API_KEY",
help="Specify the OpenAI API key",
)
default_model = "gpt-4-1106-preview"
default_model = models.DEFAULT_MODEL_NAME
core_group.add_argument(
"--model",
metavar="MODEL",

View file

@ -6,6 +6,8 @@ GPT4 = Model.create("gpt-4")
GPT35 = Model.create("gpt-3.5-turbo")
GPT35_0125 = Model.create("gpt-3.5-turbo-0125")
DEFAULT_MODEL_NAME = "gpt-4-1106-preview"
__all__ = [
OpenAIModel,
OpenRouterModel,

View file

@ -258,6 +258,7 @@ User `aider --help` to see all the command line options, but these are useful fo
You can also script aider from python:
```python
import os
import openai
from aider.coders import Coder