Commit graph

438 commits

Author SHA1 Message Date
Paul Gauthier
a0774bf46a resolve cmd line files to abs path 2023-07-05 15:14:09 -07:00
Paul Gauthier
55b1634811 added debug output 2023-07-05 15:08:11 -07:00
Paul Gauthier
e34078da04 force_terminal=False 2023-07-05 14:38:35 -07:00
Paul Gauthier
9ed19e63d0 bugfix 2023-07-05 13:36:00 -07:00
Paul Gauthier
21efc8d59e convert git.ls_files() to appropriate os.sep, since git always normalizes to / 2023-07-05 13:29:13 -07:00
Paul Gauthier
61247ec499 Added recheck_abs_fnames to notice if files go missing 2023-07-04 14:11:05 -07:00
Paul Gauthier
1f16b15f92 Added more clear error messages when universal-ctags is disabled per issue #31 2023-07-03 10:31:04 -07:00
Paul Gauthier
e98db7dfce possible fix for #38 2023-07-03 09:59:03 -07:00
Paul Gauthier
bad642afa4 bugfix 2023-07-02 17:52:28 -07:00
Paul Gauthier
cbe59b85c2 refactor the jsonschema check into base 2023-07-02 17:44:26 -07:00
Paul Gauthier
717236d235 Make sure wholefile does not try and use the repo map 2023-07-01 13:47:37 -07:00
Paul Gauthier
bc7610cdda retry on Timeout 2023-07-01 07:38:24 -07:00
Paul Gauthier
1251285ac8 cleaner logging, avoid func formats with old models 2023-07-01 06:59:18 -07:00
Paul Gauthier
059bfc75ab accept diff-func(-list,-string,) 2023-07-01 06:17:55 -07:00
Paul Gauthier
ddac41f106 singlewholefile-func 2023-06-29 18:13:42 -07:00
Paul Gauthier
271807123a Handle missing response text 2023-06-29 15:49:41 -07:00
Paul Gauthier
b11a6fa7ee track num_exhausted_context_windows 2023-06-29 15:32:45 -07:00
Paul Gauthier
87dc262214 roughed in diff-func-string 2023-06-29 15:11:59 -07:00
Paul Gauthier
58e763cee7 roughed in diff-func-string 2023-06-29 15:10:33 -07:00
Paul Gauthier
6c87d5be1c better 2023-06-28 13:52:43 -07:00
Paul Gauthier
777f179c6d better 2023-06-28 10:54:58 -07:00
Paul Gauthier
1ac366aa62 works 2023-06-27 19:38:14 -07:00
Paul Gauthier
582143d563 wip 2023-06-27 18:34:52 -07:00
Paul Gauthier
9cfebc0b60 record response hashes too 2023-06-27 16:11:05 -07:00
Paul Gauthier
974d96973c move the empty list into init 2023-06-27 15:00:49 -07:00
Paul Gauthier
64e16c8ad1 aider: Added SHA1 hash of kwargs to chat_completion_call_hashes in send_with_retries method.
# Context:
USER: when calling `ChatCompletion`, take a sha1 hash of dict with all the args and append it to a list self.chat_completion_call_hashes
ASSISTANT: To implement this change, we need to modify the `send_with_retries` method in the `Coder` class in the `aider/coders/base_coder.py` file. We will import the `hashlib` module to generate the SHA1 hash. We will also add a new attribute `chat_completion_call_hashes` to the `Coder` class to store the hashes.

Here are the changes:

```python
aider/coders/base_coder.py
<<<<<<< ORIGINAL
import json
import os
import sys
import traceback
from json.decoder import JSONDecodeError
from pathlib import Path
=======
import hashlib
import json
import os
import sys
import traceback
from json.decoder import JSONDecodeError
from pathlib import Path
>>>>>>> UPDATED
```

```python
aider/coders/base_coder.py
<<<<<<< ORIGINAL
class Coder:
    abs_fnames = None
    repo = None
    last_aider_commit_hash = None
    last_asked_for_commit_time = 0
    repo_map = None
    functions = None
    total_cost = 0.0
=======
class Coder:
    abs_fnames = None
    repo = None
    last_aider_commit_hash = None
    last_asked_for_commit_time = 0
    repo_map = None
    functions = None
    total_cost = 0.0
    chat_completion_call_hashes = []
>>>>>>> UPDATED
```

```python
aider/coders/base_coder.py
<<<<<<< ORIGINAL
    def send_with_retries(self, model, messages, functions):
        kwargs = dict(
            model=model,
            messages=messages,
            temperature=0,
            stream=self.stream,
        )
        if functions is not None:
            kwargs["functions"] = self.functions

        res = openai.ChatCompletion.create(**kwargs)
        return res
=======
    def send_with_retries(self, model, messages, functions):
        kwargs = dict(
            model=model,
            messages=messages,
            temperature=0,
            stream=self.stream,
        )
        if functions is not None:
            kwargs["functions"] = self.functions

        # Generate SHA1 hash of kwargs and append it to chat_completion_call_hashes
        hash_object = hashlib.sha1(json.dumps(kwargs, sort_keys=True).encode())
        self.chat_completion_call_hashes.append(hash_object.hexdigest())

        res = openai.ChatCompletion.create(**kwargs)
        return res
>>>>>>> UPDATED
```
2023-06-27 14:59:58 -07:00
Paul Gauthier
acc6be9e95 switched back to ``` as default fence 2023-06-26 16:42:29 -07:00
Paul Gauthier
23f96a28a0 use <source> fence by default 2023-06-26 16:34:46 -07:00
Paul Gauthier
58690da8b4 fences are obfuscated so aider can modify itself 2023-06-25 20:55:10 -07:00
Paul Gauthier
ef88cc6d55 refactor choose_fence 2023-06-25 20:34:32 -07:00
Paul Gauthier
96fda2aa9f abandon n-backticks, try some html fences 2023-06-25 20:23:36 -07:00
Paul Gauthier
9151cf03a1 quote with num_ticks 2023-06-25 19:58:17 -07:00
Paul Gauthier
a6d80e815e wip 2023-06-25 19:54:15 -07:00
Paul Gauthier
f625d52bec added self.fence_ticks 2023-06-25 17:03:20 -07:00
Paul Gauthier
59d99835b1 use a word for 3,4,5 backticks 2023-06-25 17:00:59 -07:00
Paul Gauthier
f005404ec0 Roughed in updated sys msg for whole format 2023-06-25 15:27:06 -07:00
Paul Gauthier
fe3f1c194d Added APIError 2023-06-24 20:04:49 -07:00
Paul Gauthier
8dcf819cb5 added ServiceUnavailableError for retries 2023-06-24 19:54:18 -07:00
Paul Gauthier
ac560c2877 Handle missing filenames by scanning for mentions in the text 2023-06-24 15:32:35 -07:00
Paul Gauthier
eaf02da46b stronger wholefile prompt about file listings; adopt allowed_to_edit in wholefile; tests 2023-06-24 14:45:43 -07:00
Paul Gauthier
467a9cb587 more verbose 2023-06-24 08:40:19 -07:00
Paul Gauthier
86457b8097 Limit retries on bad update replies 2023-06-24 08:38:52 -07:00
Paul Gauthier
a1909611d9 Raise ValueError if gpt makes an unknown function_call 2023-06-24 08:32:12 -07:00
Paul Gauthier
cee0f528ab better 2023-06-24 07:24:41 -07:00
Paul Gauthier
7d2fc1b2d9 fixed bug in show_send_output(), more robust error handling/reporting 2023-06-24 07:24:04 -07:00
Paul Gauthier
9e506cccb0 log with_message 2023-06-23 19:09:39 -07:00
Paul Gauthier
f23327ecf9 clearer repo-map initial message 2023-06-23 17:53:20 -07:00
Paul Gauthier
ae9ded4eaf No repo map if no repo 2023-06-23 16:10:48 -07:00
Paul Gauthier
50e715fb9a run pytest, cleanup 2023-06-23 15:40:14 -07:00
Paul Gauthier
200ff36848 Suppress Warning: no changes found in tracked files when no repo 2023-06-23 15:00:35 -07:00