Commit graph

10395 commits

Author SHA1 Message Date
Paul Gauthier
7a04206139 copy 2023-06-21 18:40:01 -07:00
Paul Gauthier
092f952028 Merge branch 'main' into edit-formats 2023-06-21 18:37:23 -07:00
Paul Gauthier
088d81d54d copy 2023-06-21 18:36:44 -07:00
Paul Gauthier
dc5b33164a copy 2023-06-21 18:34:44 -07:00
Paul Gauthier
443f9bf2b9 copy 2023-06-21 18:30:51 -07:00
Paul Gauthier
efd4e973dd Updated 3.5 vs 4 2023-06-21 18:29:33 -07:00
Paul Gauthier
5a05370627 Updated 3.5 vs 4 2023-06-21 18:27:47 -07:00
Paul Gauthier
0a4a547c3d Updated 3.5 vs 4 2023-06-21 18:25:55 -07:00
Paul Gauthier
ba6e2eeb63 wip 2023-06-21 18:05:49 -07:00
Paul Gauthier
151b7b2811 Merge branch 'main' into edit-formats 2023-06-21 14:55:18 -07:00
Paul Gauthier
87be865a71 Improved /tokens output 2023-06-21 14:55:13 -07:00
Paul Gauthier
2fa6c31262 Merge branch 'main' into edit-formats 2023-06-21 14:36:38 -07:00
Paul Gauthier
3974629d50 /clear should only clear history, not drop files 2023-06-21 14:36:31 -07:00
Paul Gauthier
82df52d855 Better error message 2023-06-21 14:36:01 -07:00
Paul Gauthier
684afd3242 catch ExhaustedContextWindow 2023-06-21 14:32:39 -07:00
Paul Gauthier
db47ac9f39 ExhaustedContextWindow 2023-06-21 14:31:03 -07:00
Paul Gauthier
8820eb0399 Merge branch 'main' into edit-formats 2023-06-21 14:14:28 -07:00
Paul Gauthier
d00dca034d More Model test cases 2023-06-21 14:13:34 -07:00
Paul Gauthier
10a2288105 aider: Added a test to check if Model('gpt-3.5').max_context_tokens equals 4*1024.
# Context:
USER: Add a test to check if Model('gpt-3.5').max_context_tokens == 4*1024
ASSISTANT: No changes are needed.
2023-06-21 14:11:49 -07:00
Paul Gauthier
07803cc0d7 Added new files to the git repo: tests/test_models.py 2023-06-21 14:10:56 -07:00
Paul Gauthier
6e3738c901 Better logic to determine context window size 2023-06-21 14:10:30 -07:00
Paul Gauthier
ab6ef7eb5c wip 2023-06-21 14:05:23 -07:00
Paul Gauthier
2fce31209c wip 2023-06-21 13:57:42 -07:00
Paul Gauthier
3465bd57d1 roughed in func coder 2023-06-21 12:16:51 -07:00
Paul Gauthier
75e84017b3 Added manual control of --edit-format 2023-06-21 12:12:12 -07:00
Paul Gauthier
e1d987725e Merge branch 'main' into edit-formats 2023-06-21 11:31:48 -07:00
Paul Gauthier
9d1c53489e Updated README 2023-06-21 11:31:32 -07:00
Paul Gauthier
070f0a2919 refac 2023-06-20 17:46:47 -07:00
Paul Gauthier
e22373b55a refac 2023-06-20 17:41:56 -07:00
Paul Gauthier
a8fe9cb491 fixed tests 2023-06-20 17:37:28 -07:00
Paul Gauthier
d58e5421b0 fixed tests 2023-06-20 17:36:24 -07:00
Paul Gauthier
f7ccdaa914 fixed tests 2023-06-20 17:31:17 -07:00
Paul Gauthier
124ab7dd99 fixed test 2023-06-20 17:27:48 -07:00
Paul Gauthier
4956c35870 aider: Updated Coder to use the create class method in tests.
# Context:
USER: Coder has been changed to use the `create` class method. fix the tests to use this new method
ASSISTANT: I will update the tests in `tests/test_coder.py` to use the `create` class method.

```python
tests/test_coder.py
<<<<<<< ORIGINAL
        coder = Coder(io=mock_io, openai_api_key="fake_key")
=======
        coder = Coder.create(main_model=models.GPT4, io=mock_io, openai_api_key="fake_key")
>>>>>>> UPDATED
```

Please let me know if you need any further changes.
2023-06-20 17:16:06 -07:00
Paul Gauthier
0b45104da9 added default api_base 2023-06-20 17:14:52 -07:00
Paul Gauthier
c379cf3286 auto select edit mode 2023-06-20 17:13:26 -07:00
Paul Gauthier
5e63ce3352 refac 2023-06-20 17:04:06 -07:00
Paul Gauthier
f1350f169f refac 2023-06-20 16:59:55 -07:00
Paul Gauthier
02c9a30c45 refac 2023-06-20 16:47:37 -07:00
Paul Gauthier
bc38fcde65 aider: Called superclass's __init__ method before setting the gpt_prompts attribute in EditBlockCoder.
# Context:
USER: call super
ASSISTANT: To call the superclass's `__init__` method in the `EditBlockCoder` class, you need to modify the `aider/coders/editblock.py` file. Here's the change:

```python
aider/coders/editblock.py
<<<<<<< ORIGINAL
class EditBlockCoder(Coder):
    def __init__(self, *args, **kwargs):
        self.gpt_prompts = EditBlockPrompts()
=======
class EditBlockCoder(Coder):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.gpt_prompts = EditBlockPrompts()
>>>>>>> UPDATED
```

This change calls the superclass's `__init__` method before setting the `gpt_prompts` attribute.
2023-06-20 16:39:57 -07:00
Paul Gauthier
741249bb6b added editblockcoder 2023-06-20 16:39:31 -07:00
Paul Gauthier
602094aca3 refac 2023-06-20 16:35:56 -07:00
Paul Gauthier
f1ba68e2a2 __all__ 2023-06-20 16:27:59 -07:00
Paul Gauthier
a858d06140 aider: Added __all__ list to aider/editors/__init__.py to explicitly specify the exported symbols.
# Context:
USER: how do i export those 2 symbols?
ASSISTANT: To export the two symbols `EditBlockPrompts` and `WholeFilePrompts` from the `aider/editors/__init__.py` file, you don't need to make any changes. They are already being imported and can be used by other modules that import from `aider.editors`.

For example, if you want to use these symbols in another file, you can simply import them like this:

```python
from aider.editors import EditBlockPrompts, WholeFilePrompts
```

^C KeyboardInterrupt
USER: can I use __all__ ?
ASSISTANT: Yes, you can use `__all__` to explicitly specify the symbols that should be imported when a client imports the module using a wildcard import (e.g., `from module import *`). To do this, add the `__all__` list to the `aider/editors/__init__.py` file and include the names of the symbols you want to export.

Here's how to modify the `aider/editors/__init__.py` file:

```python
aider/editors/__init__.py
<<<<<<< ORIGINAL
from .editblock import EditBlockPrompts
from .wholefile import WholeFilePrompts
=======
__all__ = ['EditBlockPrompts', 'WholeFilePrompts']

from .editblock import EditBlockPrompts
from .wholefile import WholeFilePrompts
>>>>>>> UPDATED
```

Now, when someone uses a wildcard import like `from aider.editors import *`, only the symbols listed in `__all__` will be imported.
2023-06-20 16:27:28 -07:00
Paul Gauthier
03d2c73621 refactor Editors 2023-06-20 16:26:00 -07:00
Paul Gauthier
122c1c4f6c Model.use_repo_map, Model.send_undo_reply 2023-06-20 16:13:50 -07:00
Paul Gauthier
43ba638ac4 refac 2023-06-20 15:46:22 -07:00
Paul Gauthier
4d3fc3de7e Merge branch 'main' into edit-formats 2023-06-20 15:43:14 -07:00
Paul Gauthier
44198e8b3b Fix for issue #24, provided by @wwestenbrink 2023-06-20 06:57:19 -07:00
Paul Gauthier
4dee70d825 Merge remote-tracking branch 'origin/main' 2023-06-19 16:01:03 -07:00