Commit graph

2837 commits

Author SHA1 Message Date
Paul Gauthier
f852bcabcd version bump to 0.14.0 2023-09-08 09:54:15 -07:00
Paul Gauthier
68e3d98f24 Updated HISTORY 2023-09-08 09:53:52 -07:00
Paul Gauthier
aee1338670 copy 2023-09-08 09:49:58 -07:00
Paul Gauthier
239fb92563 Merge remote-tracking branch 'origin/main' 2023-09-08 09:13:07 -07:00
Paul Gauthier
491993f979 Added a benchmarking readme 2023-09-08 09:12:34 -07:00
paul-gauthier
7ba70632e8
Merge pull request #244 from joshuavial/fix-openrouter-token-usage
only show token costs if usage exists
2023-09-08 08:37:09 -07:00
Paul Gauthier
ad3eeca80e Added __all__ to models/__init__ 2023-09-08 08:28:12 -07:00
Paul Gauthier
bfbd7b8416 Merge remote-tracking branch 'origin/main' 2023-09-08 08:26:23 -07:00
Joshua Vial
166984e94a only show token costs if usage exists 2023-09-08 11:49:41 +12:00
paul-gauthier
93ea45f588
Merge pull request #241 from joshuavial/fix-231 2023-09-06 16:29:03 -07:00
Joshua Vial
98097005c7 small fix for better error handling if the summarizer ever fails
- fix #231
2023-09-06 15:03:54 +12:00
Paul Gauthier
9b22b39a8d lint 2023-09-01 15:55:36 -07:00
Paul Gauthier
3045c5e94d aider: Removed unused imports and changed comparison to None to use is instead of == in aider/history.py, aider/models/__init__.py, and aider/models/openrouter.py.
# Aider chat conversation:

USER: I ran this command:

 pre-commit run --all-files

And got this output:

isort....................................................................Passed
black....................................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

aider/history.py:4:1: F401 'tiktoken' imported but unused
import tiktoken
^
aider/models/__init__.py:2:1: F401 '.openai.OpenAIModel' imported but unused
from .openai import OpenAIModel
^
aider/models/__init__.py:3:1: F401 '.openrouter.OpenRouterModel' imported but unused
from .openrouter import OpenRouterModel
^
aider/models/openrouter.py:26:33: E711 comparison to None should be 'if cond is None:'
        if cached_model_details == None:
                                ^

ASSISTANT: It seems like there are some unused imports and a comparison to None that is not following the Pythonic way. To fix these issues, we need to modify the following files:

1. `aider/history.py`
2. `aider/models/__init__.py`
3. `aider/models/openrouter.py`

Please add these files to the chat so I can propose the necessary changes.

USER: I added these *read-write* files: aider/history.py, aider/models/openrouter.py, aider/models/__init__.py

ASSISTANT: Great! Now, let's make the necessary changes to these files.

First, in `aider/history.py`, we need to remove the unused import `tiktoken`.

```python
aider/history.py
<<<<<<< HEAD
import tiktoken
=======
>>>>>>> updated
```

Next, in `aider/models/__init__.py`, we need to remove the unused imports `OpenAIModel` and `OpenRouterModel`.

```python
aider/models/__init__.py
<<<<<<< HEAD
from .openai import OpenAIModel
from .openrouter import OpenRouterModel
=======
>>>>>>> updated
```

Finally, in `aider/models/openrouter.py`, we need to change the comparison to None to use `is` instead of `==`.

```python
aider/models/openrouter.py
<<<<<<< HEAD
        if cached_model_details == None:
=======
        if cached_model_details is None:
>>>>>>> updated
```

These changes should resolve the issues reported by the `flake8` linter.
2023-09-01 15:54:22 -07:00
Paul Gauthier
1334392418 lint 2023-09-01 15:53:19 -07:00
paul-gauthier
30a3cc0847
Merge pull request #199 from joshuavial/openrouter
Openrouter compatibility
2023-08-31 17:17:28 -07:00
Paul Gauthier
bcf4a55714 copy 2023-08-25 07:16:40 -07:00
Joshua Vial
6405193a95 docs for openrouter 2023-08-23 22:26:14 +12:00
Joshua Vial
0826e116da cleaning up openrouter code 2023-08-23 22:03:09 +12:00
Joshua Vial
668a0500ff test openrouter model properties 2023-08-23 21:50:00 +12:00
Joshua Vial
d1e0a196b5 Add test for creating models from OpenRouter API. 2023-08-23 21:32:00 +12:00
Joshua Vial
abbc93678b finishing openrouter integration 2023-08-23 21:26:27 +12:00
JV
1fc2abe3d0 save model to ChatSummary 2023-08-23 14:39:12 +12:00
JV
8fca0f27ee add caching of openrouter model details 2023-08-23 14:39:12 +12:00
JV
a39829c5f8 adding todo notes 2023-08-23 14:39:12 +12:00
JV
22f3349862 Refactored the code to use a global variable to store the OpenAI instance and added a helper function to determine the edit format for a given model. 2023-08-23 14:39:12 +12:00
JV
a0d6efc13c dynamically get pricing and context length for openrouter models 2023-08-23 14:39:12 +12:00
JV
041f3a4a38 initial code for working with openrouter 2023-08-23 14:39:12 +12:00
Paul Gauthier
8c580dd332 set version to 0.13.1-dev 2023-08-22 08:04:24 -07:00
Paul Gauthier
5eebde1d06 version bump to 0.13.0 2023-08-22 08:03:58 -07:00
Paul Gauthier
7e77a2b89f Updated HISTORY 2023-08-22 07:50:31 -07:00
Paul Gauthier
968095b36d Updated HISTORY 2023-08-22 07:45:17 -07:00
Paul Gauthier
e15b0b04d4 copy 2023-08-19 19:12:55 -07:00
Paul Gauthier
d7443e21b9 copy 2023-08-19 19:12:35 -07:00
Paul Gauthier
963bc83a9c Late-bind importing sounddevice, as it was slowing down aider startup 2023-08-19 15:18:46 -07:00
Paul Gauthier
4846317ef1 Merge remote-tracking branch 'origin/main' 2023-08-19 11:43:23 -07:00
Paul Gauthier
354b216bbe added /voice to docs 2023-08-19 11:42:56 -07:00
paul-gauthier
34159648d7
Update README.md 2023-08-19 08:46:39 -07:00
Paul Gauthier
b6a329c934 Updated HISTORY 2023-08-19 07:33:35 -07:00
Paul Gauthier
5c538327c3 update tests 2023-08-19 07:23:00 -07:00
Paul Gauthier
45de64535a add missing import 2023-08-19 07:17:50 -07:00
Paul Gauthier
0e9e037c06 aider: Change all the --foo/--no-foo switches to use the parser.add_argument('--feature', action=argparse.BooleanOptionalAction) convention.
# Aider chat conversation:

USER: change all the --foo/--no-foo switches to use the `parser.add_argument('--feature', action=argparse.BooleanOptionalAction)` convention

ASSISTANT: To implement this change, we need to modify the `aider/main.py` file. We will replace all instances of `--foo` and `--no-foo` switches with the `parser.add_argument('--feature', action=argparse.BooleanOptionalAction)` convention.

Here are the changes:

```python
aider/main.py
<<<<<<< HEAD
    output_group.add_argument(
        "--pretty",
        action="store_true",
        default=True,
        help="Enable pretty, colorized output (default: True)",
    )
    output_group.add_argument(
        "--no-pretty",
        action="store_false",
        dest="pretty",
        help="Disable pretty, colorized output",
    )
    output_group.add_argument(
        "--no-stream",
        action="store_false",
        dest="stream",
        default=True,
        help="Disable streaming responses",
    )
    git_group.add_argument(
        "--no-git",
        action="store_false",
        dest="git",
        default=True,
        help="Do not look for a git repo",
    )
    git_group.add_argument(
        "--auto-commits",
        action="store_true",
        dest="auto_commits",
        default=True,
        help="Enable auto commit of GPT changes (default: True)",
    )
    git_group.add_argument(
        "--no-auto-commits",
        action="store_false",
        dest="auto_commits",
        help="Disable auto commit of GPT changes (implies --no-dirty-commits)",
    )
    git_group.add_argument(
        "--dirty-commits",
        action="store_true",
        dest="dirty_commits",
        help="Enable commits when repo is found dirty",
        default=True,
    )
    git_group.add_argument(
        "--no-dirty-commits",
        action="store_false",
        dest="dirty_commits",
        help="Disable commits when repo is found dirty",
    )
    git_group.add_argument(
        "--dry-run",
        action="store_true",
        help="Perform a dry run without modifying files (default: False)",
        default=False,
    )
=======
    output_group.add_argument(
        "--pretty",
        action=argparse.BooleanOptionalAction,
        default=True,
        help="Enable/disable pretty, colorized output (default: True)",
    )
    output_group.add_argument(
        "--stream",
        action=argparse.BooleanOptionalAction,
        default=True,
        help="Enable/disable streaming responses (default: True)",
    )
    git_group.add_argument(
        "--git",
        action=argparse.BooleanOptionalAction,
        default=True,
        help="Enable/disable looking for a git repo (default: True)",
    )
    git_group.add_argument(
        "--auto-commits",
        action=argparse.BooleanOptionalAction,
        default=True,
        help="Enable/disable auto commit of GPT changes (default: True)",
    )
    git_group.add_argument(
        "--dirty-commits",
        action=argparse.BooleanOptionalAction,
        default=True,
        help="Enable/disable commits when repo is found dirty (default: True)",
    )
    git_group.add_argument(
        "--dry-run",
        action=argparse.BooleanOptionalAction,
        default=False,
        help="Enable/disable performing a dry run without modifying files (default: False)",
    )
>>>>>>> updated
```

Please note that the `argparse.BooleanOptionalAction` was introduced in Python 3.9. If you're using an older version of Python, you might need to upgrade or use a different approach.

USER: InvalidEditBlock: edit failed!

aider/main.py does not contain the *exact sequence* of HEAD lines you specified.
Try again.
DO NOT skip blank lines, comments, docstrings, etc!
The HEAD block needs to be EXACTLY the same as the lines in aider/main.py with nothing missing!

aider/main.py does not contain these 58 exact lines in a row:
```
    output_group.add_argument(
        "--pretty",
        action="store_true",
        default=True,
        help="Enable pretty, colorized output (default: True)",
    )
    output_group.add_argument(
        "--no-pretty",
        action="store_false",
        dest="pretty",
        help="Disable pretty, colorized output",
    )
    output_group.add_argument(
        "--no-stream",
        action="store_false",
        dest="stream",
        default=True,
        help="Disable streaming responses",
    )
    git_group.add_argument(
        "--no-git",
        action="store_false",
        dest="git",
        default=True,
        help="Do not look for a git repo",
    )
    git_group.add_argument(
        "--auto-commits",
        action="store_true",
        dest="auto_commits",
        default=True,
        help="Enable auto commit of GPT changes (default: True)",
    )
    git_group.add_argument(
        "--no-auto-commits",
        action="store_false",
        dest="auto_commits",
        help="Disable auto commit of GPT changes (implies --no-dirty-commits)",
    )
    git_group.add_argument(
        "--dirty-commits",
        action="store_true",
        dest="dirty_commits",
        help="Enable commits when repo is found dirty",
        default=True,
    )
    git_group.add_argument(
        "--no-dirty-commits",
        action="store_false",
        dest="dirty_commits",
        help="Disable commits when repo is found dirty",
    )
    git_group.add_argument(
        "--dry-run",
        action="store_true",
        help="Perform a dry run without modifying files (default: False)",
        default=False,
    )
```

ASSISTANT: I apologize for the confusion. It seems I made a mistake in grouping the changes. The arguments are not all together in the file, they are spread out in different argument groups. I will correct this and provide the changes in separate edit blocks for each argument group.

Here are the corrected changes:

```python
aider/main.py
<<<<<<< HEAD
    output_group.add_argument(
        "--pretty",
        action="store_true",
        default=True,
        help="Enable pretty, colorized output (default: True)",
    )
    output_group.add_argument(
        "--no-pretty",
        action="store_false",
        dest="pretty",
        help="Disable pretty, colorized output",
    )
    output_group.add_argument(
        "--no-stream",
        action="store_false",
        dest="stream",
        default=True,
        help="Disable streaming responses",
    )
=======
    output_group.add_argument(
        "--pretty",
        action=argparse.BooleanOptionalAction,
        default=True,
        help="Enable/disable pretty, colorized output (default: True)",
    )
    output_group.add_argument(
        "--stream",
        action=argparse.BooleanOptionalAction,
        default=True,
        help="Enable/disable streaming responses (default: True)",
    )
>>>>>>> updated
```

```python
aider/main.py
<<<<<<< HEAD
    git_group.add_argument(
        "--no-git",
        action="store_false",
        dest="git",
        default=True,
        help="Do not look for a git repo",
    )
    git_group.add_argument(
        "--auto-commits",
        action="store_true",
        dest="auto_commits",
        default=True,
        help="Enable auto commit of GPT changes (default: True)",
    )
    git_group.add_argument(
        "--no-auto-commits",
        action="store_false",
        dest="auto_commits",
        help="Disable auto commit of GPT changes (implies --no-dirty-commits)",
    )
    git_group.add_argument(
        "--dirty-commits",
        action="store_true",
        dest="dirty_commits",
        help="Enable commits when repo is found dirty",
        default=True,
    )
    git_group.add_argument(
        "--no-dirty-commits",
        action="store_false",
        dest="dirty_commits",
        help="Disable commits when repo is found dirty",
    )
    git_group.add_argument(
        "--dry-run",
        action="store_true",
        help="Perform a dry run without modifying files (default: False)",
        default=False,
    )
=======
    git_group.add_argument(
        "--git",
        action=argparse.BooleanOptionalAction,
        default=True,
        help="Enable/disable looking for a git repo (default: True)",
    )
    git_group.add_argument(
        "--auto-commits",
        action=argparse.BooleanOptionalAction,
        default=True,
        help="Enable/disable auto commit of GPT changes (default: True)",
    )
    git_group.add_argument(
        "--dirty-commits",
        action=argparse.BooleanOptionalAction,
        default=True,
        help="Enable/disable commits when repo is found dirty (default: True)",
    )
    git_group.add_argument(
        "--dry-run",
        action=argparse.BooleanOptionalAction,
        default=False,
        help="Enable/disable performing a dry run without modifying files (default: False)",
    )
>>>>>>> updated
```

Please note that the `argparse.BooleanOptionalAction` was introduced in Python 3.9. If you're using an older version of Python, you might need to upgrade or use a different approach.
2023-08-19 07:16:37 -07:00
Paul Gauthier
66e04bde3d copy 2023-08-19 06:47:39 -07:00
Paul Gauthier
ae8d04a95f Handle diff of file not yet part of repo 2023-08-18 13:20:27 -07:00
paul-gauthier
9933ad85b0
Merge pull request #207 from paul-gauthier/late-bind-commits
Only commit dirty files if GPT tries to edit them #200
2023-08-18 10:43:06 -07:00
Paul Gauthier
2737cbde06 ssh 2023-08-18 10:35:42 -07:00
Paul Gauthier
4e45d1597d Updated HISTORY 2023-08-18 10:31:50 -07:00
Paul Gauthier
b56340db6a Updated FAQ 2023-08-18 10:30:34 -07:00
Paul Gauthier
cd830cbc3c noop 2023-08-18 10:16:17 -07:00
Paul Gauthier
285536105e Properly handle all diff cases 2023-08-18 10:07:47 -07:00
Paul Gauthier
7af82ba185 keep track of the files which need dirty commits 2023-08-18 09:50:18 -07:00