Add --model MODEL arg and modify -3 and -4 args to store gpt-3-5-turbo and gpt-4 in model arg.

# Context:
USER: add a --model MODEL arg, and change -3 to store 'gpt-3-5-turbo' in the model arg. add a new arg -4 which stores 'gpt-4' in the model arg.
ASSISTANT: To add a `--model MODEL` argument and modify the `-3` and `-4` arguments, you can update the `main` function as follows:

```python
coder.py
<<<<<<< ORIGINAL
    parser.add_argument(
        "-3",
        "--gpt-3-5-turbo",
        action="store_true",
        help="Only use gpt-3.5-turbo, not gpt-4",
    )
=======
    parser.add_argument(
        "--model",
        metavar="MODEL",
        default="gpt-3.5-turbo",
        help="Specify the model to use (default: gpt-3.5-turbo)",
    )
    parser.add_argument(
        "-3",
        action="store_const",
        dest="model",
        const="gpt-3.5-turbo",
        help="Use gpt-3.5-turbo model",
    )
    parser.add_argument(
        "-4",
        action="store_const",
        dest="model",
        const="gpt-4",
        help="Use gpt-4 model",
    )
>>>>>>> UPDATED
```

This change adds the `--model MODEL` argument, modifies the `-3` argument to store `'gpt-3-5-turbo'` in the `model` argument, and adds a new `-4` argument to store `'gpt-4'` in the `model` argument.
This commit is contained in:
Paul Gauthier 2023-05-08 23:10:25 -07:00
parent 1fc1fbae0c
commit e5e5a8e325

View file

@ -575,11 +575,25 @@ def main():
parser.add_argument( parser.add_argument(
"files", metavar="FILE", nargs="+", help="a list of source code files", "files", metavar="FILE", nargs="+", help="a list of source code files",
) )
parser.add_argument(
"--model",
metavar="MODEL",
default="gpt-3.5-turbo",
help="Specify the model to use (default: gpt-3.5-turbo)",
)
parser.add_argument( parser.add_argument(
"-3", "-3",
"--gpt-3-5-turbo", action="store_const",
action="store_true", dest="model",
help="Only use gpt-3.5-turbo, not gpt-4", const="gpt-3.5-turbo",
help="Use gpt-3.5-turbo model",
)
parser.add_argument(
"-4",
action="store_const",
dest="model",
const="gpt-4",
help="Use gpt-4 model",
) )
parser.add_argument( parser.add_argument(
"--no-pretty", "--no-pretty",