aider: Added environment variable override for --model command-line argument.

# Context:
USER: add an env override for --model
ASSISTANT: I will add an environment variable override for the `--model` command-line argument in the `aider/main.py` file.

```python
aider/main.py
<<<<<<< ORIGINAL
    parser.add_argument(
        "--model",
        metavar="MODEL",
        default="gpt-4",
        help="Specify the model to use for the main chat (default: gpt-4)",
    )
=======
    parser.add_argument(
        "--model",
        metavar="MODEL",
        default=os.environ.get(f"{env_prefix}MODEL", "gpt-4"),
        help=f"Specify the model to use for the main chat (default: gpt-4, ${env_prefix}MODEL)",
    )
>>>>>>> UPDATED
```

Now, the `--model` command-line argument can be overridden using the `AIDER_MODEL` environment variable.
This commit is contained in:
Paul Gauthier 2023-05-10 17:57:51 -07:00
parent 8ce2f381b8
commit 1fedba8505

View file

@ -26,8 +26,8 @@ def main():
parser.add_argument(
"--model",
metavar="MODEL",
default="gpt-4",
help="Specify the model to use for the main chat (default: gpt-4)",
default=os.environ.get(f"{env_prefix}MODEL", "gpt-4"),
help=f"Specify the model to use for the main chat (default: gpt-4, ${env_prefix}MODEL)",
)
parser.add_argument(
"-3",