mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
Abstract the default model name so it applies to scripting #537
This commit is contained in:
parent
cf7dfa816e
commit
5c10944054
4 changed files with 5 additions and 2 deletions
|
@ -69,7 +69,7 @@ class Coder:
|
||||||
from . import EditBlockCoder, UnifiedDiffCoder, WholeFileCoder
|
from . import EditBlockCoder, UnifiedDiffCoder, WholeFileCoder
|
||||||
|
|
||||||
if not main_model:
|
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 skip_model_availabily_check and not main_model.always_available:
|
||||||
if not check_model_availability(io, client, main_model):
|
if not check_model_availability(io, client, main_model):
|
||||||
|
|
|
@ -159,7 +159,7 @@ def main(argv=None, input=None, output=None, force_git_root=None):
|
||||||
env_var="OPENAI_API_KEY",
|
env_var="OPENAI_API_KEY",
|
||||||
help="Specify the 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(
|
core_group.add_argument(
|
||||||
"--model",
|
"--model",
|
||||||
metavar="MODEL",
|
metavar="MODEL",
|
||||||
|
|
|
@ -6,6 +6,8 @@ GPT4 = Model.create("gpt-4")
|
||||||
GPT35 = Model.create("gpt-3.5-turbo")
|
GPT35 = Model.create("gpt-3.5-turbo")
|
||||||
GPT35_0125 = Model.create("gpt-3.5-turbo-0125")
|
GPT35_0125 = Model.create("gpt-3.5-turbo-0125")
|
||||||
|
|
||||||
|
DEFAULT_MODEL_NAME = "gpt-4-1106-preview"
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
OpenAIModel,
|
OpenAIModel,
|
||||||
OpenRouterModel,
|
OpenRouterModel,
|
||||||
|
|
|
@ -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:
|
You can also script aider from python:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
import os
|
||||||
import openai
|
import openai
|
||||||
from aider.coders import Coder
|
from aider.coders import Coder
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue