Commit graph

1315 commits

Author SHA1 Message Date
Paul Gauthier
f1a31d3944 pass in commit models to gitrepo 2024-04-17 15:41:30 -07:00
Paul Gauthier
3662a4680b token pricing 2024-04-17 15:34:59 -07:00
Paul Gauthier
c9bb22d6d5 roughed in tokenizer, dropped openai, openrouter 2024-04-17 15:22:35 -07:00
Paul Gauthier
855e787175 removed skip-model-avail-check 2024-04-17 15:02:39 -07:00
Paul Gauthier
5c10944054 Abstract the default model name so it applies to scripting #537 2024-04-11 06:42:38 -07:00
Aloha
1fc1c304c7
Fix: use f-string 2024-04-11 16:58:10 +08:00
Paul Gauthier
0871764766 Don't share local git errors with GPT #500 2024-03-08 12:24:54 -08:00
Paul Gauthier
7fbd9e2be4 Added claude post 2024-03-08 08:00:41 -08:00
Paul Gauthier
0fb57895a4 link to the faq on edit errors 2024-03-04 12:37:51 -08:00
Paul Gauthier
6dd5ae69e3 Normalize paths before checking aiderignore #479 2024-02-25 15:54:57 -08:00
Paul Gauthier
49c904eea5 Added a warning if the user adds many files totaling many tokens 2024-02-25 15:34:51 -08:00
Paul Gauthier
a9fe4532c7 Aider should fully ignore files in aiderignore #479 2024-02-24 09:39:33 -08:00
Paul Gauthier
72e6cb901c Fixed bug with cost computations when --no-steam in effect #475 2024-02-11 05:48:32 -08:00
Paul Gauthier
35f812859e Rationalized openai model attributes #458 2024-02-07 12:07:30 -08:00
Paul Gauthier
580c52bd85 set mdargs on init 2024-01-23 09:58:57 -08:00
Paul Gauthier
b143bc56ac switch to mdstream 2024-01-23 09:20:31 -08:00
Paul Gauthier
23cc78f36b typo 2024-01-22 13:21:16 -08:00
Paul Gauthier
a8b854fe8d fix f-string 2024-01-22 13:10:15 -08:00
Paul Gauthier
29a578c621 Complete the search for viable hunks all the way down to 0 space context lines #435 2024-01-09 08:34:33 -08:00
Paul Gauthier
d5f4ba2278 handle multiple udiffs inside a single fenced block 2024-01-04 12:53:01 -08:00
Paul Gauthier
79ae43cb59 make udiff more clear when some hunks did apply 2024-01-04 12:23:19 -08:00
Paul Gauthier
cc3da03a0b add helpful warnings on launch 2024-01-02 09:58:50 -08:00
Paul Gauthier
a279adc5fc Update output to include number of files in git repo with comma separator. 2024-01-02 09:50:52 -08:00
Paul Gauthier
369d746f2f added assistant:ok turn after image message 2024-01-02 09:40:03 -08:00
paul-gauthier
2824acb5c2
Merge pull request #379 from joshuavial/gpt4-vision
add support for gpt-4-vision
2024-01-02 13:37:17 -04:00
Paul Gauthier
2241741316 dirty commits shouldn't move back the messages; was clipping the earlier USER: messages and preventing them from appearing in the commit message transcript 2024-01-02 09:23:00 -08:00
Paul Gauthier
dc4bec2986 Fix extracting file path from diff headers in udiff_coder. 2023-12-31 09:42:19 -08:00
Paul Gauthier
4dee2ab2f4 aider: Fix parsing of file paths with spaces in udiff_coder.py.
# Aider chat conversation:

USER: I just tried aider on a project where the folder names have spaces, and it has an issue parsing the diffs.

For example:

```diff
--- PRAW and URS Reddit Scraping/Classify.py
+++ PRAW and URS Reddit Scraping/Classify.py
@@ ... @@
 def classify(filename:str, model: str = 'gpt-3.5-turbo-1106'):
     d = json.load(open(filename))
     for post in d['fetched_posts']:
         messages = copy(MESSAGE_TEMPLATE_CLASSIFY)
...
```

Gives:

```Allow creation of new file PRAW? y```

Which is not correct, a new file is not being created here.

ASSISTANT: To address the issue with folder names containing spaces, we need to update the `find_diffs` function in `udiff_coder.py` to correctly parse file paths that include spaces. The current implementation seems to split the file path on spaces, which leads to incorrect behavior when folder or file names contain spaces.

Here's the diff with the necessary changes:

```diff
--- aider/coders/udiff_coder.py
+++ aider/coders/udiff_coder.py
@@ ... @@
 def find_diffs(content):
     # We can always use triple-quotes, because all the udiff content
     # is prefixed with +/-/space.

     if not content.endswith("\n"):
         content = content + "\n"

     lines = content.splitlines(keepends=True)
     line_num = 0
     edits = []
     while line_num < len(lines):
         while line_num < len(lines):
             line = lines[line_num]
             if line.startswith("```diff"):
                 line_num, these_edits = process_fenced_block(lines, line_num + 1)
                 edits += these_edits
                 break
             line_num += 1

     # For now, just take 1!
     # edits = edits[:1]

     return edits

 def process_fenced_block(lines, start_line_num):
     for line_num in range(start_line_num, len(lines)):
         line = lines[line_num]
         if line.startswith("```"):
             break

     block = lines[start_line_num:line_num]
     block.append("@@ @@")

-    if block[1].startswith("+++ "):
-        fname = block[1].split()[1]
+    if block[1].startswith("--- ") and block[2].startswith("+++ "):
+        # Extract the file path, considering that it might contain spaces
+        fname = block[1][4:].strip()
+        # Ensure that the file path is the same for both the original and new file
+        assert fname == block[2][4:].strip(), "File paths in diff headers do not match"
         block = block[2:]
     else:
         fname = None

     edits = []

     keeper = False
     hunk = []
     op = " "
     for line in block:
         hunk.append(line)
         if len(line) < 2:
             continue
         op = line[0]
         if op in "-+":
             keeper = True
             continue
         if op != "@":
             continue
         if not keeper:
             hunk = []
             continue

         hunk = hunk[:-1]
         edits.append((fname, hunk))
         hunk = []

     return line_num + 1, edits
@@ ... @@
```

This change ensures that the file path is correctly extracted from the diff headers, even if it contains spaces. It also adds an assertion to check that the file paths for the original and new files match, which is a common requirement in diffs.
2023-12-31 09:40:08 -08:00
Paul Gauthier
f4dc8c776b sssh 2023-12-21 08:58:06 -04:00
Joshua Vial
9e656945fe Merge remote-tracking branch 'upstream/main' into gpt4-vision 2023-12-21 09:29:32 +13:00
Paul Gauthier
4c330bcd48 Revert "folk prompting"
This reverts commit 29150bc6f4.
2023-12-19 10:40:46 -08:00
Paul Gauthier
80d6312817 Revert "folk prompting for udiff"
This reverts commit cb55165c81.
2023-12-19 10:40:35 -08:00
Paul Gauthier
cb55165c81 folk prompting for udiff 2023-12-19 10:12:05 -08:00
Paul Gauthier
29150bc6f4 folk prompting 2023-12-19 09:55:49 -08:00
Joshua Vial
48c680ffb6 fix for openrouter which doesn't return completion prices 2023-12-19 23:31:37 +13:00
Joshua Vial
179b648864 merging from upstream main 2023-12-19 22:04:39 +13:00
Paul Gauthier
ef2a1f3875 diff with move hint 2023-12-18 19:09:32 -08:00
Paul Gauthier
d9a301c9f8 laziness24-turbo-diff-never2x 2023-12-18 18:49:30 -08:00
Paul Gauthier
308007a8e9 laziness24-turbo-udiff-never2x 2023-12-18 18:43:15 -08:00
Paul Gauthier
f0b60a0052 Add clear instruction on how to make a new file 2023-12-17 15:25:15 -08:00
Paul Gauthier
042a2b8a08 pull the filename from the +++ line 2023-12-17 15:19:34 -08:00
Paul Gauthier
1e38577a3c Announce repo size 2023-12-17 13:01:47 -08:00
Paul Gauthier
0d4b6b6885 added missing files 2023-12-17 13:00:32 -08:00
Paul Gauthier
360846320f announce the edit format 2023-12-17 12:58:48 -08:00
Paul Gauthier
7113a30271 unified diffs 2023-12-17 12:54:34 -08:00
Joshua Vial
f9ba8e7b41 Remove unnecessary comment and method call in Commands class. 2023-12-11 22:24:02 +13:00
Joshua Vial
fe9423d7b8 merge in openai upgrade 2023-12-11 20:43:18 +13:00
Paul Gauthier
560759f0c0 show the repomap before the added files 2023-12-08 09:18:03 -08:00
Paul Gauthier
cab7460f94 catch 404s from azure on models.list 2023-12-07 07:44:21 -08:00
Paul Gauthier
ad092152d0 Revert "max_apply_update_errors = 1 for quick benchmark"
This reverts commit fd71b6a4a5.
2023-12-07 07:43:06 -08:00