From 9768e84fcd9af6ed47d23e93c332647efb4043e1 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 12 Sep 2024 19:15:47 -0700 Subject: [PATCH 001/149] feat: Change model settings from 'whole' to 'diff' --- aider/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/models.py b/aider/models.py index 31dffcc7a..7d768bf77 100644 --- a/aider/models.py +++ b/aider/models.py @@ -450,7 +450,7 @@ MODEL_SETTINGS = [ ), ModelSettings( "openai/o1-preview", - "whole", + "diff", weak_model_name="openai/gpt-4o-mini", use_repo_map=True, reminder="user", @@ -460,7 +460,7 @@ MODEL_SETTINGS = [ ), ModelSettings( "o1-preview", - "whole", + "diff", weak_model_name="gpt-4o-mini", use_repo_map=True, reminder="user", From d747a3781d5eddc7c28a28a79f27712422e0b505 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 12 Sep 2024 19:15:48 -0700 Subject: [PATCH 002/149] feat: add openrouter versions of o1-mini and o1-preview --- aider/models.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/aider/models.py b/aider/models.py index 7d768bf77..58cb6e285 100644 --- a/aider/models.py +++ b/aider/models.py @@ -468,6 +468,26 @@ MODEL_SETTINGS = [ use_temperature=False, streaming=False, ), + ModelSettings( + "openrouter/openai/o1-mini", + "whole", + weak_model_name="openrouter/openai/gpt-4o-mini", + use_repo_map=True, + reminder="user", + use_system_prompt=False, + use_temperature=False, + streaming=False, + ), + ModelSettings( + "openrouter/openai/o1-preview", + "diff", + weak_model_name="openrouter/openai/gpt-4o-mini", + use_repo_map=True, + reminder="user", + use_system_prompt=False, + use_temperature=False, + streaming=False, + ), ] From eba845ea511428a66cb30c6f631557d3c6c96681 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 12 Sep 2024 20:40:12 -0700 Subject: [PATCH 003/149] copy --- aider/website/_data/edit_leaderboard.yml | 47 +++++++++++++++- aider/website/_data/o1_results.yml | 70 +++++++++++++++++++++++- aider/website/_posts/2024-09-12-o1.md | 55 +++++++++++++------ 3 files changed, 152 insertions(+), 20 deletions(-) diff --git a/aider/website/_data/edit_leaderboard.yml b/aider/website/_data/edit_leaderboard.yml index 95d07f2b0..ca602ed83 100644 --- a/aider/website/_data/edit_leaderboard.yml +++ b/aider/website/_data/edit_leaderboard.yml @@ -1132,4 +1132,49 @@ versions: 0.56.1.dev seconds_per_case: 177.7 total_cost: 11.1071 - \ No newline at end of file + +- dirname: 2024-09-12-22-44-14--o1-preview-diff + test_cases: 133 + model: o1-preview (diff) + edit_format: diff + commit_hash: 72f52bd + pass_rate_1: 56.4 + pass_rate_2: 75.2 + percent_cases_well_formed: 84.2 + error_outputs: 27 + num_malformed_responses: 27 + num_with_malformed_responses: 21 + user_asks: 8 + lazy_comments: 0 + syntax_errors: 7 + indentation_errors: 3 + exhausted_context_windows: 0 + test_timeouts: 3 + command: aider --model o1-preview + date: 2024-09-12 + versions: 0.56.1.dev + seconds_per_case: 95.8 + total_cost: 71.7927 + +- dirname: 2024-09-13-02-13-59--o1-preview-whole + test_cases: 133 + model: o1-preview (whole) + edit_format: whole + commit_hash: 72f52bd-dirty + pass_rate_1: 58.6 + pass_rate_2: 79.7 + percent_cases_well_formed: 100.0 + error_outputs: 0 + num_malformed_responses: 0 + num_with_malformed_responses: 0 + user_asks: 2 + lazy_comments: 0 + syntax_errors: 1 + indentation_errors: 0 + exhausted_context_windows: 0 + test_timeouts: 2 + command: aider --model o1-preview + date: 2024-09-13 + versions: 0.56.1.dev + seconds_per_case: 47.4 + total_cost: 38.0612 \ No newline at end of file diff --git a/aider/website/_data/o1_results.yml b/aider/website/_data/o1_results.yml index 292e258a2..099355e55 100644 --- a/aider/website/_data/o1_results.yml +++ b/aider/website/_data/o1_results.yml @@ -115,4 +115,72 @@ versions: 0.56.1.dev seconds_per_case: 177.7 total_cost: 11.1071 - \ No newline at end of file + +- dirname: 2024-09-05-21-26-49--sonnet-whole-sep5 + test_cases: 133 + model: claude-3.5-sonnet (whole) + edit_format: whole + commit_hash: 8cfdcbd + pass_rate_1: 55.6 + pass_rate_2: 75.2 + percent_cases_well_formed: 100.0 + error_outputs: 0 + num_malformed_responses: 0 + num_with_malformed_responses: 0 + user_asks: 0 + lazy_comments: 0 + syntax_errors: 0 + indentation_errors: 0 + exhausted_context_windows: 0 + test_timeouts: 0 + command: aider --model openrouter/anthropic/claude-3.5-sonnet --edit-format whole + date: 2024-09-05 + versions: 0.55.1.dev + seconds_per_case: 15.2 + total_cost: 2.3502 + +- dirname: 2024-09-12-22-44-14--o1-preview-diff + test_cases: 133 + model: o1-preview (diff) + edit_format: diff + commit_hash: 72f52bd + pass_rate_1: 56.4 + pass_rate_2: 75.2 + percent_cases_well_formed: 84.2 + error_outputs: 27 + num_malformed_responses: 27 + num_with_malformed_responses: 21 + user_asks: 8 + lazy_comments: 0 + syntax_errors: 7 + indentation_errors: 3 + exhausted_context_windows: 0 + test_timeouts: 3 + command: aider --model o1-preview + date: 2024-09-12 + versions: 0.56.1.dev + seconds_per_case: 95.8 + total_cost: 71.7927 + +- dirname: 2024-09-13-02-13-59--o1-preview-whole + test_cases: 133 + model: o1-preview (whole) + edit_format: whole + commit_hash: 72f52bd-dirty + pass_rate_1: 58.6 + pass_rate_2: 79.7 + percent_cases_well_formed: 100.0 + error_outputs: 0 + num_malformed_responses: 0 + num_with_malformed_responses: 0 + user_asks: 2 + lazy_comments: 0 + syntax_errors: 1 + indentation_errors: 0 + exhausted_context_windows: 0 + test_timeouts: 2 + command: aider --model o1-preview + date: 2024-09-13 + versions: 0.56.1.dev + seconds_per_case: 47.4 + total_cost: 38.0612 \ No newline at end of file diff --git a/aider/website/_posts/2024-09-12-o1.md b/aider/website/_posts/2024-09-12-o1.md index 0b06fdee3..c5399cc49 100644 --- a/aider/website/_posts/2024-09-12-o1.md +++ b/aider/website/_posts/2024-09-12-o1.md @@ -1,5 +1,5 @@ --- -title: Benchmark results for OpenAI o1-mini +title: o1-preview is SOTA on the aider leaderboard excerpt: Preliminary benchmark results for the new OpenAI o1-mini model. nav_exclude: true --- @@ -7,7 +7,7 @@ nav_exclude: true {% endif %} -# Benchmark results for OpenAI o1-mini +# OpenAI o1-preview is SOTA on the aider leaderboard @@ -20,39 +20,58 @@ nav_exclude: true %} +## o1-preview + +OpenAI o1-preview scored 79.7% on aider's code editing benchmark, +a state of the art result. +It achieved this result with the +["whole" edit format](/docs/leaderboards/#notes-on-the-edit-format), +where the LLM returns a full copy of the source code file with changes. + +It is much more practical to use aider's +["diff" edit format](/docs/leaderboards/#notes-on-the-edit-format). +which allows the LLM to return search/replace blocks to +efficiently edit the source code. +This saves significant time and token costs. + +Using the diff edit format the o1-preview model had a strong +benchmark score of 75.2%. +This likely places o1-preview between Sonnet and GPT-4o for practical use, +but at significantly higher cost. + +## o1-mini + OpenAI o1-mini is priced similarly to GPT-4o and Claude 3.5 Sonnet, but scored below those models. +It also works best with the whole edit format. -It works best with the -["whole" edit format](/docs/leaderboards/#notes-on-the-edit-format), -where it returns a full copy of the source code file with changes. -Other frontier models like GPT-4o and Sonnet are able to achieve -high benchmark scores using the -["diff" edit format](/docs/leaderboards/#notes-on-the-edit-format), -This allows them to return search/replace blocks to -efficiently edit the source code, saving time and token costs. +## Future work + +The o1-preview model had trouble conforming to aider's diff edit format. The o1-mini model had trouble conforming to both the whole and diff edit formats. Aider is extremely permissive and tries hard to accept anything close to the correct formats. -It's possible that o1-mini would get better scores if aider prompted with -more examples or was adapted to parse o1-mini's favorite ways to mangle -the response formats. -Over time it may be possible to better harness o1-mini's capabilities through -different prompting and editing formats. +It is surprising that such strong models had trouble with +the syntactic requirements of simple text output formats. +It seems likely that aider could optimize its prompts and edit formats to +better harness the o1 models. -## Using aider with o1-mini and o1-preview + +## Using aider with o1 OpenAI's new o1 models are supported in the development version of aider: ``` +# To upgrade to the development version: aider --install-main-branch -# or... + +# Or, to upgrade/install: python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git +# To launch aider with an o1 model: aider --model o1-mini - aider --model o1-preview ``` From e6037140be0105ee2575761b69c0e5ec7acf946b Mon Sep 17 00:00:00 2001 From: paul-gauthier <69695708+paul-gauthier@users.noreply.github.com> Date: Thu, 12 Sep 2024 21:09:15 -0700 Subject: [PATCH 004/149] Update 2024-09-12-o1.md --- aider/website/_posts/2024-09-12-o1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/website/_posts/2024-09-12-o1.md b/aider/website/_posts/2024-09-12-o1.md index c5399cc49..06ab7bf61 100644 --- a/aider/website/_posts/2024-09-12-o1.md +++ b/aider/website/_posts/2024-09-12-o1.md @@ -1,6 +1,6 @@ --- title: o1-preview is SOTA on the aider leaderboard -excerpt: Preliminary benchmark results for the new OpenAI o1-mini model. +excerpt: Preliminary benchmark results for the new OpenAI o1 models. nav_exclude: true --- {% if page.date %} From baddc0b63cb114ac9b33583d8447930aa1a3df5b Mon Sep 17 00:00:00 2001 From: fry69 <142489379+fry69@users.noreply.github.com> Date: Sun, 15 Sep 2024 15:18:09 +0200 Subject: [PATCH 005/149] fix: add keybinding to insert space on Ctrl+Space --- aider/io.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/aider/io.py b/aider/io.py index 4957ee737..897211355 100644 --- a/aider/io.py +++ b/aider/io.py @@ -15,9 +15,10 @@ from prompt_toolkit.styles import Style from pygments.lexers import MarkdownLexer, guess_lexer_for_filename from pygments.token import Token from rich.console import Console +from rich.markdown import Markdown from rich.style import Style as RichStyle from rich.text import Text -from rich.markdown import Markdown + from aider.mdstream import MarkdownStream from .dump import dump # noqa: F401 @@ -339,6 +340,11 @@ class InputOutput: kb = KeyBindings() + @kb.add("c-space") + def _(event): + "Ignore Ctrl when pressing space bar" + event.current_buffer.insert_text(" ") + @kb.add("escape", "c-m", eager=True) def _(event): event.current_buffer.insert_text("\n") @@ -589,7 +595,7 @@ class InputOutput: def assistant_output(self, message, stream=False): mdStream = None show_resp = message - + if self.pretty: if stream: mdargs = dict(style=self.assistant_output_color, code_theme=self.code_theme) @@ -603,10 +609,10 @@ class InputOutput: self.console.print(show_resp) return mdStream - + def print(self, message=""): print(message) - + def append_chat_history(self, text, linebreak=False, blockquote=False, strip=True): if blockquote: if strip: From c13aadaa0e2c247345170e1922ee087619ee720a Mon Sep 17 00:00:00 2001 From: Anjor Kanekar Date: Wed, 18 Sep 2024 14:54:04 +0100 Subject: [PATCH 006/149] Fix broken link --- aider/website/docs/leaderboards/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/website/docs/leaderboards/index.md b/aider/website/docs/leaderboards/index.md index 42178bb03..a025ab177 100644 --- a/aider/website/docs/leaderboards/index.md +++ b/aider/website/docs/leaderboards/index.md @@ -154,7 +154,7 @@ See the [benchmark README](https://github.com/paul-gauthier/aider/blob/main/benchmark/README.md) for information on running aider's code editing benchmarks. Submit results by opening a PR with edits to the -[benchmark results data files](https://github.com/paul-gauthier/aider/blob/main/website/_data/). +[benchmark results data files](https://github.com/paul-gauthier/aider/blob/main/aider/website/_data/). From 2753ac6b6285c0caf3e122618830f1e6177dab05 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 20 Sep 2024 13:27:58 -0700 Subject: [PATCH 041/149] feat: Add new benchmark test case for qwen-2.5-72b-instruct-diff model --- aider/website/_data/edit_leaderboard.yml | 30 ++++++++++++------------ benchmark/benchmark.py | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/aider/website/_data/edit_leaderboard.yml b/aider/website/_data/edit_leaderboard.yml index 61f9f62cc..4b538e798 100644 --- a/aider/website/_data/edit_leaderboard.yml +++ b/aider/website/_data/edit_leaderboard.yml @@ -1201,26 +1201,26 @@ versions: 0.56.0 seconds_per_case: 9.3 total_cost: 0.0000 - -- dirname: 2024-09-20-20-07-27--qwen-2.5-72b-instruct + +- dirname: 2024-09-20-20-20-19--qwen-2.5-72b-instruct-diff test_cases: 133 model: qwen-2.5-72b-instruct (bf16) - edit_format: whole - commit_hash: d7051ce - pass_rate_1: 52.6 - pass_rate_2: 64.7 - percent_cases_well_formed: 100.0 - error_outputs: 0 - num_malformed_responses: 0 - num_with_malformed_responses: 0 - user_asks: 2 + edit_format: diff + commit_hash: 5139594 + pass_rate_1: 53.4 + pass_rate_2: 65.4 + percent_cases_well_formed: 96.2 + error_outputs: 9 + num_malformed_responses: 9 + num_with_malformed_responses: 5 + user_asks: 3 lazy_comments: 0 - syntax_errors: 0 - indentation_errors: 0 + syntax_errors: 2 + indentation_errors: 1 exhausted_context_windows: 0 - test_timeouts: 0 + test_timeouts: 3 command: aider --model openrouter/qwen/qwen-2.5-72b-instruct date: 2024-09-20 versions: 0.56.1.dev - seconds_per_case: 53.9 + seconds_per_case: 39.8 total_cost: 0.0000 \ No newline at end of file diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 3d559b9be..360e0705c 100755 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -549,7 +549,7 @@ def run_test_real( chat_history_file=history_fname, ) - main_model = models.Model(model_name) + main_model = models.Model(model_name, weak_model=model_name) edit_format = edit_format or main_model.edit_format dump(main_model) From 230ec50209a5240ed6e64a961b83f6ff8f90746b Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 20 Sep 2024 13:40:44 -0700 Subject: [PATCH 042/149] refactor: Improve `choose_fence` function to check for fence start in lines --- aider/coders/base_coder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 22c8d8400..3960515af 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -493,9 +493,10 @@ class Coder: if content is not None: all_content += content + "\n" + lines = all_content.splitlines() good = False for fence_open, fence_close in self.fences: - if fence_open in all_content or fence_close in all_content: + if any(line.startswith(fence_open) or line.startswith(fence_close) for line in lines): continue good = True break From 7fa1620f58132ec085a7939a8015bbe7935827a2 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 20 Sep 2024 13:44:02 -0700 Subject: [PATCH 043/149] feat: Allow flexible matching of 5-9 characters in SEARCH/REPLACE block prefixes --- aider/coders/editblock_coder.py | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index ffbcfc644..a8762846b 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -365,9 +365,13 @@ def do_replace(fname, content, before_text, after_text, fence=None): return new_content -HEAD = "<<<<<<< SEARCH" -DIVIDER = "=======" -UPDATED = ">>>>>>> REPLACE" +HEAD = r"<{5,9} SEARCH" +DIVIDER = r"={5,9}" +UPDATED = r">{5,9} REPLACE" + +HEAD_ERR = "<<<<<<< SEARCH" +DIVIDER_ERR = "=======" +UPDATED_ERR = ">>>>>>> REPLACE" separators = "|".join([HEAD, DIVIDER, UPDATED]) @@ -407,6 +411,10 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE, valid_fnames=None) i = 0 current_filename = None + head_pattern = re.compile(HEAD) + divider_pattern = re.compile(DIVIDER) + updated_pattern = re.compile(UPDATED) + while i < len(lines): line = lines[i] @@ -425,7 +433,7 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE, valid_fnames=None) "```csh", "```tcsh", ] - next_is_editblock = i + 1 < len(lines) and lines[i + 1].rstrip() == HEAD + next_is_editblock = i + 1 < len(lines) and head_pattern.match(lines[i + 1].strip()) if any(line.strip().startswith(start) for start in shell_starts) and not next_is_editblock: shell_content = [] @@ -440,10 +448,10 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE, valid_fnames=None) continue # Check for SEARCH/REPLACE blocks - if line.strip() == HEAD: + if head_pattern.match(line.strip()): try: # if next line after HEAD exists and is DIVIDER, it's a new file - if i + 1 < len(lines) and lines[i + 1].strip() == DIVIDER: + if i + 1 < len(lines) and divider_pattern.match(lines[i + 1].strip()): filename = find_filename(lines[max(0, i - 3) : i], fence, None) else: filename = find_filename( @@ -460,21 +468,21 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE, valid_fnames=None) original_text = [] i += 1 - while i < len(lines) and not lines[i].strip() == DIVIDER: + while i < len(lines) and not divider_pattern.match(lines[i].strip()): original_text.append(lines[i]) i += 1 - if i >= len(lines) or lines[i].strip() != DIVIDER: - raise ValueError(f"Expected `{DIVIDER}`") + if i >= len(lines) or not divider_pattern.match(lines[i].strip()): + raise ValueError(f"Expected `{DIVIDER_ERR}`") updated_text = [] i += 1 - while i < len(lines) and not lines[i].strip() in (UPDATED, DIVIDER): + while i < len(lines) and not (updated_pattern.match(lines[i].strip()) or divider_pattern.match(lines[i].strip())): updated_text.append(lines[i]) i += 1 - if i >= len(lines) or lines[i].strip() not in (UPDATED, DIVIDER): - raise ValueError(f"Expected `{UPDATED}` or `{DIVIDER}`") + if i >= len(lines) or not (updated_pattern.match(lines[i].strip()) or divider_pattern.match(lines[i].strip())): + raise ValueError(f"Expected `{UPDATED_ERR}` or `{DIVIDER_ERR}`") yield filename, "".join(original_text), "".join(updated_text) From 454a2ebdcf78d1e2c1c93758499e123a6ac26fcf Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 20 Sep 2024 13:44:07 -0700 Subject: [PATCH 044/149] style: format code using linter --- aider/coders/editblock_coder.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index a8762846b..118759e9c 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -454,9 +454,7 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE, valid_fnames=None) if i + 1 < len(lines) and divider_pattern.match(lines[i + 1].strip()): filename = find_filename(lines[max(0, i - 3) : i], fence, None) else: - filename = find_filename( - lines[max(0, i - 3) : i], fence, valid_fnames - ) + filename = find_filename(lines[max(0, i - 3) : i], fence, valid_fnames) if not filename: if current_filename: @@ -477,11 +475,17 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE, valid_fnames=None) updated_text = [] i += 1 - while i < len(lines) and not (updated_pattern.match(lines[i].strip()) or divider_pattern.match(lines[i].strip())): + while i < len(lines) and not ( + updated_pattern.match(lines[i].strip()) + or divider_pattern.match(lines[i].strip()) + ): updated_text.append(lines[i]) i += 1 - if i >= len(lines) or not (updated_pattern.match(lines[i].strip()) or divider_pattern.match(lines[i].strip())): + if i >= len(lines) or not ( + updated_pattern.match(lines[i].strip()) + or divider_pattern.match(lines[i].strip()) + ): raise ValueError(f"Expected `{UPDATED_ERR}` or `{DIVIDER_ERR}`") yield filename, "".join(original_text), "".join(updated_text) From 412b8e7c3c650aa470ee32f70eb2a5f1f529b340 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 10:09:26 -0700 Subject: [PATCH 045/149] copy --- HISTORY.md | 5 +++-- aider/website/HISTORY.md | 5 +++-- aider/website/_posts/2024-09-12-o1.md | 9 +-------- aider/website/docs/leaderboards/index.md | 2 +- benchmark/benchmark.py | 5 ++++- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 1d15781d3..ee0c74679 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,12 +7,13 @@ - `aider --model o1-mini` - `aider --model o1-preview` - On Windows, `/run` correctly uses PowerShell or cmd.exe. -- Support for new 08-2024 Cohere models. +- Support for new 08-2024 Cohere models, by @jalammar. - Can now recursively add directories with `/read-only`. - User input prompts now fall back to simple `input()` if `--no-pretty` or a Windows console is not available. - Improved sanity check of git repo on startup. - Improvements to prompt cache chunking strategy. -- Bugfix to remove spurious "No changes made to git tracked files." +- Removed "No changes made to git tracked files". +- Numerous bug fixes for corner case crashes. ### Aider v0.56.0 diff --git a/aider/website/HISTORY.md b/aider/website/HISTORY.md index b60e044e2..654c3b714 100644 --- a/aider/website/HISTORY.md +++ b/aider/website/HISTORY.md @@ -22,12 +22,13 @@ cog.out(text) - `aider --model o1-mini` - `aider --model o1-preview` - On Windows, `/run` correctly uses PowerShell or cmd.exe. -- Support for new 08-2024 Cohere models. +- Support for new 08-2024 Cohere models, by @jalammar. - Can now recursively add directories with `/read-only`. - User input prompts now fall back to simple `input()` if `--no-pretty` or a Windows console is not available. - Improved sanity check of git repo on startup. - Improvements to prompt cache chunking strategy. -- Bugfix to remove spurious "No changes made to git tracked files." +- Removed "No changes made to git tracked files". +- Numerous bug fixes for corner case crashes. ### Aider v0.56.0 diff --git a/aider/website/_posts/2024-09-12-o1.md b/aider/website/_posts/2024-09-12-o1.md index 99dd6c513..01201f6f1 100644 --- a/aider/website/_posts/2024-09-12-o1.md +++ b/aider/website/_posts/2024-09-12-o1.md @@ -61,16 +61,9 @@ better harness the o1 models. ## Using aider with o1 -OpenAI's new o1 models are supported in the development version of aider: +OpenAI's new o1 models are supported in v0.57.0 of aider: ``` -# To upgrade to the development version: -aider --install-main-branch - -# Or, to upgrade/install: -python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git - -# To launch aider with an o1 model: aider --model o1-mini aider --model o1-preview ``` diff --git a/aider/website/docs/leaderboards/index.md b/aider/website/docs/leaderboards/index.md index de44a65b2..b8a312e05 100644 --- a/aider/website/docs/leaderboards/index.md +++ b/aider/website/docs/leaderboards/index.md @@ -181,6 +181,6 @@ mod_dates = [get_last_modified_date(file) for file in files] latest_mod_date = max(mod_dates) cog.out(f"{latest_mod_date.strftime('%B %d, %Y.')}") ]]]--> -September 20, 2024. +September 21, 2024.

diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 360e0705c..979227cf5 100755 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -549,7 +549,10 @@ def run_test_real( chat_history_file=history_fname, ) - main_model = models.Model(model_name, weak_model=model_name) + # weak_model_name = model_name + weak_model_name = None + + main_model = models.Model(model_name, weak_model=weak_model_name) edit_format = edit_format or main_model.edit_format dump(main_model) From b27738d39aef249c0d0f7c295968bff102993efe Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 10:11:37 -0700 Subject: [PATCH 046/149] copy --- aider/website/_posts/2024-09-12-o1.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aider/website/_posts/2024-09-12-o1.md b/aider/website/_posts/2024-09-12-o1.md index 01201f6f1..7b44aa679 100644 --- a/aider/website/_posts/2024-09-12-o1.md +++ b/aider/website/_posts/2024-09-12-o1.md @@ -69,8 +69,10 @@ aider --model o1-preview ``` {: .note } -> These are *preliminiary* benchmark results, which will be updated as -> additional benchmark runs complete and rate limits open up. +> These are initial benchmark results for the o1 models, +> based on aider v0.56.1-dev. +> See the [aider leaderboards](/docs/leaderboards/) for up-to-date results +> based on the latest aider releases. From 565c305aa65a0fae8e7ca6e3530e337bd852650d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 10:27:50 -0700 Subject: [PATCH 047/149] update o1-preview leaderboard to diff only --- HISTORY.md | 2 + aider/website/_data/edit_leaderboard.yml | 53 +++++++----------------- 2 files changed, 17 insertions(+), 38 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index ee0c74679..2033bc240 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,6 +6,8 @@ - Support for OpenAI o1 models: - `aider --model o1-mini` - `aider --model o1-preview` + - o1-preview now works well with diff edit format. + - o1-preview with diff now matches SOTA leaderboard result with whole edit format. - On Windows, `/run` correctly uses PowerShell or cmd.exe. - Support for new 08-2024 Cohere models, by @jalammar. - Can now recursively add directories with `/read-only`. diff --git a/aider/website/_data/edit_leaderboard.yml b/aider/website/_data/edit_leaderboard.yml index 4b538e798..5d85799df 100644 --- a/aider/website/_data/edit_leaderboard.yml +++ b/aider/website/_data/edit_leaderboard.yml @@ -1133,52 +1133,29 @@ seconds_per_case: 177.7 total_cost: 11.1071 -- dirname: 2024-09-12-22-44-14--o1-preview-diff +- dirname: 2024-09-21-16-45-11--o1-preview-flex-sr-markers test_cases: 133 - model: o1-preview (diff) + model: o1-preview edit_format: diff - commit_hash: 72f52bd - pass_rate_1: 56.4 - pass_rate_2: 75.2 - percent_cases_well_formed: 84.2 - error_outputs: 27 - num_malformed_responses: 27 - num_with_malformed_responses: 21 - user_asks: 8 - lazy_comments: 0 - syntax_errors: 7 - indentation_errors: 3 - exhausted_context_windows: 0 - test_timeouts: 3 - command: aider --model o1-preview - date: 2024-09-12 - versions: 0.56.1.dev - seconds_per_case: 95.8 - total_cost: 71.7927 - -- dirname: 2024-09-13-02-13-59--o1-preview-whole - test_cases: 133 - model: o1-preview (whole) - edit_format: whole - commit_hash: 72f52bd-dirty - pass_rate_1: 58.6 + commit_hash: 5493654-dirty + pass_rate_1: 57.9 pass_rate_2: 79.7 - percent_cases_well_formed: 100.0 - error_outputs: 0 - num_malformed_responses: 0 - num_with_malformed_responses: 0 - user_asks: 2 + percent_cases_well_formed: 93.2 + error_outputs: 11 + num_malformed_responses: 11 + num_with_malformed_responses: 9 + user_asks: 3 lazy_comments: 0 - syntax_errors: 1 + syntax_errors: 10 indentation_errors: 0 exhausted_context_windows: 0 - test_timeouts: 2 + test_timeouts: 1 command: aider --model o1-preview - date: 2024-09-13 + date: 2024-09-21 versions: 0.56.1.dev - seconds_per_case: 47.4 - total_cost: 38.0612 - + seconds_per_case: 80.9 + total_cost: 63.9190 + - dirname: 2024-09-19-16-58-29--qwen2.5-coder:7b-instruct-q8_0 test_cases: 133 model: qwen2.5-coder:7b-instruct-q8_0 From f29825ff22e25e6cdd0ee648d03c89ae9023ff53 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 10:41:43 -0700 Subject: [PATCH 048/149] copy --- aider/website/HISTORY.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aider/website/HISTORY.md b/aider/website/HISTORY.md index 654c3b714..55f0d4fd8 100644 --- a/aider/website/HISTORY.md +++ b/aider/website/HISTORY.md @@ -21,6 +21,8 @@ cog.out(text) - Support for OpenAI o1 models: - `aider --model o1-mini` - `aider --model o1-preview` + - o1-preview now works well with diff edit format. + - o1-preview with diff now matches SOTA leaderboard result with whole edit format. - On Windows, `/run` correctly uses PowerShell or cmd.exe. - Support for new 08-2024 Cohere models, by @jalammar. - Can now recursively add directories with `/read-only`. From cfe1d540f12802cc6e17b34214bc385dbb58e123 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 10:42:58 -0700 Subject: [PATCH 049/149] update fence test to use backticks at start of line --- tests/basic/test_coder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/basic/test_coder.py b/tests/basic/test_coder.py index c1305c336..a5172cbc1 100644 --- a/tests/basic/test_coder.py +++ b/tests/basic/test_coder.py @@ -353,7 +353,7 @@ class TestCoder(unittest.TestCase): _, file1 = tempfile.mkstemp() with open(file1, "wb") as f: - f.write(b"this contains ``` backticks") + f.write(b"this contains\n```\nbackticks") files = [file1] From 237c4ab323f2c5c6ceb7e4d8922bec4d64b2ef82 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 10:44:25 -0700 Subject: [PATCH 050/149] copy --- HISTORY.md | 7 ++++--- aider/website/HISTORY.md | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 2033bc240..0d15ddd1e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,13 +1,13 @@ # Release history -### main branch +### Aider v0.57.0 - Support for OpenAI o1 models: - - `aider --model o1-mini` - - `aider --model o1-preview` - o1-preview now works well with diff edit format. - o1-preview with diff now matches SOTA leaderboard result with whole edit format. + - `aider --model o1-mini` + - `aider --model o1-preview` - On Windows, `/run` correctly uses PowerShell or cmd.exe. - Support for new 08-2024 Cohere models, by @jalammar. - Can now recursively add directories with `/read-only`. @@ -16,6 +16,7 @@ - Improvements to prompt cache chunking strategy. - Removed "No changes made to git tracked files". - Numerous bug fixes for corner case crashes. +- Aider wrote 70% of the code in this release. ### Aider v0.56.0 diff --git a/aider/website/HISTORY.md b/aider/website/HISTORY.md index 55f0d4fd8..c54798adb 100644 --- a/aider/website/HISTORY.md +++ b/aider/website/HISTORY.md @@ -16,13 +16,13 @@ cog.out(text) # Release history -### main branch +### Aider v0.57.0 - Support for OpenAI o1 models: - - `aider --model o1-mini` - - `aider --model o1-preview` - o1-preview now works well with diff edit format. - o1-preview with diff now matches SOTA leaderboard result with whole edit format. + - `aider --model o1-mini` + - `aider --model o1-preview` - On Windows, `/run` correctly uses PowerShell or cmd.exe. - Support for new 08-2024 Cohere models, by @jalammar. - Can now recursively add directories with `/read-only`. @@ -31,6 +31,7 @@ cog.out(text) - Improvements to prompt cache chunking strategy. - Removed "No changes made to git tracked files". - Numerous bug fixes for corner case crashes. +- Aider wrote 70% of the code in this release. ### Aider v0.56.0 From 2ca093fb8406f0d1383ff655a9afce2d53cb7cf2 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 11:04:48 -0700 Subject: [PATCH 051/149] Bumping all dependencies --- HISTORY.md | 1 + aider/sendchat.py | 2 +- aider/website/HISTORY.md | 1 + aider/website/docs/llms/other.md | 8 +---- requirements.txt | 36 +++++++++++----------- requirements/requirements-browser.txt | 16 +++++----- requirements/requirements-dev.txt | 26 ++++++++-------- requirements/requirements-help.txt | 39 ++++++++++++------------ requirements/requirements-playwright.txt | 4 +-- 9 files changed, 64 insertions(+), 69 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 0d15ddd1e..fbf40778c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -16,6 +16,7 @@ - Improvements to prompt cache chunking strategy. - Removed "No changes made to git tracked files". - Numerous bug fixes for corner case crashes. +- Updated all dependency versions. - Aider wrote 70% of the code in this release. ### Aider v0.56.0 diff --git a/aider/sendchat.py b/aider/sendchat.py index 55c64b2fe..1ac34f9ab 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -27,7 +27,7 @@ def retry_exceptions(): litellm.exceptions.ServiceUnavailableError, litellm.exceptions.Timeout, litellm.exceptions.InternalServerError, - litellm.llms.anthropic.AnthropicError, + litellm.llms.anthropic.chat.AnthropicError, ) diff --git a/aider/website/HISTORY.md b/aider/website/HISTORY.md index c54798adb..2af026ae9 100644 --- a/aider/website/HISTORY.md +++ b/aider/website/HISTORY.md @@ -31,6 +31,7 @@ cog.out(text) - Improvements to prompt cache chunking strategy. - Removed "No changes made to git tracked files". - Numerous bug fixes for corner case crashes. +- Updated all dependency versions. - Aider wrote 70% of the code in this release. ### Aider v0.56.0 diff --git a/aider/website/docs/llms/other.md b/aider/website/docs/llms/other.md index 8eebdfa4d..7fb999111 100644 --- a/aider/website/docs/llms/other.md +++ b/aider/website/docs/llms/other.md @@ -63,6 +63,7 @@ cog.out(''.join(lines)) - AZURE_API_KEY - AZURE_OPENAI_API_KEY - BASETEN_API_KEY +- CEREBRAS_API_KEY - CLARIFAI_API_KEY - CLOUDFLARE_API_KEY - CODESTRAL_API_KEY @@ -71,18 +72,14 @@ cog.out(''.join(lines)) - DATABRICKS_API_KEY - DEEPINFRA_API_KEY - DEEPSEEK_API_KEY -- EMPOWER_API_KEY - FIREWORKSAI_API_KEY - FIREWORKS_AI_API_KEY - FIREWORKS_API_KEY -- FRIENDLIAI_API_KEY - GEMINI_API_KEY -- GITHUB_API_KEY - GROQ_API_KEY - HUGGINGFACE_API_KEY - MARITALK_API_KEY - MISTRAL_API_KEY -- MISTRAL_AZURE_API_KEY - NLP_CLOUD_API_KEY - NVIDIA_NIM_API_KEY - OLLAMA_API_KEY @@ -91,14 +88,11 @@ cog.out(''.join(lines)) - OR_API_KEY - PALM_API_KEY - PERPLEXITYAI_API_KEY -- PERPLEXITY_API_KEY - PREDIBASE_API_KEY - PROVIDER_API_KEY - QDRANT_API_KEY - REPLICATE_API_KEY - TOGETHERAI_API_KEY -- TOGETHER_AI_API_KEY -- TOGETHER_API_KEY - VOLCENGINE_API_KEY - VOYAGE_API_KEY - XINFERENCE_API_KEY diff --git a/requirements.txt b/requirements.txt index a502ad72b..ab8871925 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ aiosignal==1.3.1 # via aiohttp annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.6.0 # via # httpx # openai @@ -25,12 +25,12 @@ backoff==2.2.1 # via -r requirements/requirements.in beautifulsoup4==4.12.3 # via -r requirements/requirements.in -certifi==2024.7.4 +certifi==2024.8.30 # via # httpcore # httpx # requests -cffi==1.17.0 +cffi==1.17.1 # via # sounddevice # soundfile @@ -46,7 +46,7 @@ diskcache==5.6.3 # via -r requirements/requirements.in distro==1.9.0 # via openai -filelock==3.15.4 +filelock==3.16.1 # via huggingface-hub flake8==7.1.1 # via -r requirements/requirements.in @@ -54,7 +54,7 @@ frozenlist==1.4.1 # via # aiohttp # aiosignal -fsspec==2024.6.1 +fsspec==2024.9.0 # via huggingface-hub gitdb==4.0.11 # via gitpython @@ -68,9 +68,9 @@ httpcore==1.0.5 # via httpx httpx==0.27.2 # via openai -huggingface-hub==0.24.6 +huggingface-hub==0.25.0 # via tokenizers -idna==3.8 +idna==3.10 # via # anyio # httpx @@ -80,7 +80,7 @@ importlib-metadata==7.2.1 # via # -r requirements/requirements.in # litellm -importlib-resources==6.4.4 +importlib-resources==6.4.5 # via -r requirements/requirements.in jinja2==3.1.4 # via litellm @@ -94,7 +94,7 @@ jsonschema==4.23.0 # litellm jsonschema-specifications==2023.12.1 # via jsonschema -litellm==1.44.7 +litellm==1.47.0 # via -r requirements/requirements.in markdown-it-py==3.0.0 # via rich @@ -104,7 +104,7 @@ mccabe==0.7.0 # via flake8 mdurl==0.1.2 # via markdown-it-py -multidict==6.0.5 +multidict==6.1.0 # via # aiohttp # yarl @@ -114,7 +114,7 @@ numpy==1.26.4 # via # -r requirements/requirements.in # scipy -openai==1.42.0 +openai==1.47.0 # via litellm packaging==24.1 # via @@ -138,11 +138,11 @@ pycodestyle==2.12.1 # via flake8 pycparser==2.22 # via cffi -pydantic==2.8.2 +pydantic==2.9.2 # via # litellm # openai -pydantic-core==2.20.1 +pydantic-core==2.23.4 # via pydantic pyflakes==3.2.0 # via flake8 @@ -162,14 +162,14 @@ referencing==0.35.1 # via # jsonschema # jsonschema-specifications -regex==2024.7.24 +regex==2024.9.11 # via tiktoken requests==2.32.3 # via # huggingface-hub # litellm # tiktoken -rich==13.8.0 +rich==13.8.1 # via -r requirements/requirements.in rpds-py==0.20.0 # via @@ -212,11 +212,11 @@ typing-extensions==4.12.2 # openai # pydantic # pydantic-core -urllib3==2.2.2 +urllib3==2.2.3 # via requests wcwidth==0.2.13 # via prompt-toolkit -yarl==1.9.4 +yarl==1.11.1 # via aiohttp -zipp==3.20.1 +zipp==3.20.2 # via importlib-metadata diff --git a/requirements/requirements-browser.txt b/requirements/requirements-browser.txt index 9b843f5c8..41c441fd7 100644 --- a/requirements/requirements-browser.txt +++ b/requirements/requirements-browser.txt @@ -15,7 +15,7 @@ blinker==1.8.2 # via streamlit cachetools==5.5.0 # via streamlit -certifi==2024.7.4 +certifi==2024.8.30 # via # -c requirements/../requirements.txt # requests @@ -35,7 +35,7 @@ gitpython==3.1.43 # via # -c requirements/../requirements.txt # streamlit -idna==3.8 +idna==3.10 # via # -c requirements/../requirements.txt # requests @@ -64,7 +64,7 @@ mdurl==0.1.2 # via # -c requirements/../requirements.txt # markdown-it-py -narwhals==1.5.5 +narwhals==1.8.2 # via altair numpy==1.26.4 # via @@ -78,13 +78,13 @@ packaging==24.1 # -c requirements/../requirements.txt # altair # streamlit -pandas==2.2.2 +pandas==2.2.3 # via streamlit pillow==10.4.0 # via # -c requirements/../requirements.txt # streamlit -protobuf==5.27.4 +protobuf==5.28.2 # via streamlit pyarrow==17.0.0 # via streamlit @@ -96,7 +96,7 @@ pygments==2.18.0 # rich python-dateutil==2.9.0.post0 # via pandas -pytz==2024.1 +pytz==2024.2 # via pandas referencing==0.35.1 # via @@ -107,7 +107,7 @@ requests==2.32.3 # via # -c requirements/../requirements.txt # streamlit -rich==13.8.0 +rich==13.8.1 # via # -c requirements/../requirements.txt # streamlit @@ -137,7 +137,7 @@ typing-extensions==4.12.2 # streamlit tzdata==2024.1 # via pandas -urllib3==2.2.2 +urllib3==2.2.3 # via # -c requirements/../requirements.txt # requests diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index deb14acb1..f0255349d 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -8,9 +8,9 @@ alabaster==0.7.16 # via sphinx babel==2.16.0 # via sphinx -build==1.2.1 +build==1.2.2 # via pip-tools -certifi==2024.7.4 +certifi==2024.8.30 # via # -c requirements/../requirements.txt # requests @@ -43,15 +43,15 @@ docutils==0.20.1 # via # sphinx # sphinx-rtd-theme -filelock==3.15.4 +filelock==3.16.1 # via # -c requirements/../requirements.txt # virtualenv fonttools==4.53.1 # via matplotlib -identify==2.6.0 +identify==2.6.1 # via pre-commit -idna==3.8 +idna==3.10 # via # -c requirements/../requirements.txt # requests @@ -65,7 +65,7 @@ jinja2==3.1.4 # via # -c requirements/../requirements.txt # sphinx -kiwisolver==1.4.5 +kiwisolver==1.4.7 # via matplotlib lox==0.12.0 # via -r requirements/requirements-dev.in @@ -100,7 +100,7 @@ packaging==24.1 # matplotlib # pytest # sphinx -pandas==2.2.2 +pandas==2.2.3 # via -r requirements/requirements-dev.in pathos==0.3.2 # via lox @@ -110,7 +110,7 @@ pillow==10.4.0 # matplotlib pip-tools==7.4.1 # via -r requirements/requirements-dev.in -platformdirs==4.2.2 +platformdirs==4.3.6 # via virtualenv pluggy==1.5.0 # via pytest @@ -131,13 +131,13 @@ pyproject-hooks==1.1.0 # via # build # pip-tools -pytest==8.3.2 +pytest==8.3.3 # via -r requirements/requirements-dev.in python-dateutil==2.9.0.post0 # via # matplotlib # pandas -pytz==2024.1 +pytz==2024.2 # via pandas pyyaml==6.0.2 # via @@ -147,7 +147,7 @@ requests==2.32.3 # via # -c requirements/../requirements.txt # sphinx -rich==13.8.0 +rich==13.8.1 # via # -c requirements/../requirements.txt # typer @@ -187,11 +187,11 @@ typing-extensions==4.12.2 # typer tzdata==2024.1 # via pandas -urllib3==2.2.2 +urllib3==2.2.3 # via # -c requirements/../requirements.txt # requests -virtualenv==20.26.3 +virtualenv==20.26.5 # via pre-commit wheel==0.44.0 # via pip-tools diff --git a/requirements/requirements-help.txt b/requirements/requirements-help.txt index 85d24d267..dd985a2c5 100644 --- a/requirements/requirements-help.txt +++ b/requirements/requirements-help.txt @@ -21,7 +21,7 @@ annotated-types==0.7.0 # via # -c requirements/../requirements.txt # pydantic -anyio==4.4.0 +anyio==4.6.0 # via # -c requirements/../requirements.txt # httpx @@ -29,7 +29,7 @@ attrs==24.2.0 # via # -c requirements/../requirements.txt # aiohttp -certifi==2024.7.4 +certifi==2024.8.30 # via # -c requirements/../requirements.txt # httpcore @@ -49,7 +49,7 @@ deprecated==1.2.14 # via llama-index-core dirtyjson==1.0.8 # via llama-index-core -filelock==3.15.4 +filelock==3.16.1 # via # -c requirements/../requirements.txt # huggingface-hub @@ -60,13 +60,13 @@ frozenlist==1.4.1 # -c requirements/../requirements.txt # aiohttp # aiosignal -fsspec==2024.6.1 +fsspec==2024.9.0 # via # -c requirements/../requirements.txt # huggingface-hub # llama-index-core # torch -greenlet==3.0.3 +greenlet==3.1.1 # via sqlalchemy h11==0.14.0 # via @@ -80,14 +80,14 @@ httpx==0.27.2 # via # -c requirements/../requirements.txt # llama-index-core -huggingface-hub[inference]==0.24.6 +huggingface-hub[inference]==0.25.0 # via # -c requirements/../requirements.txt # llama-index-embeddings-huggingface # sentence-transformers # tokenizers # transformers -idna==3.8 +idna==3.10 # via # -c requirements/../requirements.txt # anyio @@ -102,7 +102,7 @@ joblib==1.4.2 # via # nltk # scikit-learn -llama-index-core==0.11.2 +llama-index-core==0.11.11 # via # -r requirements/requirements-help.in # llama-index-embeddings-huggingface @@ -118,7 +118,7 @@ minijinja==2.2.0 # via huggingface-hub mpmath==1.3.0 # via sympy -multidict==6.0.5 +multidict==6.1.0 # via # -c requirements/../requirements.txt # aiohttp @@ -140,7 +140,6 @@ numpy==1.26.4 # llama-index-core # scikit-learn # scipy - # sentence-transformers # transformers packaging==24.1 # via @@ -153,11 +152,11 @@ pillow==10.4.0 # -c requirements/../requirements.txt # llama-index-core # sentence-transformers -pydantic==2.8.2 +pydantic==2.9.2 # via # -c requirements/../requirements.txt # llama-index-core -pydantic-core==2.20.1 +pydantic-core==2.23.4 # via # -c requirements/../requirements.txt # pydantic @@ -167,7 +166,7 @@ pyyaml==6.0.2 # huggingface-hub # llama-index-core # transformers -regex==2024.7.24 +regex==2024.9.11 # via # -c requirements/../requirements.txt # nltk @@ -180,27 +179,27 @@ requests==2.32.3 # llama-index-core # tiktoken # transformers -safetensors==0.4.4 +safetensors==0.4.5 # via transformers -scikit-learn==1.5.1 +scikit-learn==1.5.2 # via sentence-transformers scipy==1.13.1 # via # -c requirements/../requirements.txt # scikit-learn # sentence-transformers -sentence-transformers==3.0.1 +sentence-transformers==3.1.1 # via llama-index-embeddings-huggingface sniffio==1.3.1 # via # -c requirements/../requirements.txt # anyio # httpx -sqlalchemy[asyncio]==2.0.32 +sqlalchemy[asyncio]==2.0.35 # via # llama-index-core # sqlalchemy -sympy==1.13.2 +sympy==1.13.3 # via torch tenacity==8.5.0 # via llama-index-core @@ -240,7 +239,7 @@ typing-inspect==0.9.0 # via # dataclasses-json # llama-index-core -urllib3==2.2.2 +urllib3==2.2.3 # via # -c requirements/../requirements.txt # requests @@ -248,7 +247,7 @@ wrapt==1.16.0 # via # deprecated # llama-index-core -yarl==1.9.4 +yarl==1.11.1 # via # -c requirements/../requirements.txt # aiohttp diff --git a/requirements/requirements-playwright.txt b/requirements/requirements-playwright.txt index 739bd2dae..a338e70f4 100644 --- a/requirements/requirements-playwright.txt +++ b/requirements/requirements-playwright.txt @@ -6,9 +6,9 @@ # greenlet==3.0.3 # via playwright -playwright==1.46.0 +playwright==1.47.0 # via -r requirements/requirements-playwright.in -pyee==11.1.0 +pyee==12.0.0 # via playwright typing-extensions==4.12.2 # via From cf5636941098ed0d60d2d77e5296229860ce9616 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 13:38:42 -0700 Subject: [PATCH 052/149] version bump to 0.57.0 --- aider/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/__init__.py b/aider/__init__.py index 44656e63e..ca2e5bc7c 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -1,6 +1,6 @@ try: from aider.__version__ import __version__ except Exception: - __version__ = "0.56.1.dev" + __version__ = "0.57.0" __all__ = [__version__] From 6408a9fbf9e14d2504846c87f147915331539369 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 13:39:55 -0700 Subject: [PATCH 053/149] set version to 0.57.1.dev --- aider/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/__init__.py b/aider/__init__.py index ca2e5bc7c..a14de5329 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -1,6 +1,6 @@ try: from aider.__version__ import __version__ except Exception: - __version__ = "0.57.0" + __version__ = "0.57.1.dev" __all__ = [__version__] From 4a9700fcd9158817eb801d5299cfed7ffff2ada3 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 13:55:49 -0700 Subject: [PATCH 054/149] feat: add ModelSettings for plain "deepseek-coder" and "deepseek-chat" --- aider/models.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/aider/models.py b/aider/models.py index 8a6216d24..2b35e6bc3 100644 --- a/aider/models.py +++ b/aider/models.py @@ -412,6 +412,23 @@ MODEL_SETTINGS = [ caches_by_default=True, max_tokens=8192, ), + ModelSettings( + "deepseek-chat", + "diff", + use_repo_map=True, + examples_as_sys_msg=True, + reminder="sys", + max_tokens=8192, + ), + ModelSettings( + "deepseek-coder", + "diff", + use_repo_map=True, + examples_as_sys_msg=True, + reminder="sys", + caches_by_default=True, + max_tokens=8192, + ), ModelSettings( "openrouter/deepseek/deepseek-coder", "diff", From 925560ac1fd96f195af371e83a68e75d91e82f44 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 13:56:32 -0700 Subject: [PATCH 055/149] feat: switch --deepseek to use model "deepseek-coder" --- aider/args.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/args.py b/aider/args.py index b67aeb43a..c771dcfee 100644 --- a/aider/args.py +++ b/aider/args.py @@ -109,7 +109,7 @@ def get_parser(default_config_files, git_root): const=gpt_3_model_name, help=f"Use {gpt_3_model_name} model for the main chat", ) - deepseek_model = "deepseek/deepseek-coder" + deepseek_model = "deepseek-coder" group.add_argument( "--deepseek", action="store_const", From ced3336176e6fdec3cd2eaf81821c0c130182680 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 13:55:34 -0700 Subject: [PATCH 056/149] updated blame data --- aider/website/_data/blame.yml | 69 +++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/aider/website/_data/blame.yml b/aider/website/_data/blame.yml index 2b702a3ad..5d3cd06cf 100644 --- a/aider/website/_data/blame.yml +++ b/aider/website/_data/blame.yml @@ -2531,3 +2531,72 @@ fry69: 15 start_tag: v0.55.0 total_lines: 277 +- aider_percentage: 69.98 + aider_total: 394 + end_date: '2024-09-21' + end_tag: v0.57.0 + file_counts: + aider/__init__.py: + Paul Gauthier: 1 + aider/args_formatter.py: + Paul Gauthier: 4 + Paul Gauthier (aider): 1 + aider/coders/base_coder.py: + Krazer: 1 + Paul Gauthier: 17 + Paul Gauthier (aider): 2 + aider/coders/chat_chunks.py: + Paul Gauthier: 5 + aider/coders/editblock_coder.py: + Paul Gauthier (aider): 27 + aider/commands.py: + Krazer: 3 + Paul Gauthier: 1 + Paul Gauthier (aider): 34 + aider/io.py: + Krazer: 27 + Paul Gauthier: 8 + Paul Gauthier (aider): 42 + aider/main.py: + Krazer: 2 + Paul Gauthier: 5 + Paul Gauthier (aider): 8 + aider/models.py: + Jay Alammar: 1 + Jay Alammar (aider): 13 + Paul Gauthier: 43 + Paul Gauthier (aider): 46 + aider/repo.py: + Paul Gauthier: 3 + aider/run_cmd.py: + Paul Gauthier: 8 + Paul Gauthier (aider): 33 + aider/sendchat.py: + Paul Gauthier: 3 + aider/utils.py: + Paul Gauthier: 2 + benchmark/benchmark.py: + Paul Gauthier: 4 + scripts/issues.py: + Paul Gauthier: 10 + Paul Gauthier (aider): 123 + scripts/versionbump.py: + Paul Gauthier (aider): 8 + tests/basic/test_coder.py: + Paul Gauthier: 1 + tests/basic/test_editblock.py: + Christian Clauss: 2 + tests/basic/test_io.py: + Paul Gauthier (aider): 37 + tests/basic/test_main.py: + Paul Gauthier: 18 + Paul Gauthier (aider): 20 + grand_total: + Christian Clauss: 2 + Jay Alammar: 1 + Jay Alammar (aider): 13 + Krazer: 33 + Paul Gauthier: 133 + Paul Gauthier (aider): 381 + start_tag: v0.56.0 + total_lines: 563 From c234df0ff115cd6030aaedcfaad69596a998bdf2 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 13:55:37 -0700 Subject: [PATCH 057/149] copy --- aider/website/assets/sample.aider.conf.yml | 2 +- aider/website/assets/sample.env | 2 +- aider/website/docs/config/aider_conf.md | 2 +- aider/website/docs/config/dotenv.md | 2 +- aider/website/docs/config/options.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aider/website/assets/sample.aider.conf.yml b/aider/website/assets/sample.aider.conf.yml index 9b9b46077..f738752ae 100644 --- a/aider/website/assets/sample.aider.conf.yml +++ b/aider/website/assets/sample.aider.conf.yml @@ -47,7 +47,7 @@ ## Use gpt-3.5-turbo model for the main chat #35turbo: false -## Use deepseek/deepseek-coder model for the main chat +## Use deepseek-coder model for the main chat #deepseek: false ################# diff --git a/aider/website/assets/sample.env b/aider/website/assets/sample.env index fb122c026..574f61c43 100644 --- a/aider/website/assets/sample.env +++ b/aider/website/assets/sample.env @@ -51,7 +51,7 @@ ## Use gpt-3.5-turbo model for the main chat #AIDER_35TURBO= -## Use deepseek/deepseek-coder model for the main chat +## Use deepseek-coder model for the main chat #AIDER_DEEPSEEK= ################# diff --git a/aider/website/docs/config/aider_conf.md b/aider/website/docs/config/aider_conf.md index d906e11bd..38edfc6e2 100644 --- a/aider/website/docs/config/aider_conf.md +++ b/aider/website/docs/config/aider_conf.md @@ -95,7 +95,7 @@ cog.outl("```") ## Use gpt-3.5-turbo model for the main chat #35turbo: false -## Use deepseek/deepseek-coder model for the main chat +## Use deepseek-coder model for the main chat #deepseek: false ################# diff --git a/aider/website/docs/config/dotenv.md b/aider/website/docs/config/dotenv.md index 21c3b4619..8dda10565 100644 --- a/aider/website/docs/config/dotenv.md +++ b/aider/website/docs/config/dotenv.md @@ -93,7 +93,7 @@ cog.outl("```") ## Use gpt-3.5-turbo model for the main chat #AIDER_35TURBO= -## Use deepseek/deepseek-coder model for the main chat +## Use deepseek-coder model for the main chat #AIDER_DEEPSEEK= ################# diff --git a/aider/website/docs/config/options.md b/aider/website/docs/config/options.md index 779441677..d617afb2c 100644 --- a/aider/website/docs/config/options.md +++ b/aider/website/docs/config/options.md @@ -126,7 +126,7 @@ Aliases: - `-3` ### `--deepseek` -Use deepseek/deepseek-coder model for the main chat +Use deepseek-coder model for the main chat Environment variable: `AIDER_DEEPSEEK` ## Model Settings: From 5d80e11e5b6ed6b9c0533c5f15b8454b40acd3ca Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 13:59:50 -0700 Subject: [PATCH 058/149] feat: Add Docker full image build to CI workflow --- .github/workflows/docker-build-test.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-test.yml b/.github/workflows/docker-build-test.yml index e171584ba..edb0f3108 100644 --- a/.github/workflows/docker-build-test.yml +++ b/.github/workflows/docker-build-test.yml @@ -39,10 +39,20 @@ jobs: dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} if: ${{ env.dockerhub_username }} && ${{ env.dockerhub_password }} - - name: Build Docker image + - name: Build Docker standard image uses: docker/build-push-action@v5 with: context: . file: ./docker/Dockerfile platforms: linux/amd64,linux/arm64 push: false + target: aider + + - name: Build Docker full image + uses: docker/build-push-action@v5 + with: + context: . + file: ./docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: false + target: aider-full From 237002f941fede2aec99ce2a1a8669ed4d913a48 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 15:57:41 -0700 Subject: [PATCH 059/149] fix: Resolve version conflict between requirements-help and requirements-playwright for greenlet --- requirements/requirements-help.in | 2 ++ requirements/requirements-help.txt | 6 ++++-- requirements/requirements-playwright.in | 3 +++ requirements/requirements-playwright.txt | 4 +++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/requirements/requirements-help.in b/requirements/requirements-help.in index 8b10df15f..c865a6a3f 100644 --- a/requirements/requirements-help.in +++ b/requirements/requirements-help.in @@ -6,3 +6,5 @@ llama-index-core llama-index-embeddings-huggingface +# requirement-help and requirements-playwright choose different versions +greenlet==3.0.3 diff --git a/requirements/requirements-help.txt b/requirements/requirements-help.txt index dd985a2c5..a6111d608 100644 --- a/requirements/requirements-help.txt +++ b/requirements/requirements-help.txt @@ -66,8 +66,10 @@ fsspec==2024.9.0 # huggingface-hub # llama-index-core # torch -greenlet==3.1.1 - # via sqlalchemy +greenlet==3.0.3 + # via + # -r requirements/requirements-help.in + # sqlalchemy h11==0.14.0 # via # -c requirements/../requirements.txt diff --git a/requirements/requirements-playwright.in b/requirements/requirements-playwright.in index 09c9ecee6..fd88b61e2 100644 --- a/requirements/requirements-playwright.in +++ b/requirements/requirements-playwright.in @@ -1,3 +1,6 @@ -c ../requirements.txt playwright + +# requirement-help and requirements-playwright choose different versions +greenlet==3.0.3 diff --git a/requirements/requirements-playwright.txt b/requirements/requirements-playwright.txt index a338e70f4..0d92718fd 100644 --- a/requirements/requirements-playwright.txt +++ b/requirements/requirements-playwright.txt @@ -5,7 +5,9 @@ # pip-compile --output-file=requirements/requirements-playwright.txt requirements/requirements-playwright.in # greenlet==3.0.3 - # via playwright + # via + # -r requirements/requirements-playwright.in + # playwright playwright==1.47.0 # via -r requirements/requirements-playwright.in pyee==12.0.0 From 10fee78dddcb5350ddef61cb5ab792b435595433 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 16:04:26 -0700 Subject: [PATCH 060/149] feat: Add progress bar while collecting the groups --- scripts/issues.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/issues.py b/scripts/issues.py index afc7ce9e5..bdef877b7 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -4,6 +4,7 @@ import os import re from collections import defaultdict from datetime import datetime +from tqdm import tqdm import requests from dotenv import load_dotenv @@ -94,7 +95,8 @@ def main(): open_issues = [issue for issue in all_issues if issue["state"] == "open"] grouped_open_issues = group_issues_by_subject(open_issues) - for subject, issues in grouped_open_issues.items(): + print("Analyzing issues...") + for subject, issues in tqdm(grouped_open_issues.items(), desc="Processing issue groups"): oldest_issue = find_oldest_issue(subject, all_issues) if not oldest_issue: continue @@ -122,7 +124,7 @@ def main(): continue # Comment and close duplicate issues - for issue in issues: + for issue in tqdm(issues, desc="Closing duplicate issues"): if issue["number"] != oldest_issue["number"]: comment_and_close_duplicate(issue, oldest_issue) From de87418647dd69ed6d4c0ed6c47542dcf7ee81c4 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 16:05:16 -0700 Subject: [PATCH 061/149] feat: add progress bar while collecting issues --- scripts/issues.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/issues.py b/scripts/issues.py index bdef877b7..7d9bc24dd 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -24,18 +24,20 @@ headers = {"Authorization": f"token {TOKEN}", "Accept": "application/vnd.github. def get_issues(state="open"): issues = [] page = 1 - while True: - response = requests.get( - f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues", - headers=headers, - params={"state": state, "page": page, "per_page": 100}, - ) - response.raise_for_status() - page_issues = response.json() - if not page_issues: - break - issues.extend(page_issues) - page += 1 + with tqdm(desc="Collecting issues", unit="page") as pbar: + while True: + response = requests.get( + f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues", + headers=headers, + params={"state": state, "page": page, "per_page": 100}, + ) + response.raise_for_status() + page_issues = response.json() + if not page_issues: + break + issues.extend(page_issues) + page += 1 + pbar.update(1) return issues From 5606791df2e0e9b9d43cc708d943c1b7baab7a58 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 16:05:19 -0700 Subject: [PATCH 062/149] style: Fix import order in scripts/issues.py --- scripts/issues.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/issues.py b/scripts/issues.py index 7d9bc24dd..00a2a8ffe 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -4,10 +4,10 @@ import os import re from collections import defaultdict from datetime import datetime -from tqdm import tqdm import requests from dotenv import load_dotenv +from tqdm import tqdm # Load environment variables from .env file load_dotenv() From 26dcdcc1d2242a8b8460a6f3f8c53e69aa74fc46 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 16:05:55 -0700 Subject: [PATCH 063/149] feat: add total page count to progress bar in get_issues function --- scripts/issues.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/issues.py b/scripts/issues.py index 00a2a8ffe..27bd64c34 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -24,12 +24,24 @@ headers = {"Authorization": f"token {TOKEN}", "Accept": "application/vnd.github. def get_issues(state="open"): issues = [] page = 1 - with tqdm(desc="Collecting issues", unit="page") as pbar: + per_page = 100 + + # First, get the total count of issues + response = requests.get( + f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues", + headers=headers, + params={"state": state, "per_page": 1}, + ) + response.raise_for_status() + total_count = int(response.headers.get('Link', '').split('page=')[-1].split('>')[0]) + total_pages = (total_count + per_page - 1) // per_page + + with tqdm(total=total_pages, desc="Collecting issues", unit="page") as pbar: while True: response = requests.get( f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues", headers=headers, - params={"state": state, "page": page, "per_page": 100}, + params={"state": state, "page": page, "per_page": per_page}, ) response.raise_for_status() page_issues = response.json() From 8cc747da3aebbb67cc6691262ee1ac518dc51c4c Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 16:05:59 -0700 Subject: [PATCH 064/149] style: Fix linting issues in scripts/issues.py --- scripts/issues.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/issues.py b/scripts/issues.py index 27bd64c34..d5467c3ee 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -33,7 +33,7 @@ def get_issues(state="open"): params={"state": state, "per_page": 1}, ) response.raise_for_status() - total_count = int(response.headers.get('Link', '').split('page=')[-1].split('>')[0]) + total_count = int(response.headers.get("Link", "").split("page=")[-1].split(">")[0]) total_pages = (total_count + per_page - 1) // per_page with tqdm(total=total_pages, desc="Collecting issues", unit="page") as pbar: From aca60a9127de134ff10d3635abc8eed89818f414 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 16:26:45 -0700 Subject: [PATCH 065/149] no tqdm for groups --- scripts/issues.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/issues.py b/scripts/issues.py index d5467c3ee..2dd8c8834 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -110,7 +110,7 @@ def main(): grouped_open_issues = group_issues_by_subject(open_issues) print("Analyzing issues...") - for subject, issues in tqdm(grouped_open_issues.items(), desc="Processing issue groups"): + for subject, issues in grouped_open_issues.items(): oldest_issue = find_oldest_issue(subject, all_issues) if not oldest_issue: continue From 7abfd3236bc183e351bc9215e767e70f482fd7b8 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 16:28:03 -0700 Subject: [PATCH 066/149] copy --- HISTORY.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index fbf40778c..d48e27a15 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,10 @@ # Release history +### Aider v0.57.1 + +- Fixed dependency conflict between aider-chat[help] and [playwright]. + ### Aider v0.57.0 - Support for OpenAI o1 models: From 5c7f35f24bb9ea6aebb5f9e34017c4ca3f4c1477 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 16:28:10 -0700 Subject: [PATCH 067/149] copy --- aider/website/HISTORY.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aider/website/HISTORY.md b/aider/website/HISTORY.md index 2af026ae9..b404bd063 100644 --- a/aider/website/HISTORY.md +++ b/aider/website/HISTORY.md @@ -16,6 +16,10 @@ cog.out(text) # Release history +### Aider v0.57.1 + +- Fixed dependency conflict between aider-chat[help] and [playwright]. + ### Aider v0.57.0 - Support for OpenAI o1 models: From dced6c805246e006d545ffd148314fdfae4edd7d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 17:06:11 -0700 Subject: [PATCH 068/149] Revert "feat: switch --deepseek to use model "deepseek-coder"" This reverts commit 925560ac1fd96f195af371e83a68e75d91e82f44. --- aider/args.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/args.py b/aider/args.py index c771dcfee..b67aeb43a 100644 --- a/aider/args.py +++ b/aider/args.py @@ -109,7 +109,7 @@ def get_parser(default_config_files, git_root): const=gpt_3_model_name, help=f"Use {gpt_3_model_name} model for the main chat", ) - deepseek_model = "deepseek-coder" + deepseek_model = "deepseek/deepseek-coder" group.add_argument( "--deepseek", action="store_const", From 739bd07c041da81c69f699906427fa0a3214e811 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 17:06:31 -0700 Subject: [PATCH 069/149] copy --- aider/website/assets/sample.aider.conf.yml | 2 +- aider/website/assets/sample.env | 2 +- aider/website/docs/config/aider_conf.md | 2 +- aider/website/docs/config/dotenv.md | 2 +- aider/website/docs/config/options.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aider/website/assets/sample.aider.conf.yml b/aider/website/assets/sample.aider.conf.yml index f738752ae..9b9b46077 100644 --- a/aider/website/assets/sample.aider.conf.yml +++ b/aider/website/assets/sample.aider.conf.yml @@ -47,7 +47,7 @@ ## Use gpt-3.5-turbo model for the main chat #35turbo: false -## Use deepseek-coder model for the main chat +## Use deepseek/deepseek-coder model for the main chat #deepseek: false ################# diff --git a/aider/website/assets/sample.env b/aider/website/assets/sample.env index 574f61c43..fb122c026 100644 --- a/aider/website/assets/sample.env +++ b/aider/website/assets/sample.env @@ -51,7 +51,7 @@ ## Use gpt-3.5-turbo model for the main chat #AIDER_35TURBO= -## Use deepseek-coder model for the main chat +## Use deepseek/deepseek-coder model for the main chat #AIDER_DEEPSEEK= ################# diff --git a/aider/website/docs/config/aider_conf.md b/aider/website/docs/config/aider_conf.md index 38edfc6e2..d906e11bd 100644 --- a/aider/website/docs/config/aider_conf.md +++ b/aider/website/docs/config/aider_conf.md @@ -95,7 +95,7 @@ cog.outl("```") ## Use gpt-3.5-turbo model for the main chat #35turbo: false -## Use deepseek-coder model for the main chat +## Use deepseek/deepseek-coder model for the main chat #deepseek: false ################# diff --git a/aider/website/docs/config/dotenv.md b/aider/website/docs/config/dotenv.md index 8dda10565..21c3b4619 100644 --- a/aider/website/docs/config/dotenv.md +++ b/aider/website/docs/config/dotenv.md @@ -93,7 +93,7 @@ cog.outl("```") ## Use gpt-3.5-turbo model for the main chat #AIDER_35TURBO= -## Use deepseek-coder model for the main chat +## Use deepseek/deepseek-coder model for the main chat #AIDER_DEEPSEEK= ################# diff --git a/aider/website/docs/config/options.md b/aider/website/docs/config/options.md index d617afb2c..779441677 100644 --- a/aider/website/docs/config/options.md +++ b/aider/website/docs/config/options.md @@ -126,7 +126,7 @@ Aliases: - `-3` ### `--deepseek` -Use deepseek-coder model for the main chat +Use deepseek/deepseek-coder model for the main chat Environment variable: `AIDER_DEEPSEEK` ## Model Settings: From 7f156830fe672002605474e7cb06ef319d30d4bc Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 17:09:08 -0700 Subject: [PATCH 070/149] Handle TypeError coming from git ops --- aider/repo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/repo.py b/aider/repo.py index 87fd2fbfb..b90b946cb 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -10,7 +10,7 @@ from aider.sendchat import simple_send_with_retries from .dump import dump # noqa: F401 -ANY_GIT_ERROR = (git.exc.ODBError, git.exc.GitError, OSError, IndexError, BufferError) +ANY_GIT_ERROR = (git.exc.ODBError, git.exc.GitError, OSError, IndexError, BufferError, TypeError) class GitRepo: From bd398525e0e8b971d6a7ebd19028f27ce3331528 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 18:27:31 -0700 Subject: [PATCH 071/149] version bump to 0.57.1 --- aider/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/__init__.py b/aider/__init__.py index a14de5329..07597c530 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -1,6 +1,6 @@ try: from aider.__version__ import __version__ except Exception: - __version__ = "0.57.1.dev" + __version__ = "0.57.1" __all__ = [__version__] From f3ad683d706c1fe5aecf5cae7ea584f5884d4d90 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 18:28:55 -0700 Subject: [PATCH 072/149] set version to 0.57.2.dev --- aider/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/__init__.py b/aider/__init__.py index 07597c530..bbeeafcfc 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -1,6 +1,6 @@ try: from aider.__version__ import __version__ except Exception: - __version__ = "0.57.1" + __version__ = "0.57.2.dev" __all__ = [__version__] From b4fdb72a3aeda7787964566c5f3a5e31565817a9 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 18:30:35 -0700 Subject: [PATCH 073/149] fix: Only print Oldest issue #{oldest_issue['number']} left open if it is open --- scripts/issues.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/issues.py b/scripts/issues.py index 2dd8c8834..74b929bda 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -142,7 +142,8 @@ def main(): if issue["number"] != oldest_issue["number"]: comment_and_close_duplicate(issue, oldest_issue) - print(f"Oldest issue #{oldest_issue['number']} left open") + if oldest_issue['state'] == 'open': + print(f"Oldest issue #{oldest_issue['number']} left open") if __name__ == "__main__": From 6731815251386ab57e432d4a72fbe8a9bd9bd00c Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 18:30:39 -0700 Subject: [PATCH 074/149] style: Fix formatting in issues.py --- scripts/issues.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/issues.py b/scripts/issues.py index 74b929bda..2d5345c34 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -142,7 +142,7 @@ def main(): if issue["number"] != oldest_issue["number"]: comment_and_close_duplicate(issue, oldest_issue) - if oldest_issue['state'] == 'open': + if oldest_issue["state"] == "open": print(f"Oldest issue #{oldest_issue['number']} left open") From 26f9a1032440602497d2b7d64bf94fe754456507 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 18:36:33 -0700 Subject: [PATCH 075/149] fix: Add greeting to comment when closing duplicate issue --- scripts/issues.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/issues.py b/scripts/issues.py index 2d5345c34..c4d0f8589 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -84,6 +84,7 @@ def comment_and_close_duplicate(issue, oldest_issue): close_url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue['number']}" comment_body = ( + "Thanks for trying aider and filing this issue.\n\n" f"This looks like a duplicate of #{oldest_issue['number']}, so I'm going to close it so" " discussion can happen there. Please let me know if you think it's actually a distinct" " issue." From 0101ae76d17a42531bb77f0a4a92813a92ac1634 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 18:37:59 -0700 Subject: [PATCH 076/149] refactor: Move comment_body to a global multiline string --- scripts/issues.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/issues.py b/scripts/issues.py index c4d0f8589..89f7bfaad 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -12,6 +12,10 @@ from tqdm import tqdm # Load environment variables from .env file load_dotenv() +DUPLICATE_COMMENT = """Thanks for trying aider and filing this issue. + +This looks like a duplicate of #{oldest_issue_number}, so I'm going to close it so discussion can happen there. Please let me know if you think it's actually a distinct issue.""" + # GitHub API configuration GITHUB_API_URL = "https://api.github.com" REPO_OWNER = "paul-gauthier" @@ -83,12 +87,7 @@ def comment_and_close_duplicate(issue, oldest_issue): ) close_url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue['number']}" - comment_body = ( - "Thanks for trying aider and filing this issue.\n\n" - f"This looks like a duplicate of #{oldest_issue['number']}, so I'm going to close it so" - " discussion can happen there. Please let me know if you think it's actually a distinct" - " issue." - ) + comment_body = DUPLICATE_COMMENT.format(oldest_issue_number=oldest_issue['number']) # Post comment response = requests.post(comment_url, headers=headers, json={"body": comment_body}) From eff9325f2be6bb097b4c9a2dcbde030d57cd126c Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 18:38:03 -0700 Subject: [PATCH 077/149] style: Fix formatting in issue comment --- scripts/issues.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/issues.py b/scripts/issues.py index 89f7bfaad..657d56ec0 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -87,7 +87,7 @@ def comment_and_close_duplicate(issue, oldest_issue): ) close_url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue['number']}" - comment_body = DUPLICATE_COMMENT.format(oldest_issue_number=oldest_issue['number']) + comment_body = DUPLICATE_COMMENT.format(oldest_issue_number=oldest_issue["number"]) # Post comment response = requests.post(comment_url, headers=headers, json={"body": comment_body}) From a77c8ccfa9f9852612c5644eb25dcadc97ab9569 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 18:43:02 -0700 Subject: [PATCH 078/149] copy --- scripts/issues.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/issues.py b/scripts/issues.py index 657d56ec0..fad0fd7f0 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -14,7 +14,9 @@ load_dotenv() DUPLICATE_COMMENT = """Thanks for trying aider and filing this issue. -This looks like a duplicate of #{oldest_issue_number}, so I'm going to close it so discussion can happen there. Please let me know if you think it's actually a distinct issue.""" +This looks like a duplicate of #{oldest_issue_number}. Please see the comments there for more information, and feel free to continue the discussion within that issue. + +I'm going to close this issue for now. But please let me know if you think this is actually a distinct issue and I will reopen this issue.""" # noqa # GitHub API configuration GITHUB_API_URL = "https://api.github.com" From 3dfc63ce79560f07586d1d6a394153c7222dab4c Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 18:46:21 -0700 Subject: [PATCH 079/149] feat: Add support for following redirects in httpx-based scraping --- aider/scrape.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/scrape.py b/aider/scrape.py index 317d3f011..72e2c7ed9 100755 --- a/aider/scrape.py +++ b/aider/scrape.py @@ -185,7 +185,7 @@ class Scraper: headers = {"User-Agent": f"Mozilla./5.0 ({aider_user_agent})"} try: - with httpx.Client(headers=headers, verify=self.verify_ssl) as client: + with httpx.Client(headers=headers, verify=self.verify_ssl, follow_redirects=True) as client: response = client.get(url) response.raise_for_status() return response.text, response.headers.get("content-type", "").split(";")[0] From 3a96a10d06e745dfc13376fce1f6e8bfe557dc8a Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 18:46:24 -0700 Subject: [PATCH 080/149] style: Format code with black --- aider/scrape.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/scrape.py b/aider/scrape.py index 72e2c7ed9..7977a8548 100755 --- a/aider/scrape.py +++ b/aider/scrape.py @@ -185,7 +185,9 @@ class Scraper: headers = {"User-Agent": f"Mozilla./5.0 ({aider_user_agent})"} try: - with httpx.Client(headers=headers, verify=self.verify_ssl, follow_redirects=True) as client: + with httpx.Client( + headers=headers, verify=self.verify_ssl, follow_redirects=True + ) as client: response = client.get(url) response.raise_for_status() return response.text, response.headers.get("content-type", "").split(";")[0] From 212e22b2b77d60128bd17c781f95892e4c6cc951 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 18:55:24 -0700 Subject: [PATCH 081/149] fix: Handle file read errors in linter --- aider/linter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aider/linter.py b/aider/linter.py index fe30d0c08..caee4394c 100644 --- a/aider/linter.py +++ b/aider/linter.py @@ -83,7 +83,11 @@ class Linter: def lint(self, fname, cmd=None): rel_fname = self.get_rel_fname(fname) - code = Path(fname).read_text(encoding=self.encoding, errors="replace") + try: + code = Path(fname).read_text(encoding=self.encoding, errors="replace") + except OSError as err: + print(f"Unable to read {fname}: {err}") + return if cmd: cmd = cmd.strip() From 07a95deabaada8be9e63ba78c356586e333c0d46 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 18:58:43 -0700 Subject: [PATCH 082/149] fix: Use args.encoding when loading .env files --- aider/main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aider/main.py b/aider/main.py index e925d6bbc..58e42c2b4 100644 --- a/aider/main.py +++ b/aider/main.py @@ -266,7 +266,7 @@ def register_models(git_root, model_settings_fname, io, verbose=False): return None -def load_dotenv_files(git_root, dotenv_fname): +def load_dotenv_files(git_root, dotenv_fname, encoding): dotenv_files = generate_search_path_list( ".env", git_root, @@ -275,8 +275,11 @@ def load_dotenv_files(git_root, dotenv_fname): loaded = [] for fname in dotenv_files: if Path(fname).exists(): - loaded.append(fname) - load_dotenv(fname, override=True) + try: + load_dotenv(fname, override=True, encoding=encoding, errors='ignore') + loaded.append(fname) + except Exception as e: + print(f"Error loading {fname}: {e}") return loaded @@ -364,7 +367,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F args, unknown = parser.parse_known_args(argv) # Load the .env file specified in the arguments - loaded_dotenvs = load_dotenv_files(git_root, args.env_file) + loaded_dotenvs = load_dotenv_files(git_root, args.env_file, args.encoding) # Parse again to include any arguments that might have been defined in .env args = parser.parse_args(argv) From 516a3a6647abaf1dac85cdce5162a5c39d3cacd6 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 18:58:48 -0700 Subject: [PATCH 083/149] style: Fix formatting in `load_dotenv_files` function --- aider/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/main.py b/aider/main.py index 58e42c2b4..b6779acb2 100644 --- a/aider/main.py +++ b/aider/main.py @@ -276,7 +276,7 @@ def load_dotenv_files(git_root, dotenv_fname, encoding): for fname in dotenv_files: if Path(fname).exists(): try: - load_dotenv(fname, override=True, encoding=encoding, errors='ignore') + load_dotenv(fname, override=True, encoding=encoding, errors="ignore") loaded.append(fname) except Exception as e: print(f"Error loading {fname}: {e}") From 2314179b839a1d1a382d87a67caba3eb1c1f0da7 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 19:01:24 -0700 Subject: [PATCH 084/149] fix: Add default encoding to load_dotenv_files function --- aider/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/main.py b/aider/main.py index b6779acb2..e62a782e7 100644 --- a/aider/main.py +++ b/aider/main.py @@ -266,7 +266,7 @@ def register_models(git_root, model_settings_fname, io, verbose=False): return None -def load_dotenv_files(git_root, dotenv_fname, encoding): +def load_dotenv_files(git_root, dotenv_fname, encoding="utf-8"): dotenv_files = generate_search_path_list( ".env", git_root, @@ -276,7 +276,7 @@ def load_dotenv_files(git_root, dotenv_fname, encoding): for fname in dotenv_files: if Path(fname).exists(): try: - load_dotenv(fname, override=True, encoding=encoding, errors="ignore") + load_dotenv(fname, override=True, encoding=encoding) loaded.append(fname) except Exception as e: print(f"Error loading {fname}: {e}") From 12f1bf643a7b2176eb10e5c2f939c785e83f5ba5 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 19:02:35 -0700 Subject: [PATCH 085/149] fix: Add ValueError to ANY_GIT_ERROR tuple --- aider/repo.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/aider/repo.py b/aider/repo.py index b90b946cb..b0ff1dd91 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -10,7 +10,15 @@ from aider.sendchat import simple_send_with_retries from .dump import dump # noqa: F401 -ANY_GIT_ERROR = (git.exc.ODBError, git.exc.GitError, OSError, IndexError, BufferError, TypeError) +ANY_GIT_ERROR = ( + git.exc.ODBError, + git.exc.GitError, + OSError, + IndexError, + BufferError, + TypeError, + ValueError, +) class GitRepo: From edf8fc632724f19c75f0c13723041059d793a9db Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 21 Sep 2024 19:06:08 -0700 Subject: [PATCH 086/149] fix: Remove progress bar when closing duplicate issues --- scripts/issues.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/issues.py b/scripts/issues.py index fad0fd7f0..82763e3a1 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -140,7 +140,7 @@ def main(): continue # Comment and close duplicate issues - for issue in tqdm(issues, desc="Closing duplicate issues"): + for issue in issues: if issue["number"] != oldest_issue["number"]: comment_and_close_duplicate(issue, oldest_issue) From a91d3fed01b4b06ceed907bb392c91c93a28983e Mon Sep 17 00:00:00 2001 From: Stein Martin Hustad Date: Sat, 21 Sep 2024 21:05:51 +0400 Subject: [PATCH 087/149] style: completion menu colors customizable --- aider/args.py | 24 ++++++++++++++++++++++++ aider/io.py | 11 +++++++++++ aider/main.py | 4 ++++ aider/website/assets/sample.env | 12 ++++++++++++ 4 files changed, 51 insertions(+) diff --git a/aider/args.py b/aider/args.py index b67aeb43a..10c606d81 100644 --- a/aider/args.py +++ b/aider/args.py @@ -328,6 +328,30 @@ def get_parser(default_config_files, git_root): default="#0088ff", help="Set the color for assistant output (default: #0088ff)", ) + group.add_argument( + "--completion-menu-color", + metavar="COLOR", + default="default", + help="Set the color for the completion menu (default: terminal's default text color)", + ) + group.add_argument( + "--completion-menu-bg-color", + metavar="COLOR", + default="default", + help="Set the background color for the completion menu (default: terminal's default background color)", + ) + group.add_argument( + "--completion-menu-current-color", + metavar="COLOR", + default="default", + help="Set the color for the current item in the completion menu (default: terminal's default background color)", + ) + group.add_argument( + "--completion-menu-current-bg-color", + metavar="COLOR", + default="default", + help="Set the background color for the current item in the completion menu (default: terminal's default text color)", + ) group.add_argument( "--code-theme", default="default", diff --git a/aider/io.py b/aider/io.py index 4957ee737..5ff9e840e 100644 --- a/aider/io.py +++ b/aider/io.py @@ -179,6 +179,10 @@ class InputOutput: tool_error_color="red", tool_warning_color="#FFA500", assistant_output_color="blue", + completion_menu_color="default", + completion_menu_bg_color="default", + completion_menu_current_color="default", + completion_menu_current_bg_color="default", code_theme="default", encoding="utf-8", dry_run=False, @@ -195,6 +199,11 @@ class InputOutput: self.tool_error_color = tool_error_color if pretty else None self.tool_warning_color = tool_warning_color if pretty else None self.assistant_output_color = assistant_output_color + self.completion_menu_color = completion_menu_color if pretty else None + self.completion_menu_bg_color = completion_menu_bg_color if pretty else None + self.completion_menu_current_color = completion_menu_current_color if pretty else None + self.completion_menu_current_bg_color = completion_menu_current_bg_color if pretty else None + self.code_theme = code_theme self.input = input @@ -321,6 +330,8 @@ class InputOutput: { "": self.user_input_color, "pygments.literal.string": f"bold italic {self.user_input_color}", + "completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}", + "completion-menu.completion.current": f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}", } ) else: diff --git a/aider/main.py b/aider/main.py index e62a782e7..d0934b3ff 100644 --- a/aider/main.py +++ b/aider/main.py @@ -408,6 +408,10 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F user_input_color=args.user_input_color, tool_output_color=args.tool_output_color, tool_error_color=args.tool_error_color, + completion_menu_color=args.completion_menu_color, + completion_menu_bg_color=args.completion_menu_bg_color, + completion_menu_current_color=args.completion_menu_current_color, + completion_menu_current_bg_color=args.completion_menu_current_bg_color, assistant_output_color=args.assistant_output_color, code_theme=args.code_theme, dry_run=args.dry_run, diff --git a/aider/website/assets/sample.env b/aider/website/assets/sample.env index fb122c026..4e09cf4f8 100644 --- a/aider/website/assets/sample.env +++ b/aider/website/assets/sample.env @@ -159,6 +159,18 @@ ## Set the color for assistant output (default: #0088ff) #AIDER_ASSISTANT_OUTPUT_COLOR=#0088ff +## Set the foreground color for the completion menu (default: terminal's default text color) +#AIDER_COMPLETION_MENU_COLOR=default + +## Set the background color for the completion menu (default: terminal's default background color) +#AIDER_COMPLETION_MENU_BG_COLOR=default + +## Set the foreground color for the current item in the completion menu (default: terminal's default background color) +#AIDER_COMPLETION_MENU_CURRENT_COLOR=default + +## Set the background color for the current item in the completion menu (default: terminal's default text color) +#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR=default + ## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light) #AIDER_CODE_THEME=default From 1cc30a22f9df7be3208f951f5c113431809cc957 Mon Sep 17 00:00:00 2001 From: Mike Bailey Date: Sun, 22 Sep 2024 18:19:22 +1000 Subject: [PATCH 088/149] feat: Option to compress audio files by ~90% Add option to reduce bandwidth (and potentially latency) by converting voice recordings (wav) into a compressed audio format (webm or mp3). Default behaviour is unchanged. > File uploads are currently limited to 25 MB and the following input file > types are supported: mp3, mp4, mpeg, mpga, m4a, wav, and webm. > > - https://platform.openai.com/docs/guides/speech-to-text --- aider/args.py | 7 +++++++ aider/commands.py | 2 +- aider/voice.py | 21 ++++++++++++++++++--- aider/website/assets/sample.aider.conf.yml | 3 +++ requirements.txt | 2 ++ requirements/requirements.in | 1 + 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/aider/args.py b/aider/args.py index b67aeb43a..4b9c745ae 100644 --- a/aider/args.py +++ b/aider/args.py @@ -485,6 +485,13 @@ def get_parser(default_config_files, git_root): help="Use VI editing mode in the terminal (default: False)", default=False, ) + group.add_argument( + "--voice-format", + metavar="VOICE_FORMAT", + default="wav", + choices=["wav", "mp3", "webm"], + help="Audio format for voice recording (default: wav). webm and mp3 require ffmpeg", + ) group.add_argument( "--voice-language", metavar="VOICE_LANGUAGE", diff --git a/aider/commands.py b/aider/commands.py index e6035ad10..40daf2719 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -997,7 +997,7 @@ class Commands: self.io.tool_error("To use /voice you must provide an OpenAI API key.") return try: - self.voice = voice.Voice() + self.voice = voice.Voice(audio_format=self.args.voice_format) except voice.SoundDeviceError: self.io.tool_error( "Unable to import `sounddevice` and/or `soundfile`, is portaudio installed?" diff --git a/aider/voice.py b/aider/voice.py index 047a0174d..1334a0a7e 100644 --- a/aider/voice.py +++ b/aider/voice.py @@ -12,6 +12,7 @@ except (OSError, ModuleNotFoundError): sf = None from prompt_toolkit.shortcuts import prompt +from pydub import AudioSegment from .dump import dump # noqa: F401 @@ -27,7 +28,7 @@ class Voice: threshold = 0.15 - def __init__(self): + def __init__(self, audio_format="wav"): if sf is None: raise SoundDeviceError try: @@ -37,6 +38,9 @@ class Voice: self.sd = sd except (OSError, ModuleNotFoundError): raise SoundDeviceError + if audio_format not in ["wav", "mp3", "webm"]: + raise ValueError(f"Unsupported audio format: {audio_format}") + self.audio_format = audio_format def callback(self, indata, frames, time, status): """This is called (from a separate thread) for each audio block.""" @@ -80,7 +84,7 @@ class Voice: def raw_record_and_transcribe(self, history, language): self.q = queue.Queue() - filename = tempfile.mktemp(suffix=".wav") + temp_wav = tempfile.mktemp(suffix=".wav") try: sample_rate = int(self.sd.query_devices(None, "input")["default_samplerate"]) @@ -99,10 +103,18 @@ class Voice: except self.sd.PortAudioError as err: raise SoundDeviceError(f"Error accessing audio input device: {err}") - with sf.SoundFile(filename, mode="x", samplerate=sample_rate, channels=1) as file: + with sf.SoundFile(temp_wav, mode="x", samplerate=sample_rate, channels=1) as file: while not self.q.empty(): file.write(self.q.get()) + if self.audio_format != "wav": + filename = tempfile.mktemp(suffix=f".{self.audio_format}") + audio = AudioSegment.from_wav(temp_wav) + audio.export(filename, format=self.audio_format) + os.remove(temp_wav) + else: + filename = temp_wav + with open(filename, "rb") as fh: try: transcript = litellm.transcription( @@ -112,6 +124,9 @@ class Voice: print(f"Unable to transcribe {filename}: {err}") return + if self.audio_format != "wav": + os.remove(filename) + text = transcript.text return text diff --git a/aider/website/assets/sample.aider.conf.yml b/aider/website/assets/sample.aider.conf.yml index 9b9b46077..921285de7 100644 --- a/aider/website/assets/sample.aider.conf.yml +++ b/aider/website/assets/sample.aider.conf.yml @@ -242,6 +242,9 @@ ## Use VI editing mode in the terminal (default: False) #vim: false +## Specify the audio format for voice recording (default: wav). webm and mp3 require ffmpeg +#voice-format: wav + ## Specify the language for voice using ISO 639-1 code (default: auto) #voice-language: en diff --git a/requirements.txt b/requirements.txt index ab8871925..4bd231778 100644 --- a/requirements.txt +++ b/requirements.txt @@ -144,6 +144,8 @@ pydantic==2.9.2 # openai pydantic-core==2.23.4 # via pydantic +pydub==0.25.1 + # via -r requirements/requirements.in pyflakes==3.2.0 # via flake8 pygments==2.18.0 diff --git a/requirements/requirements.in b/requirements/requirements.in index 031adb5e2..aeda8cde1 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -2,6 +2,7 @@ # pip-compile requirements.in --upgrade # +pydub configargparse GitPython jsonschema From 330fa863c85b9ca8e9293a1a6550cb8562b63408 Mon Sep 17 00:00:00 2001 From: Curran Kelleher <68416+curran@users.noreply.github.com> Date: Sun, 22 Sep 2024 08:26:04 -0400 Subject: [PATCH 089/149] Add benchmark results for Codestral-22B --- aider/website/_data/edit_leaderboard.yml | 25 +++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/aider/website/_data/edit_leaderboard.yml b/aider/website/_data/edit_leaderboard.yml index 5d85799df..76dd1d219 100644 --- a/aider/website/_data/edit_leaderboard.yml +++ b/aider/website/_data/edit_leaderboard.yml @@ -1200,4 +1200,27 @@ date: 2024-09-20 versions: 0.56.1.dev seconds_per_case: 39.8 - total_cost: 0.0000 \ No newline at end of file + total_cost: 0.0000 + +- dirname: 2024-09-21-11-56-43--Codestral-22B-v0.1-Q4_K_M.gguf_whole + test_cases: 133 + model: Codestral-22B-v0.1-Q4_K_M + edit_format: whole + commit_hash: 2753ac6-dirty + pass_rate_1: 36.1 + pass_rate_2: 48.1 + percent_cases_well_formed: 100.0 + error_outputs: 0 + num_malformed_responses: 0 + num_with_malformed_responses: 0 + user_asks: 8 + lazy_comments: 6 + syntax_errors: 0 + indentation_errors: 0 + exhausted_context_windows: 0 + test_timeouts: 4 + command: aider --model Codestral-22B-v0.1-Q4_K_M + date: 2024-09-21 + versions: 0.56.1.dev + seconds_per_case: 656.4 + total_cost: 0.9108 From 54cfbc4142e10dde73434accd20761bfc1ba3f1e Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sun, 22 Sep 2024 08:21:15 -0700 Subject: [PATCH 090/149] handle `### filename.ext` in whole format --- aider/coders/wholefile_coder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aider/coders/wholefile_coder.py b/aider/coders/wholefile_coder.py index 6028bf3c5..7cd9bac1b 100644 --- a/aider/coders/wholefile_coder.py +++ b/aider/coders/wholefile_coder.py @@ -58,6 +58,8 @@ class WholeFileCoder(Coder): fname = fname.strip("*") # handle **filename.py** fname = fname.rstrip(":") fname = fname.strip("`") + fname = fname.lstrip("#") + fname = fname.strip() # Issue #1232 if len(fname) > 250: From cee0bb713568539ecf97b6494f087cc7ddcf926b Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sun, 22 Sep 2024 08:24:55 -0700 Subject: [PATCH 091/149] add test for hash filenames --- tests/basic/test_wholefile.py | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/basic/test_wholefile.py b/tests/basic/test_wholefile.py index e0d4f76d6..deb192ec7 100644 --- a/tests/basic/test_wholefile.py +++ b/tests/basic/test_wholefile.py @@ -246,6 +246,44 @@ after b self.assertEqual(fname_a.read_text(), "after a\n") self.assertEqual(fname_b.read_text(), "after b\n") + def test_update_hash_filename(self): + fname_a = Path("a.txt") + fname_b = Path("b.txt") + + fname_a.write_text("before a\n") + fname_b.write_text("before b\n") + + response = """ + +### a.txt +``` +after a +``` + +### b.txt +``` +after b +``` +""" + # Initialize WholeFileCoder with the temporary directory + io = InputOutput(yes=True) + coder = WholeFileCoder(main_model=self.GPT35, io=io, fnames=[fname_a, fname_b]) + + # Set the partial response content with the updated content + coder.partial_response_content = response + + # Call update_files method + edited_files = coder.apply_updates() + + dump(edited_files) + + # Check if the sample file was updated + self.assertIn(str(fname_a), edited_files) + self.assertIn(str(fname_b), edited_files) + + self.assertEqual(fname_a.read_text(), "after a\n") + self.assertEqual(fname_b.read_text(), "after b\n") + def test_update_named_file_but_extra_unnamed_code_block(self): sample_file = "hello.py" new_content = "new\ncontent\ngoes\nhere\n" From ef75ba94951741a9bb3a50047e064094bffd4614 Mon Sep 17 00:00:00 2001 From: Stein Martin Hustad Date: Sun, 22 Sep 2024 22:59:57 +0400 Subject: [PATCH 092/149] style: completion menu colorization (additional location) --- aider/io.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index 5ff9e840e..a4de63c09 100644 --- a/aider/io.py +++ b/aider/io.py @@ -471,7 +471,11 @@ class InputOutput: self.tool_output(subject, bold=True) if self.pretty and self.user_input_color: - style = {"": self.user_input_color} + style = { + "": self.user_input_color, + "completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}", + "completion-menu.completion.current": f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}", + } else: style = dict() From 129afd0396a1f0cf30aced8e9350d579c3b058a2 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sun, 22 Sep 2024 13:06:52 -0700 Subject: [PATCH 093/149] copy --- aider/website/assets/sample.aider.conf.yml | 2 +- aider/website/assets/sample.env | 3 +++ aider/website/docs/config/aider_conf.md | 3 +++ aider/website/docs/config/dotenv.md | 3 +++ aider/website/docs/config/options.md | 10 ++++++++-- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/aider/website/assets/sample.aider.conf.yml b/aider/website/assets/sample.aider.conf.yml index 921285de7..3e0023ddd 100644 --- a/aider/website/assets/sample.aider.conf.yml +++ b/aider/website/assets/sample.aider.conf.yml @@ -242,7 +242,7 @@ ## Use VI editing mode in the terminal (default: False) #vim: false -## Specify the audio format for voice recording (default: wav). webm and mp3 require ffmpeg +## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg #voice-format: wav ## Specify the language for voice using ISO 639-1 code (default: auto) diff --git a/aider/website/assets/sample.env b/aider/website/assets/sample.env index fb122c026..a7a226691 100644 --- a/aider/website/assets/sample.env +++ b/aider/website/assets/sample.env @@ -240,6 +240,9 @@ ## Use VI editing mode in the terminal (default: False) #AIDER_VIM=false +## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg +#AIDER_VOICE_FORMAT=wav + ## Specify the language for voice using ISO 639-1 code (default: auto) #AIDER_VOICE_LANGUAGE=en diff --git a/aider/website/docs/config/aider_conf.md b/aider/website/docs/config/aider_conf.md index d906e11bd..b992d69b2 100644 --- a/aider/website/docs/config/aider_conf.md +++ b/aider/website/docs/config/aider_conf.md @@ -290,6 +290,9 @@ cog.outl("```") ## Use VI editing mode in the terminal (default: False) #vim: false +## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg +#voice-format: wav + ## Specify the language for voice using ISO 639-1 code (default: auto) #voice-language: en diff --git a/aider/website/docs/config/dotenv.md b/aider/website/docs/config/dotenv.md index 21c3b4619..e31959e17 100644 --- a/aider/website/docs/config/dotenv.md +++ b/aider/website/docs/config/dotenv.md @@ -282,6 +282,9 @@ cog.outl("```") ## Use VI editing mode in the terminal (default: False) #AIDER_VIM=false +## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg +#AIDER_VOICE_FORMAT=wav + ## Specify the language for voice using ISO 639-1 code (default: auto) #AIDER_VOICE_LANGUAGE=en diff --git a/aider/website/docs/config/options.md b/aider/website/docs/config/options.md index 779441677..17d2913ac 100644 --- a/aider/website/docs/config/options.md +++ b/aider/website/docs/config/options.md @@ -57,8 +57,9 @@ usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model] [--commit] [--commit-prompt] [--dry-run | --no-dry-run] [--lint] [--lint-cmd] [--auto-lint | --no-auto-lint] [--test-cmd] [--auto-test | --no-auto-test] [--test] - [--file] [--read] [--vim] [--voice-language] - [--chat-language] [--version] [--just-check-update] + [--file] [--read] [--vim] [--voice-format] + [--voice-language] [--chat-language] [--version] + [--just-check-update] [--check-update | --no-check-update] [--install-main-branch] [--upgrade] [--apply] [--yes] [-v] [--show-repo-map] [--show-prompts] [--exit] @@ -463,6 +464,11 @@ Use VI editing mode in the terminal (default: False) Default: False Environment variable: `AIDER_VIM` +### `--voice-format VOICE_FORMAT` +Audio format for voice recording (default: wav). webm and mp3 require ffmpeg +Default: wav +Environment variable: `AIDER_VOICE_FORMAT` + ### `--voice-language VOICE_LANGUAGE` Specify the language for voice using ISO 639-1 code (default: auto) Default: en From ea72ad61fe2e4e253137cd75fe7644c62e9e0c15 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 22 Sep 2024 16:54:51 -0700 Subject: [PATCH 094/149] feat: add function to print model settings as YAML --- aider/models.py | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/aider/models.py b/aider/models.py index 2b35e6bc3..6e6b6b3ee 100644 --- a/aider/models.py +++ b/aider/models.py @@ -932,20 +932,32 @@ def print_matching_models(io, search): def main(): - if len(sys.argv) != 2: - print("Usage: python models.py ") + if len(sys.argv) < 2: + print("Usage: python models.py or python models.py --yaml") sys.exit(1) - model_name = sys.argv[1] - matching_models = fuzzy_match_models(model_name) - - if matching_models: - print(f"Matching models for '{model_name}':") - for model in matching_models: - print(model) + if sys.argv[1] == "--yaml": + print_model_settings_as_yaml() else: - print(f"No matching models found for '{model_name}'.") + model_name = sys.argv[1] + matching_models = fuzzy_match_models(model_name) + if matching_models: + print(f"Matching models for '{model_name}':") + for model in matching_models: + print(model) + else: + print(f"No matching models found for '{model_name}'.") + + +def print_model_settings_as_yaml(): + import yaml + model_settings_list = [] + for ms in MODEL_SETTINGS: + model_settings_dict = {field.name: getattr(ms, field.name) for field in fields(ModelSettings)} + model_settings_list.append(model_settings_dict) + + print(yaml.dump(model_settings_list, default_flow_style=False)) if __name__ == "__main__": main() From 60082d0d162b96e812ea348f73f6a1f11e45a445 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 22 Sep 2024 16:54:56 -0700 Subject: [PATCH 095/149] style: format code using linter --- aider/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aider/models.py b/aider/models.py index 6e6b6b3ee..0cd2446d4 100644 --- a/aider/models.py +++ b/aider/models.py @@ -952,12 +952,16 @@ def main(): def print_model_settings_as_yaml(): import yaml + model_settings_list = [] for ms in MODEL_SETTINGS: - model_settings_dict = {field.name: getattr(ms, field.name) for field in fields(ModelSettings)} + model_settings_dict = { + field.name: getattr(ms, field.name) for field in fields(ModelSettings) + } model_settings_list.append(model_settings_dict) - + print(yaml.dump(model_settings_list, default_flow_style=False)) + if __name__ == "__main__": main() From 6a733f8e76219600c82302d04b7edf9146ba9beb Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 22 Sep 2024 16:55:58 -0700 Subject: [PATCH 096/149] refactor: Rename print_model_settings_as_yaml to get_model_settings_as_yaml --- aider/models.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/aider/models.py b/aider/models.py index 0cd2446d4..744515336 100644 --- a/aider/models.py +++ b/aider/models.py @@ -931,13 +931,27 @@ def print_matching_models(io, search): io.tool_output(f'No models match "{search}".') +def get_model_settings_as_yaml(): + import yaml + + model_settings_list = [] + for ms in MODEL_SETTINGS: + model_settings_dict = { + field.name: getattr(ms, field.name) for field in fields(ModelSettings) + } + model_settings_list.append(model_settings_dict) + + return yaml.dump(model_settings_list, default_flow_style=False) + + def main(): if len(sys.argv) < 2: print("Usage: python models.py or python models.py --yaml") sys.exit(1) if sys.argv[1] == "--yaml": - print_model_settings_as_yaml() + yaml_string = get_model_settings_as_yaml() + print(yaml_string) else: model_name = sys.argv[1] matching_models = fuzzy_match_models(model_name) @@ -950,18 +964,5 @@ def main(): print(f"No matching models found for '{model_name}'.") -def print_model_settings_as_yaml(): - import yaml - - model_settings_list = [] - for ms in MODEL_SETTINGS: - model_settings_dict = { - field.name: getattr(ms, field.name) for field in fields(ModelSettings) - } - model_settings_list.append(model_settings_dict) - - print(yaml.dump(model_settings_list, default_flow_style=False)) - - if __name__ == "__main__": main() From a1bd0c97ee3e7a3a6c7560bec7be465adc76fd6e Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sun, 22 Sep 2024 17:01:47 -0700 Subject: [PATCH 097/149] copy --- .../website/docs/config/adv-model-settings.md | 861 +++++++++++++++++- scripts/update-docs.sh | 1 + 2 files changed, 837 insertions(+), 25 deletions(-) diff --git a/aider/website/docs/config/adv-model-settings.md b/aider/website/docs/config/adv-model-settings.md index cb7d238a9..2dda552b2 100644 --- a/aider/website/docs/config/adv-model-settings.md +++ b/aider/website/docs/config/adv-model-settings.md @@ -66,31 +66,842 @@ create a `.aider.model.settings.yml` file in one of these locations: If the files above exist, they will be loaded in that order. Files loaded last will take priority. -The yaml file should be a a list of dictionary objects for each model, as follows: +The yaml file should be a a list of dictionary objects for each model. +For example, below are all the pre-configured model settings +to give a sense for the settings which are supported. -``` -- name: "gpt-3.5-turbo" - edit_format: "whole" - weak_model_name: "gpt-3.5-turbo" - use_repo_map: false - send_undo_reply: false - accepts_images: false - lazy: false - reminder: sys - examples_as_sys_msg: false -- name: "gpt-4-turbo-2024-04-09" - edit_format: "udiff" - weak_model_name: "gpt-3.5-turbo" - use_repo_map: true - send_undo_reply: true - accepts_images: true - lazy: true - reminder: sys - examples_as_sys_msg: false -``` - -You can look at the `ModelSettings` class in +You can also look at the `ModelSettings` class in [models.py](https://github.com/paul-gauthier/aider/blob/main/aider/models.py) -file for details about all of the model setting that aider supports. -That file also contains the settings for many popular models. +file for more details about all of the model setting that aider supports. + + +```yaml +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gpt-3.5-turbo + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gpt-3.5-turbo-0125 + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gpt-3.5-turbo-1106 + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gpt-3.5-turbo-0613 + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gpt-3.5-turbo-16k-0613 + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: true + cache_control: false + caches_by_default: false + edit_format: udiff + examples_as_sys_msg: false + extra_headers: null + lazy: true + max_tokens: null + name: gpt-4-turbo-2024-04-09 + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: true + cache_control: false + caches_by_default: false + edit_format: udiff + examples_as_sys_msg: false + extra_headers: null + lazy: true + max_tokens: null + name: gpt-4-turbo + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: true + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: true + max_tokens: null + name: openai/gpt-4o + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: true + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: true + max_tokens: null + name: openai/gpt-4o-2024-08-06 + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: true + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: true + max_tokens: null + name: gpt-4o-2024-08-06 + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: true + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: true + max_tokens: null + name: gpt-4o + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: true + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: true + max_tokens: null + name: gpt-4o-mini + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: true + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: true + max_tokens: null + name: openai/gpt-4o-mini + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: openai/gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: udiff + examples_as_sys_msg: true + extra_headers: null + lazy: true + max_tokens: null + name: gpt-4-0125-preview + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: udiff + examples_as_sys_msg: false + extra_headers: null + lazy: true + max_tokens: null + name: gpt-4-1106-preview + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: true + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gpt-4-vision-preview + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: true + extra_headers: null + lazy: false + max_tokens: null + name: gpt-4-0314 + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gpt-4-0613 + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gpt-4-32k-0613 + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: claude-3-opus-20240229 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: claude-3-haiku-20240307 +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: openrouter/anthropic/claude-3-opus + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: openrouter/anthropic/claude-3-haiku +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: claude-3-sonnet-20240229 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: claude-3-haiku-20240307 +- accepts_images: true + cache_control: true + caches_by_default: false + edit_format: diff + examples_as_sys_msg: true + extra_headers: + anthropic-beta: prompt-caching-2024-07-31 + lazy: false + max_tokens: 8192 + name: claude-3-5-sonnet-20240620 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: claude-3-haiku-20240307 +- accepts_images: false + cache_control: true + caches_by_default: false + edit_format: diff + examples_as_sys_msg: true + extra_headers: + anthropic-beta: prompt-caching-2024-07-31 + lazy: false + max_tokens: 8192 + name: anthropic/claude-3-5-sonnet-20240620 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: claude-3-haiku-20240307 +- accepts_images: false + cache_control: true + caches_by_default: false + edit_format: whole + examples_as_sys_msg: true + extra_headers: + anthropic-beta: prompt-caching-2024-07-31 + lazy: false + max_tokens: null + name: anthropic/claude-3-haiku-20240307 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: anthropic/claude-3-haiku-20240307 +- accepts_images: false + cache_control: true + caches_by_default: false + edit_format: whole + examples_as_sys_msg: true + extra_headers: + anthropic-beta: prompt-caching-2024-07-31 + lazy: false + max_tokens: null + name: claude-3-haiku-20240307 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: claude-3-haiku-20240307 +- accepts_images: true + cache_control: true + caches_by_default: false + edit_format: diff + examples_as_sys_msg: true + extra_headers: null + lazy: false + max_tokens: 8192 + name: openrouter/anthropic/claude-3.5-sonnet + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: openrouter/anthropic/claude-3-haiku-20240307 +- accepts_images: true + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: true + extra_headers: null + lazy: false + max_tokens: 8192 + name: vertex_ai/claude-3-5-sonnet@20240620 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: vertex_ai/claude-3-haiku@20240307 +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: vertex_ai/claude-3-opus@20240229 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: vertex_ai/claude-3-haiku@20240307 +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: vertex_ai/claude-3-sonnet@20240229 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: vertex_ai/claude-3-haiku@20240307 +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: command-r-plus + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: command-r-plus +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: command-r-08-2024 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: command-r-08-2024 +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: command-r-plus-08-2024 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: command-r-plus-08-2024 +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: true + extra_headers: null + lazy: false + max_tokens: null + name: groq/llama3-70b-8192 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: groq/llama3-8b-8192 +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: true + extra_headers: null + lazy: false + max_tokens: null + name: openrouter/meta-llama/llama-3-70b-instruct + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: openrouter/meta-llama/llama-3-70b-instruct +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff-fenced + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gemini/gemini-1.5-pro + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: null +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff-fenced + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gemini/gemini-1.5-pro-latest + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: null +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff-fenced + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gemini/gemini-1.5-pro-exp-0827 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: null +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: gemini/gemini-1.5-flash-exp-0827 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: false + use_system_prompt: true + use_temperature: true + weak_model_name: null +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: true + extra_headers: null + lazy: false + max_tokens: 8192 + name: deepseek/deepseek-chat + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: null +- accepts_images: false + cache_control: false + caches_by_default: true + edit_format: diff + examples_as_sys_msg: true + extra_headers: null + lazy: false + max_tokens: 8192 + name: deepseek/deepseek-coder + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: null +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: true + extra_headers: null + lazy: false + max_tokens: 8192 + name: deepseek-chat + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: null +- accepts_images: false + cache_control: false + caches_by_default: true + edit_format: diff + examples_as_sys_msg: true + extra_headers: null + lazy: false + max_tokens: 8192 + name: deepseek-coder + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: null +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: true + extra_headers: null + lazy: false + max_tokens: null + name: openrouter/deepseek/deepseek-coder + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: null +- accepts_images: true + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: true + max_tokens: null + name: openrouter/openai/gpt-4o + reminder: sys + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: openrouter/openai/gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: openai/o1-mini + reminder: user + send_undo_reply: false + streaming: false + use_repo_map: true + use_system_prompt: false + use_temperature: false + weak_model_name: openai/gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: o1-mini + reminder: user + send_undo_reply: false + streaming: false + use_repo_map: true + use_system_prompt: false + use_temperature: false + weak_model_name: gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: openai/o1-preview + reminder: user + send_undo_reply: false + streaming: false + use_repo_map: true + use_system_prompt: false + use_temperature: false + weak_model_name: openai/gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: o1-preview + reminder: user + send_undo_reply: false + streaming: false + use_repo_map: true + use_system_prompt: false + use_temperature: false + weak_model_name: gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: whole + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: openrouter/openai/o1-mini + reminder: user + send_undo_reply: false + streaming: false + use_repo_map: true + use_system_prompt: false + use_temperature: false + weak_model_name: openrouter/openai/gpt-4o-mini +- accepts_images: false + cache_control: false + caches_by_default: false + edit_format: diff + examples_as_sys_msg: false + extra_headers: null + lazy: false + max_tokens: null + name: openrouter/openai/o1-preview + reminder: user + send_undo_reply: false + streaming: false + use_repo_map: true + use_system_prompt: false + use_temperature: false + weak_model_name: openrouter/openai/gpt-4o-mini +``` + + diff --git a/scripts/update-docs.sh b/scripts/update-docs.sh index 191f39382..325872bff 100755 --- a/scripts/update-docs.sh +++ b/scripts/update-docs.sh @@ -19,5 +19,6 @@ cog $ARG \ aider/website/docs/config/dotenv.md \ aider/website/docs/config/options.md \ aider/website/docs/config/aider_conf.md \ + aider/website/docs/config/adv-model-settings.md \ aider/website/docs/leaderboards/index.md \ aider/website/docs/llms/other.md From ca4141564f86dd1b7dee3082959042dc05d5d471 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sun, 22 Sep 2024 17:03:43 -0700 Subject: [PATCH 098/149] copy --- aider/website/docs/leaderboards/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/website/docs/leaderboards/index.md b/aider/website/docs/leaderboards/index.md index b8a312e05..b78060cf6 100644 --- a/aider/website/docs/leaderboards/index.md +++ b/aider/website/docs/leaderboards/index.md @@ -181,6 +181,6 @@ mod_dates = [get_last_modified_date(file) for file in files] latest_mod_date = max(mod_dates) cog.out(f"{latest_mod_date.strftime('%B %d, %Y.')}") ]]]--> -September 21, 2024. +September 22, 2024.

From a695c6c46e860eafb21ba16741fabe9ffcb99f47 Mon Sep 17 00:00:00 2001 From: fry69 <142489379+fry69@users.noreply.github.com> Date: Mon, 23 Sep 2024 07:02:33 +0200 Subject: [PATCH 099/149] fix: add missing variable initialization --- aider/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aider/main.py b/aider/main.py index e62a782e7..81783692f 100644 --- a/aider/main.py +++ b/aider/main.py @@ -307,6 +307,7 @@ def sanity_check_repo(repo, io): io.tool_error("The git repo does not seem to have a working tree?") return False + bad_ver = False try: repo.get_tracked_files() if not repo.git_repo_error: From 7a5947fc49b05fdc3c7eeb2255d5b1eed9de9682 Mon Sep 17 00:00:00 2001 From: fry69 <142489379+fry69@users.noreply.github.com> Date: Mon, 23 Sep 2024 07:55:45 +0200 Subject: [PATCH 100/149] feat: add tests for sanity_check_repo function --- tests/basic/test_sanity_check_repo.py | 179 ++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 tests/basic/test_sanity_check_repo.py diff --git a/tests/basic/test_sanity_check_repo.py b/tests/basic/test_sanity_check_repo.py new file mode 100644 index 000000000..72989cfa3 --- /dev/null +++ b/tests/basic/test_sanity_check_repo.py @@ -0,0 +1,179 @@ +import os +import shutil +import struct +from unittest import mock + +import pytest +from git import GitError, Repo + +from aider.main import sanity_check_repo + + +@pytest.fixture +def mock_io(): + """Fixture to create a mock io object.""" + return mock.Mock() + + +@pytest.fixture +def create_repo(tmp_path): + """ + Fixture to create a standard Git repository. + Returns the path to the repo and the Repo object. + """ + repo_path = tmp_path / "test_repo" + repo = Repo.init(repo_path) + # Create an initial commit + file_path = repo_path / "README.md" + file_path.write_text("# Test Repository") + repo.index.add([str(file_path.relative_to(repo_path))]) + repo.index.commit("Initial commit") + return repo_path, repo + + +def set_git_index_version(repo_path, version): + """ + Sets the Git index version by modifying the .git/index file. + The index version is stored in the first 4 bytes as a little-endian integer. + """ + index_path = os.path.join(repo_path, ".git", "index") + with open(index_path, "r+b") as f: + # Read the first 4 bytes (signature) and the next 4 bytes (version) + signature = f.read(4) + if signature != b"DIRC": + raise ValueError("Invalid git index file signature.") + # Write the new version + f.seek(4) + f.write(struct.pack(" Date: Thu, 19 Sep 2024 16:59:05 +0900 Subject: [PATCH 101/149] feat: add `extra_body`field and use in model settings. resolved: #1583 The `extra_body` field is a parameter used by the `openai` provider. Since `litellm` also uses this field to additionally transmit `request body`, I added a function so that `aider` can also utilize the `extra_body` field. The `openrouter` provider also supports various functions through the additional field of `request body`, so we added the function. The following is how to use it in model settings. ```yaml # .aider.model.settings.yml - name: "openrouter/" edit_format: "whole" use_repo_map: true extra_body: provider: order: - Azure allow_fallbacks: false ``` --- aider/coders/base_coder.py | 1 + aider/models.py | 1 + aider/sendchat.py | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 3960515af..3d04b50bd 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1396,6 +1396,7 @@ class Coder: self.stream, temp, extra_headers=model.extra_headers, + extra_body=model.extra_body, max_tokens=model.max_tokens, ) self.chat_completion_call_hashes.append(hash_object.hexdigest()) diff --git a/aider/models.py b/aider/models.py index 744515336..29c3654ce 100644 --- a/aider/models.py +++ b/aider/models.py @@ -74,6 +74,7 @@ class ModelSettings: reminder: str = "user" examples_as_sys_msg: bool = False extra_headers: Optional[dict] = None + extra_body: Optional[dict] = None max_tokens: Optional[int] = None cache_control: bool = False caches_by_default: bool = False diff --git a/aider/sendchat.py b/aider/sendchat.py index 1ac34f9ab..d651e5902 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -53,6 +53,7 @@ def send_completion( stream, temperature=0, extra_headers=None, + extra_body=None, max_tokens=None, ): from aider.llm import litellm @@ -71,6 +72,8 @@ def send_completion( kwargs["tool_choice"] = {"type": "function", "function": {"name": function["name"]}} if extra_headers is not None: kwargs["extra_headers"] = extra_headers + if extra_body is not None: + kwargs["extra_body"] = extra_body if max_tokens is not None: kwargs["max_tokens"] = max_tokens @@ -103,6 +106,8 @@ def simple_send_with_retries(model_name, messages, extra_headers=None): } if extra_headers is not None: kwargs["extra_headers"] = extra_headers + if extra_body is not None: + kwargs["extra_body"] = extra_body _hash, response = send_completion(**kwargs) return response.choices[0].message.content From 6dc846d41ba6dbc42ce0e56fb86544f807b9ebc3 Mon Sep 17 00:00:00 2001 From: hypn4 Date: Sat, 21 Sep 2024 05:23:38 +0900 Subject: [PATCH 102/149] fix: added missing parameters. added missing parameters in `simple_send_with_retries` function. --- aider/sendchat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/sendchat.py b/aider/sendchat.py index d651e5902..6678b5ed2 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -96,7 +96,7 @@ def send_completion( @lazy_litellm_retry_decorator -def simple_send_with_retries(model_name, messages, extra_headers=None): +def simple_send_with_retries(model_name, messages, extra_headers=None, extra_body=None): try: kwargs = { "model_name": model_name, From a4044f4175f9d6559c0ee786a6d66ec5f6a32e46 Mon Sep 17 00:00:00 2001 From: hypn4 Date: Sun, 22 Sep 2024 04:02:49 +0900 Subject: [PATCH 103/149] feat: add `.venv` directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4216b9c5d..7767cef8f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ _site .jekyll-cache/ .jekyll-metadata aider/__version__.py +.venv/ \ No newline at end of file From c9ac01f4742f74face2c012a236a1f94e77cb3a7 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 09:02:45 -0700 Subject: [PATCH 104/149] docs: update help message for --map-refresh option --- aider/args.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/args.py b/aider/args.py index 4b9c745ae..1533db479 100644 --- a/aider/args.py +++ b/aider/args.py @@ -206,7 +206,7 @@ def get_parser(default_config_files, git_root): "--map-refresh", choices=["auto", "always", "files", "manual"], default="auto", - help="Control how often the repo map is refreshed (default: auto)", + help="Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto)", ) group.add_argument( "--cache-prompts", From b03d5d10990e791b4b552fcb1d27228b5537fe3f Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 09:02:49 -0700 Subject: [PATCH 105/149] style: Wrap long help text in args.py --- aider/args.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aider/args.py b/aider/args.py index 1533db479..e1661c282 100644 --- a/aider/args.py +++ b/aider/args.py @@ -206,7 +206,10 @@ def get_parser(default_config_files, git_root): "--map-refresh", choices=["auto", "always", "files", "manual"], default="auto", - help="Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto)", + help=( + "Control how often the repo map is refreshed. Options: auto, always, files, manual" + " (default: auto)" + ), ) group.add_argument( "--cache-prompts", From 9c47f260523b6da26f64cd013b3423635804893e Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 23 Sep 2024 09:03:02 -0700 Subject: [PATCH 106/149] copy --- aider/website/assets/sample.aider.conf.yml | 2 +- aider/website/assets/sample.env | 2 +- aider/website/docs/config/aider_conf.md | 2 +- aider/website/docs/config/dotenv.md | 2 +- aider/website/docs/config/options.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aider/website/assets/sample.aider.conf.yml b/aider/website/assets/sample.aider.conf.yml index 3e0023ddd..220c80179 100644 --- a/aider/website/assets/sample.aider.conf.yml +++ b/aider/website/assets/sample.aider.conf.yml @@ -92,7 +92,7 @@ ## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) #map-tokens: xxx -## Control how often the repo map is refreshed (default: auto) +## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) #map-refresh: auto ## Enable caching of prompts (default: False) diff --git a/aider/website/assets/sample.env b/aider/website/assets/sample.env index a7a226691..2612d4fa6 100644 --- a/aider/website/assets/sample.env +++ b/aider/website/assets/sample.env @@ -96,7 +96,7 @@ ## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) #AIDER_MAP_TOKENS= -## Control how often the repo map is refreshed (default: auto) +## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) #AIDER_MAP_REFRESH=auto ## Enable caching of prompts (default: False) diff --git a/aider/website/docs/config/aider_conf.md b/aider/website/docs/config/aider_conf.md index b992d69b2..2e05b86e5 100644 --- a/aider/website/docs/config/aider_conf.md +++ b/aider/website/docs/config/aider_conf.md @@ -140,7 +140,7 @@ cog.outl("```") ## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) #map-tokens: xxx -## Control how often the repo map is refreshed (default: auto) +## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) #map-refresh: auto ## Enable caching of prompts (default: False) diff --git a/aider/website/docs/config/dotenv.md b/aider/website/docs/config/dotenv.md index e31959e17..b9d34a513 100644 --- a/aider/website/docs/config/dotenv.md +++ b/aider/website/docs/config/dotenv.md @@ -138,7 +138,7 @@ cog.outl("```") ## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) #AIDER_MAP_TOKENS= -## Control how often the repo map is refreshed (default: auto) +## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) #AIDER_MAP_REFRESH=auto ## Enable caching of prompts (default: False) diff --git a/aider/website/docs/config/options.md b/aider/website/docs/config/options.md index 17d2913ac..c6003c166 100644 --- a/aider/website/docs/config/options.md +++ b/aider/website/docs/config/options.md @@ -201,7 +201,7 @@ Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) Environment variable: `AIDER_MAP_TOKENS` ### `--map-refresh VALUE` -Control how often the repo map is refreshed (default: auto) +Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) Default: auto Environment variable: `AIDER_MAP_REFRESH` From 5e9a4e01f9abe60b46d371a5ff7bd544102dd5c3 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 09:04:46 -0700 Subject: [PATCH 107/149] feat: Move map-tokens, map-refresh and map-multiplier into a new Repomap Setting section --- aider/args.py | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/aider/args.py b/aider/args.py index e1661c282..ad8d17c7f 100644 --- a/aider/args.py +++ b/aider/args.py @@ -196,21 +196,6 @@ def get_parser(default_config_files, git_root): default=True, help="Only work with models that have meta-data available (default: True)", ) - group.add_argument( - "--map-tokens", - type=int, - default=None, - help="Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)", - ) - group.add_argument( - "--map-refresh", - choices=["auto", "always", "files", "manual"], - default="auto", - help=( - "Control how often the repo map is refreshed. Options: auto, always, files, manual" - " (default: auto)" - ), - ) group.add_argument( "--cache-prompts", action=argparse.BooleanOptionalAction, @@ -223,12 +208,6 @@ def get_parser(default_config_files, git_root): default=0, help="Number of times to ping at 5min intervals to keep prompt cache warm (default: 0)", ) - group.add_argument( - "--map-multiplier-no-files", - type=float, - default=2, - help="Multiplier for map tokens when no files are specified (default: 2)", - ) group.add_argument( "--max-chat-history-tokens", type=int, @@ -247,6 +226,30 @@ def get_parser(default_config_files, git_root): help="Specify the .env file to load (default: .env in git root)", ) + ########## + group = parser.add_argument_group("Repomap Settings") + group.add_argument( + "--map-tokens", + type=int, + default=None, + help="Suggested number of tokens to use for repo map, use 0 to disable (default: 1024)", + ) + group.add_argument( + "--map-refresh", + choices=["auto", "always", "files", "manual"], + default="auto", + help=( + "Control how often the repo map is refreshed. Options: auto, always, files, manual" + " (default: auto)" + ), + ) + group.add_argument( + "--map-multiplier-no-files", + type=float, + default=2, + help="Multiplier for map tokens when no files are specified (default: 2)", + ) + ########## group = parser.add_argument_group("History Files") default_input_history_file = ( From 39b2f7bdee72131211b304cd9d881db35ced5f9f Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 09:06:31 -0700 Subject: [PATCH 108/149] feat: Add Cache Settings section --- aider/args.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/aider/args.py b/aider/args.py index ad8d17c7f..89f81dff6 100644 --- a/aider/args.py +++ b/aider/args.py @@ -196,18 +196,6 @@ def get_parser(default_config_files, git_root): default=True, help="Only work with models that have meta-data available (default: True)", ) - group.add_argument( - "--cache-prompts", - action=argparse.BooleanOptionalAction, - default=False, - help="Enable caching of prompts (default: False)", - ) - group.add_argument( - "--cache-keepalive-pings", - type=int, - default=0, - help="Number of times to ping at 5min intervals to keep prompt cache warm (default: 0)", - ) group.add_argument( "--max-chat-history-tokens", type=int, @@ -226,6 +214,21 @@ def get_parser(default_config_files, git_root): help="Specify the .env file to load (default: .env in git root)", ) + ########## + group = parser.add_argument_group("Cache Settings") + group.add_argument( + "--cache-prompts", + action=argparse.BooleanOptionalAction, + default=False, + help="Enable caching of prompts (default: False)", + ) + group.add_argument( + "--cache-keepalive-pings", + type=int, + default=0, + help="Number of times to ping at 5min intervals to keep prompt cache warm (default: 0)", + ) + ########## group = parser.add_argument_group("Repomap Settings") group.add_argument( From 5779006db05083700abe66db2a042f0d2f69338e Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 09:06:57 -0700 Subject: [PATCH 109/149] feat: Add Voice Settings section --- aider/args.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/aider/args.py b/aider/args.py index 89f81dff6..2b156d3bf 100644 --- a/aider/args.py +++ b/aider/args.py @@ -494,6 +494,21 @@ def get_parser(default_config_files, git_root): help="Use VI editing mode in the terminal (default: False)", default=False, ) + group.add_argument( + "--chat-language", + metavar="CHAT_LANGUAGE", + default=None, + help="Specify the language to use in the chat (default: None, uses system settings)", + ) + group.add_argument( + "--version", + action="version", + version=f"%(prog)s {__version__}", + help="Show the version number and exit", + ) + + ########## + group = parser.add_argument_group("Voice Settings") group.add_argument( "--voice-format", metavar="VOICE_FORMAT", @@ -507,18 +522,6 @@ def get_parser(default_config_files, git_root): default="en", help="Specify the language for voice using ISO 639-1 code (default: auto)", ) - group.add_argument( - "--chat-language", - metavar="CHAT_LANGUAGE", - default=None, - help="Specify the language to use in the chat (default: None, uses system settings)", - ) - group.add_argument( - "--version", - action="version", - version=f"%(prog)s {__version__}", - help="Show the version number and exit", - ) group.add_argument( "--just-check-update", action="store_true", From f2397bb0ccea1f3ea7106400f9223e6fa2524be4 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 09:08:07 -0700 Subject: [PATCH 110/149] chore: Reorganize command-line arguments in aider/args.py --- aider/args.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/aider/args.py b/aider/args.py index 2b156d3bf..ab88f2e90 100644 --- a/aider/args.py +++ b/aider/args.py @@ -506,22 +506,6 @@ def get_parser(default_config_files, git_root): version=f"%(prog)s {__version__}", help="Show the version number and exit", ) - - ########## - group = parser.add_argument_group("Voice Settings") - group.add_argument( - "--voice-format", - metavar="VOICE_FORMAT", - default="wav", - choices=["wav", "mp3", "webm"], - help="Audio format for voice recording (default: wav). webm and mp3 require ffmpeg", - ) - group.add_argument( - "--voice-language", - metavar="VOICE_LANGUAGE", - default="en", - help="Specify the language for voice using ISO 639-1 code (default: auto)", - ) group.add_argument( "--just-check-update", action="store_true", @@ -630,6 +614,22 @@ def get_parser(default_config_files, git_root): help="Enable/disable suggesting shell commands (default: True)", ) + ########## + group = parser.add_argument_group("Voice Settings") + group.add_argument( + "--voice-format", + metavar="VOICE_FORMAT", + default="wav", + choices=["wav", "mp3", "webm"], + help="Audio format for voice recording (default: wav). webm and mp3 require ffmpeg", + ) + group.add_argument( + "--voice-language", + metavar="VOICE_LANGUAGE", + default="en", + help="Specify the language for voice using ISO 639-1 code (default: auto)", + ) + return parser From 1de8c13974af4a65d94d087e4e5148d53b396212 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 23 Sep 2024 10:30:22 -0700 Subject: [PATCH 111/149] copy --- aider/website/assets/sample.aider.conf.yml | 41 ++++++----- aider/website/assets/sample.env | 41 ++++++----- aider/website/docs/config/aider_conf.md | 41 ++++++----- aider/website/docs/config/dotenv.md | 41 ++++++----- aider/website/docs/config/options.md | 68 ++++++++++--------- aider/website/docs/troubleshooting/imports.md | 21 +++--- 6 files changed, 150 insertions(+), 103 deletions(-) diff --git a/aider/website/assets/sample.aider.conf.yml b/aider/website/assets/sample.aider.conf.yml index 220c80179..ccee5d16d 100644 --- a/aider/website/assets/sample.aider.conf.yml +++ b/aider/website/assets/sample.aider.conf.yml @@ -89,11 +89,14 @@ ## Only work with models that have meta-data available (default: True) #show-model-warnings: true -## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) -#map-tokens: xxx +## Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens. +#max-chat-history-tokens: xxx -## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) -#map-refresh: auto +## Specify the .env file to load (default: .env in git root) +#env-file: .env + +################# +# Cache Settings: ## Enable caching of prompts (default: False) #cache-prompts: false @@ -101,15 +104,18 @@ ## Number of times to ping at 5min intervals to keep prompt cache warm (default: 0) #cache-keepalive-pings: false +################### +# Repomap Settings: + +## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) +#map-tokens: xxx + +## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) +#map-refresh: auto + ## Multiplier for map tokens when no files are specified (default: 2) #map-multiplier-no-files: true -## Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens. -#max-chat-history-tokens: xxx - -## Specify the .env file to load (default: .env in git root) -#env-file: .env - ################ # History Files: @@ -242,12 +248,6 @@ ## Use VI editing mode in the terminal (default: False) #vim: false -## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg -#voice-format: wav - -## Specify the language for voice using ISO 639-1 code (default: auto) -#voice-language: en - ## Specify the language to use in the chat (default: None, uses system settings) #chat-language: xxx @@ -301,3 +301,12 @@ ## Enable/disable suggesting shell commands (default: True) #suggest-shell-commands: true + +################# +# Voice Settings: + +## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg +#voice-format: wav + +## Specify the language for voice using ISO 639-1 code (default: auto) +#voice-language: en diff --git a/aider/website/assets/sample.env b/aider/website/assets/sample.env index 2612d4fa6..c9c851bf1 100644 --- a/aider/website/assets/sample.env +++ b/aider/website/assets/sample.env @@ -93,11 +93,14 @@ ## Only work with models that have meta-data available (default: True) #AIDER_SHOW_MODEL_WARNINGS=true -## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) -#AIDER_MAP_TOKENS= +## Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens. +#AIDER_MAX_CHAT_HISTORY_TOKENS= -## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) -#AIDER_MAP_REFRESH=auto +## Specify the .env file to load (default: .env in git root) +#AIDER_ENV_FILE=.env + +################# +# Cache Settings: ## Enable caching of prompts (default: False) #AIDER_CACHE_PROMPTS=false @@ -105,15 +108,18 @@ ## Number of times to ping at 5min intervals to keep prompt cache warm (default: 0) #AIDER_CACHE_KEEPALIVE_PINGS=false +################### +# Repomap Settings: + +## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) +#AIDER_MAP_TOKENS= + +## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) +#AIDER_MAP_REFRESH=auto + ## Multiplier for map tokens when no files are specified (default: 2) #AIDER_MAP_MULTIPLIER_NO_FILES=true -## Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens. -#AIDER_MAX_CHAT_HISTORY_TOKENS= - -## Specify the .env file to load (default: .env in git root) -#AIDER_ENV_FILE=.env - ################ # History Files: @@ -240,12 +246,6 @@ ## Use VI editing mode in the terminal (default: False) #AIDER_VIM=false -## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg -#AIDER_VOICE_FORMAT=wav - -## Specify the language for voice using ISO 639-1 code (default: auto) -#AIDER_VOICE_LANGUAGE=en - ## Specify the language to use in the chat (default: None, uses system settings) #AIDER_CHAT_LANGUAGE= @@ -293,3 +293,12 @@ ## Enable/disable suggesting shell commands (default: True) #AIDER_SUGGEST_SHELL_COMMANDS=true + +################# +# Voice Settings: + +## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg +#AIDER_VOICE_FORMAT=wav + +## Specify the language for voice using ISO 639-1 code (default: auto) +#AIDER_VOICE_LANGUAGE=en diff --git a/aider/website/docs/config/aider_conf.md b/aider/website/docs/config/aider_conf.md index 2e05b86e5..711e8fc36 100644 --- a/aider/website/docs/config/aider_conf.md +++ b/aider/website/docs/config/aider_conf.md @@ -137,11 +137,14 @@ cog.outl("```") ## Only work with models that have meta-data available (default: True) #show-model-warnings: true -## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) -#map-tokens: xxx +## Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens. +#max-chat-history-tokens: xxx -## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) -#map-refresh: auto +## Specify the .env file to load (default: .env in git root) +#env-file: .env + +################# +# Cache Settings: ## Enable caching of prompts (default: False) #cache-prompts: false @@ -149,15 +152,18 @@ cog.outl("```") ## Number of times to ping at 5min intervals to keep prompt cache warm (default: 0) #cache-keepalive-pings: false +################### +# Repomap Settings: + +## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) +#map-tokens: xxx + +## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) +#map-refresh: auto + ## Multiplier for map tokens when no files are specified (default: 2) #map-multiplier-no-files: true -## Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens. -#max-chat-history-tokens: xxx - -## Specify the .env file to load (default: .env in git root) -#env-file: .env - ################ # History Files: @@ -290,12 +296,6 @@ cog.outl("```") ## Use VI editing mode in the terminal (default: False) #vim: false -## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg -#voice-format: wav - -## Specify the language for voice using ISO 639-1 code (default: auto) -#voice-language: en - ## Specify the language to use in the chat (default: None, uses system settings) #chat-language: xxx @@ -349,5 +349,14 @@ cog.outl("```") ## Enable/disable suggesting shell commands (default: True) #suggest-shell-commands: true + +################# +# Voice Settings: + +## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg +#voice-format: wav + +## Specify the language for voice using ISO 639-1 code (default: auto) +#voice-language: en ``` diff --git a/aider/website/docs/config/dotenv.md b/aider/website/docs/config/dotenv.md index b9d34a513..10805d923 100644 --- a/aider/website/docs/config/dotenv.md +++ b/aider/website/docs/config/dotenv.md @@ -135,11 +135,14 @@ cog.outl("```") ## Only work with models that have meta-data available (default: True) #AIDER_SHOW_MODEL_WARNINGS=true -## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) -#AIDER_MAP_TOKENS= +## Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens. +#AIDER_MAX_CHAT_HISTORY_TOKENS= -## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) -#AIDER_MAP_REFRESH=auto +## Specify the .env file to load (default: .env in git root) +#AIDER_ENV_FILE=.env + +################# +# Cache Settings: ## Enable caching of prompts (default: False) #AIDER_CACHE_PROMPTS=false @@ -147,15 +150,18 @@ cog.outl("```") ## Number of times to ping at 5min intervals to keep prompt cache warm (default: 0) #AIDER_CACHE_KEEPALIVE_PINGS=false +################### +# Repomap Settings: + +## Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) +#AIDER_MAP_TOKENS= + +## Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) +#AIDER_MAP_REFRESH=auto + ## Multiplier for map tokens when no files are specified (default: 2) #AIDER_MAP_MULTIPLIER_NO_FILES=true -## Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens. -#AIDER_MAX_CHAT_HISTORY_TOKENS= - -## Specify the .env file to load (default: .env in git root) -#AIDER_ENV_FILE=.env - ################ # History Files: @@ -282,12 +288,6 @@ cog.outl("```") ## Use VI editing mode in the terminal (default: False) #AIDER_VIM=false -## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg -#AIDER_VOICE_FORMAT=wav - -## Specify the language for voice using ISO 639-1 code (default: auto) -#AIDER_VOICE_LANGUAGE=en - ## Specify the language to use in the chat (default: None, uses system settings) #AIDER_CHAT_LANGUAGE= @@ -335,6 +335,15 @@ cog.outl("```") ## Enable/disable suggesting shell commands (default: True) #AIDER_SUGGEST_SHELL_COMMANDS=true + +################# +# Voice Settings: + +## Audio format for voice recording (default: wav). webm and mp3 require ffmpeg +#AIDER_VOICE_FORMAT=wav + +## Specify the language for voice using ISO 639-1 code (default: auto) +#AIDER_VOICE_LANGUAGE=en ``` diff --git a/aider/website/docs/config/options.md b/aider/website/docs/config/options.md index c6003c166..5d10eaa94 100644 --- a/aider/website/docs/config/options.md +++ b/aider/website/docs/config/options.md @@ -35,10 +35,10 @@ usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model] [--verify-ssl | --no-verify-ssl] [--edit-format] [--weak-model] [--show-model-warnings | --no-show-model-warnings] - [--map-tokens] [--map-refresh] - [--cache-prompts | --no-cache-prompts] - [--cache-keepalive-pings] [--map-multiplier-no-files] [--max-chat-history-tokens] [--env-file] + [--cache-prompts | --no-cache-prompts] + [--cache-keepalive-pings] [--map-tokens] + [--map-refresh] [--map-multiplier-no-files] [--input-history-file] [--chat-history-file] [--restore-chat-history | --no-restore-chat-history] [--llm-history-file] [--dark-mode] [--light-mode] @@ -57,14 +57,14 @@ usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model] [--commit] [--commit-prompt] [--dry-run | --no-dry-run] [--lint] [--lint-cmd] [--auto-lint | --no-auto-lint] [--test-cmd] [--auto-test | --no-auto-test] [--test] - [--file] [--read] [--vim] [--voice-format] - [--voice-language] [--chat-language] [--version] + [--file] [--read] [--vim] [--chat-language] [--version] [--just-check-update] [--check-update | --no-check-update] [--install-main-branch] [--upgrade] [--apply] [--yes] [-v] [--show-repo-map] [--show-prompts] [--exit] [--message] [--message-file] [--encoding] [-c] [--gui] [--suggest-shell-commands | --no-suggest-shell-commands] + [--voice-format] [--voice-language] ``` @@ -196,14 +196,16 @@ Aliases: - `--show-model-warnings` - `--no-show-model-warnings` -### `--map-tokens VALUE` -Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) -Environment variable: `AIDER_MAP_TOKENS` +### `--max-chat-history-tokens VALUE` +Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens. +Environment variable: `AIDER_MAX_CHAT_HISTORY_TOKENS` -### `--map-refresh VALUE` -Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) -Default: auto -Environment variable: `AIDER_MAP_REFRESH` +### `--env-file ENV_FILE` +Specify the .env file to load (default: .env in git root) +Default: .env +Environment variable: `AIDER_ENV_FILE` + +## Cache Settings: ### `--cache-prompts` Enable caching of prompts (default: False) @@ -218,20 +220,22 @@ Number of times to ping at 5min intervals to keep prompt cache warm (default: 0) Default: 0 Environment variable: `AIDER_CACHE_KEEPALIVE_PINGS` +## Repomap Settings: + +### `--map-tokens VALUE` +Suggested number of tokens to use for repo map, use 0 to disable (default: 1024) +Environment variable: `AIDER_MAP_TOKENS` + +### `--map-refresh VALUE` +Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) +Default: auto +Environment variable: `AIDER_MAP_REFRESH` + ### `--map-multiplier-no-files VALUE` Multiplier for map tokens when no files are specified (default: 2) Default: 2 Environment variable: `AIDER_MAP_MULTIPLIER_NO_FILES` -### `--max-chat-history-tokens VALUE` -Maximum number of tokens to use for chat history. If not specified, uses the model's max_chat_history_tokens. -Environment variable: `AIDER_MAX_CHAT_HISTORY_TOKENS` - -### `--env-file ENV_FILE` -Specify the .env file to load (default: .env in git root) -Default: .env -Environment variable: `AIDER_ENV_FILE` - ## History Files: ### `--input-history-file INPUT_HISTORY_FILE` @@ -464,16 +468,6 @@ Use VI editing mode in the terminal (default: False) Default: False Environment variable: `AIDER_VIM` -### `--voice-format VOICE_FORMAT` -Audio format for voice recording (default: wav). webm and mp3 require ffmpeg -Default: wav -Environment variable: `AIDER_VOICE_FORMAT` - -### `--voice-language VOICE_LANGUAGE` -Specify the language for voice using ISO 639-1 code (default: auto) -Default: en -Environment variable: `AIDER_VOICE_LANGUAGE` - ### `--chat-language CHAT_LANGUAGE` Specify the language to use in the chat (default: None, uses system settings) Environment variable: `AIDER_CHAT_LANGUAGE` @@ -579,4 +573,16 @@ Environment variable: `AIDER_SUGGEST_SHELL_COMMANDS` Aliases: - `--suggest-shell-commands` - `--no-suggest-shell-commands` + +## Voice Settings: + +### `--voice-format VOICE_FORMAT` +Audio format for voice recording (default: wav). webm and mp3 require ffmpeg +Default: wav +Environment variable: `AIDER_VOICE_FORMAT` + +### `--voice-language VOICE_LANGUAGE` +Specify the language for voice using ISO 639-1 code (default: auto) +Default: en +Environment variable: `AIDER_VOICE_LANGUAGE` diff --git a/aider/website/docs/troubleshooting/imports.md b/aider/website/docs/troubleshooting/imports.md index 6773cba76..4caad8902 100644 --- a/aider/website/docs/troubleshooting/imports.md +++ b/aider/website/docs/troubleshooting/imports.md @@ -3,16 +3,19 @@ parent: Troubleshooting nav_order: 28 --- -# Import errors +# Dependency versions Aider expects to be installed via `pip` or `pipx`, which will install -all of its required dependencies. -If aider reports `ImportErrors`, this probably means it has been installed -incorrectly. +correct versions of all of its required dependencies. + +If you've been linked to this doc from a GitHub issue, +or if aider is reporting `ImportErrors` +it is likely that your +aider install is using incorrect dependencies. ## Install with pipx -If you are having problems with import errors you should consider +If you are having dependency problems you should consider [installing aider using pipx](/docs/install/pipx.html). This will ensure that aider is installed in its own python environment, with the correct set of dependencies. @@ -21,9 +24,11 @@ with the correct set of dependencies. Package managers often install aider with the wrong dependencies, leading to import errors and other problems. -It is not recommended to install aider with these tools. -Instead, consider -[installing aider using pipx](/docs/install/pipx.html). +The recommended way to +install aider is with +[pip](/docs/install/install.html) +or +[pipx](/docs/install/pipx.html). ## Dependency versions matter From ba0a328196396243e51db63335846633993dde5d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 23 Sep 2024 11:28:17 -0700 Subject: [PATCH 112/149] fix: Disable SSL verification for LiteLLM client sessions --- aider/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aider/main.py b/aider/main.py index 81783692f..d83c921c6 100644 --- a/aider/main.py +++ b/aider/main.py @@ -376,8 +376,10 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F if not args.verify_ssl: import httpx + os.environ["SSL_VERIFY"] = "" litellm._load_litellm() litellm._lazy_module.client_session = httpx.Client(verify=False) + litellm._lazy_module.aclient_session = httpx.AsyncClient(verify=False) if args.dark_mode: args.user_input_color = "#32FF32" From d518493bb9bee07e8d476206752c774969beee6a Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 23 Sep 2024 11:32:52 -0700 Subject: [PATCH 113/149] fix: Update model sanity check output format --- aider/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/models.py b/aider/models.py index 744515336..d051f2754 100644 --- a/aider/models.py +++ b/aider/models.py @@ -851,7 +851,7 @@ def sanity_check_model(io, model): io.tool_warning(f"Warning: {model} expects these environment variables") for key in model.missing_keys: value = os.environ.get(key, "") - status = "✓ Set" if value else "✗ Not set" + status = "Set" if value else "Not set" io.tool_output(f"- {key}: {status}") if platform.system() == "Windows" or True: From 924eeb43de2f1b0a673fd3fb0a0b55968437d7d2 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 23 Sep 2024 11:34:49 -0700 Subject: [PATCH 114/149] fix: Update test assertions for API key checks --- tests/basic/test_models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/basic/test_models.py b/tests/basic/test_models.py index 0cac3fddc..330fa79a5 100644 --- a/tests/basic/test_models.py +++ b/tests/basic/test_models.py @@ -42,8 +42,8 @@ class TestModels(unittest.TestCase): mock_io.tool_output.assert_called() calls = mock_io.tool_output.call_args_list - self.assertIn("- API_KEY1: ✓ Set", str(calls)) - self.assertIn("- API_KEY2: ✓ Set", str(calls)) + self.assertIn("- API_KEY1: Set", str(calls)) + self.assertIn("- API_KEY2: Set", str(calls)) @patch("os.environ") def test_sanity_check_model_not_set(self, mock_environ): @@ -59,8 +59,8 @@ class TestModels(unittest.TestCase): mock_io.tool_output.assert_called() calls = mock_io.tool_output.call_args_list - self.assertIn("- API_KEY1: ✗ Not set", str(calls)) - self.assertIn("- API_KEY2: ✗ Not set", str(calls)) + self.assertIn("- API_KEY1: Not set", str(calls)) + self.assertIn("- API_KEY2: Not set", str(calls)) if __name__ == "__main__": From 25c3a959ddbe8746c5369de8c341853e38605b74 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 11:35:27 -0700 Subject: [PATCH 115/149] fix: Handle OSError when loading dotenv files --- aider/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aider/main.py b/aider/main.py index d83c921c6..a8e0722fb 100644 --- a/aider/main.py +++ b/aider/main.py @@ -278,6 +278,8 @@ def load_dotenv_files(git_root, dotenv_fname, encoding="utf-8"): try: load_dotenv(fname, override=True, encoding=encoding) loaded.append(fname) + except OSError as e: + print(f"OSError loading {fname}: {e}") except Exception as e: print(f"Error loading {fname}: {e}") return loaded From d063be23c9d1888548eb2ca6ff615d6d0081d5d6 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 23 Sep 2024 11:36:49 -0700 Subject: [PATCH 116/149] fix: Improve error handling in load_dotenv_files function --- aider/main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aider/main.py b/aider/main.py index a8e0722fb..6c45c3373 100644 --- a/aider/main.py +++ b/aider/main.py @@ -274,14 +274,14 @@ def load_dotenv_files(git_root, dotenv_fname, encoding="utf-8"): ) loaded = [] for fname in dotenv_files: - if Path(fname).exists(): - try: + try: + if Path(fname).exists(): load_dotenv(fname, override=True, encoding=encoding) loaded.append(fname) - except OSError as e: - print(f"OSError loading {fname}: {e}") - except Exception as e: - print(f"Error loading {fname}: {e}") + except OSError as e: + print(f"OSError loading {fname}: {e}") + except Exception as e: + print(f"Error loading {fname}: {e}") return loaded From 1fe2be4633eb9fcf02635a44e015809ad34721ea Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 11:38:51 -0700 Subject: [PATCH 117/149] fix: ignore unicode errors in append_chat_history --- aider/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index 897211355..37426bbf6 100644 --- a/aider/io.py +++ b/aider/io.py @@ -626,7 +626,7 @@ class InputOutput: text += "\n" if self.chat_history_file is not None: try: - with self.chat_history_file.open("a", encoding=self.encoding) as f: + with self.chat_history_file.open("a", encoding=self.encoding, errors="ignore") as f: f.write(text) except (PermissionError, OSError): self.tool_error( From 8f583ca1190db4a03605ad3d5634d02e45d2ffc8 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 23 Sep 2024 11:41:28 -0700 Subject: [PATCH 118/149] fix: Handle ValueError when getting relative path in ignored_file_raw --- aider/repo.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/aider/repo.py b/aider/repo.py index b0ff1dd91..f94a49198 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -344,7 +344,13 @@ class GitRepo: def ignored_file_raw(self, fname): if self.subtree_only: fname_path = Path(self.normalize_path(fname)) - cwd_path = Path.cwd().resolve().relative_to(Path(self.root).resolve()) + try: + cwd_path = Path.cwd().resolve().relative_to(Path(self.root).resolve()) + except ValueError: + # Issue #1524 + # ValueError: 'C:\\dev\\squid-certbot' is not in the subpath of 'C:\\dev\\squid-certbot + # Clearly, fname is not under cwd... so ignore it + return True if cwd_path not in fname_path.parents and fname_path != cwd_path: return True From ed1eb38c5fb23f24c47c5cf1ab8475340ea66513 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 11:41:34 -0700 Subject: [PATCH 119/149] fix: Split long comment line in aider/repo.py --- aider/repo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/repo.py b/aider/repo.py index f94a49198..65cd6c7a5 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -348,7 +348,8 @@ class GitRepo: cwd_path = Path.cwd().resolve().relative_to(Path(self.root).resolve()) except ValueError: # Issue #1524 - # ValueError: 'C:\\dev\\squid-certbot' is not in the subpath of 'C:\\dev\\squid-certbot + # ValueError: 'C:\\dev\\squid-certbot' is not in the subpath of + # 'C:\\dev\\squid-certbot' # Clearly, fname is not under cwd... so ignore it return True From a4b79127b073ae4277f71e3bfa87b22adcea0365 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 23 Sep 2024 11:49:16 -0700 Subject: [PATCH 120/149] fix: Handle ZeroDivisionError in PageRank calculation --- aider/repomap.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aider/repomap.py b/aider/repomap.py index 05c6c9729..6e09edbcf 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -398,7 +398,11 @@ class RepoMap: try: ranked = nx.pagerank(G, weight="weight", **pers_args) except ZeroDivisionError: - return [] + # Issue #1536 + try: + ranked = nx.pagerank(G, weight="weight") + except ZeroDivisionError: + return [] # distribute the rank from each source node, across all of its out edges ranked_definitions = defaultdict(float) From 7016ccc15094613a9f1ff48d03aa1eda8964b294 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 23 Sep 2024 12:24:51 -0700 Subject: [PATCH 121/149] chore: Add script to yank old versions --- scripts/yank-old-versions.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 scripts/yank-old-versions.py diff --git a/scripts/yank-old-versions.py b/scripts/yank-old-versions.py new file mode 100644 index 000000000..e69de29bb From ee6cbddf6544134c1ec6e2471ebc7d518f21e291 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 12:24:52 -0700 Subject: [PATCH 122/149] feat: Add script to enumerate PyPI versions supporting Python 3.8 or lower --- scripts/yank-old-versions.py | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/scripts/yank-old-versions.py b/scripts/yank-old-versions.py index e69de29bb..a2a3521d6 100644 --- a/scripts/yank-old-versions.py +++ b/scripts/yank-old-versions.py @@ -0,0 +1,46 @@ +import requests +from packaging import version +from packaging.specifiers import SpecifierSet + +def get_versions_supporting_python38(package_name): + # Fetch package information from PyPI + url = f"https://pypi.org/pypi/{package_name}/json" + response = requests.get(url) + if response.status_code != 200: + print(f"Failed to fetch data for {package_name}") + return [] + + data = response.json() + compatible_versions = [] + + for release, release_data in data['releases'].items(): + if not release_data: # Skip empty releases + continue + + # Check the 'requires_python' field + requires_python = release_data[0].get('requires_python') + + if requires_python is None: + # If 'requires_python' is not specified, assume it's compatible + compatible_versions.append(release) + else: + # Parse the requires_python specifier + try: + spec = SpecifierSet(requires_python) + if version.parse("3.8") in spec: + compatible_versions.append(release) + except ValueError: + print(f"Invalid requires_python specifier for version {release}: {requires_python}") + + return compatible_versions + +def main(): + package_name = "aider-chat" # Replace with your package name + compatible_versions = get_versions_supporting_python38(package_name) + + print(f"Versions of {package_name} compatible with Python 3.8 or lower:") + for v in compatible_versions: + print(v) + +if __name__ == "__main__": + main() From 7a0196e039266651cdb2dfdb1b777615a372199e Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 12:24:55 -0700 Subject: [PATCH 123/149] style: Run linter on Python script --- scripts/yank-old-versions.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/yank-old-versions.py b/scripts/yank-old-versions.py index a2a3521d6..0be55960d 100644 --- a/scripts/yank-old-versions.py +++ b/scripts/yank-old-versions.py @@ -2,6 +2,7 @@ import requests from packaging import version from packaging.specifiers import SpecifierSet + def get_versions_supporting_python38(package_name): # Fetch package information from PyPI url = f"https://pypi.org/pypi/{package_name}/json" @@ -13,13 +14,13 @@ def get_versions_supporting_python38(package_name): data = response.json() compatible_versions = [] - for release, release_data in data['releases'].items(): + for release, release_data in data["releases"].items(): if not release_data: # Skip empty releases continue - + # Check the 'requires_python' field - requires_python = release_data[0].get('requires_python') - + requires_python = release_data[0].get("requires_python") + if requires_python is None: # If 'requires_python' is not specified, assume it's compatible compatible_versions.append(release) @@ -34,6 +35,7 @@ def get_versions_supporting_python38(package_name): return compatible_versions + def main(): package_name = "aider-chat" # Replace with your package name compatible_versions = get_versions_supporting_python38(package_name) @@ -42,5 +44,6 @@ def main(): for v in compatible_versions: print(v) + if __name__ == "__main__": main() From 00662aef549f9f070a5f5c7a5086e6dae91007e6 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 12:26:20 -0700 Subject: [PATCH 124/149] feat: Add Python version support information to yank-old-versions.py --- scripts/yank-old-versions.py | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/scripts/yank-old-versions.py b/scripts/yank-old-versions.py index 0be55960d..39415112a 100644 --- a/scripts/yank-old-versions.py +++ b/scripts/yank-old-versions.py @@ -2,17 +2,16 @@ import requests from packaging import version from packaging.specifiers import SpecifierSet - -def get_versions_supporting_python38(package_name): +def get_python_support_for_versions(package_name): # Fetch package information from PyPI url = f"https://pypi.org/pypi/{package_name}/json" response = requests.get(url) if response.status_code != 200: print(f"Failed to fetch data for {package_name}") - return [] + return {} data = response.json() - compatible_versions = [] + version_support = {} for release, release_data in data["releases"].items(): if not release_data: # Skip empty releases @@ -22,28 +21,27 @@ def get_versions_supporting_python38(package_name): requires_python = release_data[0].get("requires_python") if requires_python is None: - # If 'requires_python' is not specified, assume it's compatible - compatible_versions.append(release) + version_support[release] = "Unspecified (assumed compatible with all versions)" else: - # Parse the requires_python specifier try: spec = SpecifierSet(requires_python) - if version.parse("3.8") in spec: - compatible_versions.append(release) + supported_versions = [] + for py_version in ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]: + if version.parse(py_version) in spec: + supported_versions.append(py_version) + version_support[release] = ", ".join(supported_versions) if supported_versions else "No supported versions found" except ValueError: - print(f"Invalid requires_python specifier for version {release}: {requires_python}") - - return compatible_versions + version_support[release] = f"Invalid specifier: {requires_python}" + return version_support def main(): package_name = "aider-chat" # Replace with your package name - compatible_versions = get_versions_supporting_python38(package_name) - - print(f"Versions of {package_name} compatible with Python 3.8 or lower:") - for v in compatible_versions: - print(v) + version_support = get_python_support_for_versions(package_name) + print(f"Python version support for each release of {package_name}:") + for release, support in sorted(version_support.items(), key=lambda x: version.parse(x[0]), reverse=True): + print(f"{release}: {support}") if __name__ == "__main__": main() From bbeb4749cbcd3cbc12c27318a66fa5c41a18132e Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 12:26:23 -0700 Subject: [PATCH 125/149] style: Run linter --- scripts/yank-old-versions.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/yank-old-versions.py b/scripts/yank-old-versions.py index 39415112a..0ef289068 100644 --- a/scripts/yank-old-versions.py +++ b/scripts/yank-old-versions.py @@ -2,6 +2,7 @@ import requests from packaging import version from packaging.specifiers import SpecifierSet + def get_python_support_for_versions(package_name): # Fetch package information from PyPI url = f"https://pypi.org/pypi/{package_name}/json" @@ -29,19 +30,27 @@ def get_python_support_for_versions(package_name): for py_version in ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]: if version.parse(py_version) in spec: supported_versions.append(py_version) - version_support[release] = ", ".join(supported_versions) if supported_versions else "No supported versions found" + version_support[release] = ( + ", ".join(supported_versions) + if supported_versions + else "No supported versions found" + ) except ValueError: version_support[release] = f"Invalid specifier: {requires_python}" return version_support + def main(): package_name = "aider-chat" # Replace with your package name version_support = get_python_support_for_versions(package_name) print(f"Python version support for each release of {package_name}:") - for release, support in sorted(version_support.items(), key=lambda x: version.parse(x[0]), reverse=True): + for release, support in sorted( + version_support.items(), key=lambda x: version.parse(x[0]), reverse=True + ): print(f"{release}: {support}") + if __name__ == "__main__": main() From c2a35fef05c0cb87a5749e969160685b39ae72e5 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 12:27:10 -0700 Subject: [PATCH 126/149] refactor: Modify script to only show versions compatible with Python 3.8 or lower --- scripts/yank-old-versions.py | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/scripts/yank-old-versions.py b/scripts/yank-old-versions.py index 0ef289068..a55af0458 100644 --- a/scripts/yank-old-versions.py +++ b/scripts/yank-old-versions.py @@ -2,9 +2,7 @@ import requests from packaging import version from packaging.specifiers import SpecifierSet - -def get_python_support_for_versions(package_name): - # Fetch package information from PyPI +def get_versions_supporting_python38_or_lower(package_name): url = f"https://pypi.org/pypi/{package_name}/json" response = requests.get(url) if response.status_code != 200: @@ -12,45 +10,33 @@ def get_python_support_for_versions(package_name): return {} data = response.json() - version_support = {} + compatible_versions = {} for release, release_data in data["releases"].items(): if not release_data: # Skip empty releases continue - # Check the 'requires_python' field requires_python = release_data[0].get("requires_python") if requires_python is None: - version_support[release] = "Unspecified (assumed compatible with all versions)" + compatible_versions[release] = "Unspecified (assumed compatible with Python 3.8 and lower)" else: try: spec = SpecifierSet(requires_python) - supported_versions = [] - for py_version in ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]: - if version.parse(py_version) in spec: - supported_versions.append(py_version) - version_support[release] = ( - ", ".join(supported_versions) - if supported_versions - else "No supported versions found" - ) + if version.parse("3.8") in spec: + compatible_versions[release] = f"Compatible with Python 3.8 (spec: {requires_python})" except ValueError: - version_support[release] = f"Invalid specifier: {requires_python}" - - return version_support + print(f"Invalid requires_python specifier for version {release}: {requires_python}") + return compatible_versions def main(): package_name = "aider-chat" # Replace with your package name - version_support = get_python_support_for_versions(package_name) + compatible_versions = get_versions_supporting_python38_or_lower(package_name) - print(f"Python version support for each release of {package_name}:") - for release, support in sorted( - version_support.items(), key=lambda x: version.parse(x[0]), reverse=True - ): + print(f"Versions of {package_name} compatible with Python 3.8 or lower:") + for release, support in sorted(compatible_versions.items(), key=lambda x: version.parse(x[0]), reverse=True): print(f"{release}: {support}") - if __name__ == "__main__": main() From 3e594877d7f9dec08182d165bbca88af086e3b67 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 23 Sep 2024 12:27:13 -0700 Subject: [PATCH 127/149] style: Run linter on Python script --- scripts/yank-old-versions.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/yank-old-versions.py b/scripts/yank-old-versions.py index a55af0458..ba400277f 100644 --- a/scripts/yank-old-versions.py +++ b/scripts/yank-old-versions.py @@ -2,6 +2,7 @@ import requests from packaging import version from packaging.specifiers import SpecifierSet + def get_versions_supporting_python38_or_lower(package_name): url = f"https://pypi.org/pypi/{package_name}/json" response = requests.get(url) @@ -19,24 +20,32 @@ def get_versions_supporting_python38_or_lower(package_name): requires_python = release_data[0].get("requires_python") if requires_python is None: - compatible_versions[release] = "Unspecified (assumed compatible with Python 3.8 and lower)" + compatible_versions[release] = ( + "Unspecified (assumed compatible with Python 3.8 and lower)" + ) else: try: spec = SpecifierSet(requires_python) if version.parse("3.8") in spec: - compatible_versions[release] = f"Compatible with Python 3.8 (spec: {requires_python})" + compatible_versions[release] = ( + f"Compatible with Python 3.8 (spec: {requires_python})" + ) except ValueError: print(f"Invalid requires_python specifier for version {release}: {requires_python}") return compatible_versions + def main(): package_name = "aider-chat" # Replace with your package name compatible_versions = get_versions_supporting_python38_or_lower(package_name) print(f"Versions of {package_name} compatible with Python 3.8 or lower:") - for release, support in sorted(compatible_versions.items(), key=lambda x: version.parse(x[0]), reverse=True): + for release, support in sorted( + compatible_versions.items(), key=lambda x: version.parse(x[0]), reverse=True + ): print(f"{release}: {support}") + if __name__ == "__main__": main() From 543437dd281471a15640e9396fd0412f803704b6 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 23 Sep 2024 12:48:00 -0700 Subject: [PATCH 128/149] copy --- aider/website/docs/faq.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aider/website/docs/faq.md b/aider/website/docs/faq.md index 53037ad14..2281636cc 100644 --- a/aider/website/docs/faq.md +++ b/aider/website/docs/faq.md @@ -92,6 +92,19 @@ the functionality you want to use in repo B. Then when you're using aider in repo B, you can `/read` in that script. +## How do I turn on the repository map? + +Depending on the LLM you are using, aider may launch with the repo map disabled by default: + +``` +Repo-map: disabled +``` + +This is because weaker models get easily overwhelmed and confused by the content of the +repo map. They sometimes mistakenly think its ok to try and edit the code in the repo map. +The repo map is usually disabled for a good reason. + +If you would like to force it on, you can run aider with `--map-tokens 1024`. ## How can I run aider locally from source code? From 86faaa65ff8577cdcd8d16b541972c3e2200364d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 23 Sep 2024 12:53:10 -0700 Subject: [PATCH 129/149] copy --- aider/website/docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/website/docs/faq.md b/aider/website/docs/faq.md index 2281636cc..b23564127 100644 --- a/aider/website/docs/faq.md +++ b/aider/website/docs/faq.md @@ -101,7 +101,7 @@ Repo-map: disabled ``` This is because weaker models get easily overwhelmed and confused by the content of the -repo map. They sometimes mistakenly think its ok to try and edit the code in the repo map. +repo map. They sometimes mistakenly try to edit the code in the repo map. The repo map is usually disabled for a good reason. If you would like to force it on, you can run aider with `--map-tokens 1024`. From 8422441f74e6c33cd8acabb96b5b30dc4829ea95 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 24 Sep 2024 08:25:28 -0700 Subject: [PATCH 130/149] fix: Skip processing open issues that have been closed and re-opened --- scripts/issues.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/issues.py b/scripts/issues.py index 82763e3a1..2a4f3a10c 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -9,6 +9,13 @@ import requests from dotenv import load_dotenv from tqdm import tqdm +def has_been_reopened(issue_number): + timeline_url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue_number}/timeline" + response = requests.get(timeline_url, headers=headers) + response.raise_for_status() + events = response.json() + return any(event['event'] == 'reopened' for event in events if 'event' in event) + # Load environment variables from .env file load_dotenv() @@ -63,7 +70,7 @@ def group_issues_by_subject(issues): grouped_issues = defaultdict(list) pattern = r"Uncaught .+ in .+ line \d+" for issue in issues: - if re.search(pattern, issue["title"]): + if re.search(pattern, issue["title"]) and not has_been_reopened(issue["number"]): subject = issue["title"] grouped_issues[subject].append(issue) return grouped_issues @@ -74,7 +81,7 @@ def find_oldest_issue(subject, all_issues): oldest_date = datetime.now() for issue in all_issues: - if issue["title"] == subject: + if issue["title"] == subject and not has_been_reopened(issue["number"]): created_at = datetime.strptime(issue["created_at"], "%Y-%m-%dT%H:%M:%SZ") if created_at < oldest_date: oldest_date = created_at @@ -111,7 +118,7 @@ def main(): open_issues = [issue for issue in all_issues if issue["state"] == "open"] grouped_open_issues = group_issues_by_subject(open_issues) - print("Analyzing issues...") + print("Analyzing issues (skipping reopened issues)...") for subject, issues in grouped_open_issues.items(): oldest_issue = find_oldest_issue(subject, all_issues) if not oldest_issue: From 6b5fe9bee342754ffa83222d4919dc3f72cfa465 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 24 Sep 2024 08:25:31 -0700 Subject: [PATCH 131/149] style: Run linter on scripts/issues.py --- scripts/issues.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/issues.py b/scripts/issues.py index 2a4f3a10c..fe282676c 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -9,12 +9,14 @@ import requests from dotenv import load_dotenv from tqdm import tqdm + def has_been_reopened(issue_number): timeline_url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue_number}/timeline" response = requests.get(timeline_url, headers=headers) response.raise_for_status() events = response.json() - return any(event['event'] == 'reopened' for event in events if 'event' in event) + return any(event["event"] == "reopened" for event in events if "event" in event) + # Load environment variables from .env file load_dotenv() From da752bb00c40458db892b90f502bc8c56a924291 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 24 Sep 2024 09:28:13 -0700 Subject: [PATCH 132/149] fix: Suppress warning about missing ffmpeg or avconv --- aider/voice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aider/voice.py b/aider/voice.py index 1334a0a7e..69fe109af 100644 --- a/aider/voice.py +++ b/aider/voice.py @@ -3,9 +3,12 @@ import os import queue import tempfile import time +import warnings from aider.llm import litellm +warnings.filterwarnings("ignore", message="Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work") + try: import soundfile as sf except (OSError, ModuleNotFoundError): From d0e6dc2c1e9e63a62470c911db1a1a9f73753d41 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 24 Sep 2024 09:28:16 -0700 Subject: [PATCH 133/149] style: Wrap long lines in voice.py --- aider/voice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/voice.py b/aider/voice.py index 69fe109af..aca5995ae 100644 --- a/aider/voice.py +++ b/aider/voice.py @@ -7,7 +7,9 @@ import warnings from aider.llm import litellm -warnings.filterwarnings("ignore", message="Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work") +warnings.filterwarnings( + "ignore", message="Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work" +) try: import soundfile as sf From e267dc13afc840c20fcecbabc4c2e54020938c48 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 24 Sep 2024 09:28:28 -0700 Subject: [PATCH 134/149] fix: Move imports to top of file --- aider/voice.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/aider/voice.py b/aider/voice.py index aca5995ae..c60dee69d 100644 --- a/aider/voice.py +++ b/aider/voice.py @@ -6,6 +6,9 @@ import time import warnings from aider.llm import litellm +from prompt_toolkit.shortcuts import prompt +from pydub import AudioSegment +from .dump import dump # noqa: F401 warnings.filterwarnings( "ignore", message="Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work" @@ -16,11 +19,6 @@ try: except (OSError, ModuleNotFoundError): sf = None -from prompt_toolkit.shortcuts import prompt -from pydub import AudioSegment - -from .dump import dump # noqa: F401 - class SoundDeviceError(Exception): pass From ab786279e65adb2484b9465648c7de3b377682b4 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 24 Sep 2024 09:28:31 -0700 Subject: [PATCH 135/149] style: Fix linter warnings --- aider/voice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/voice.py b/aider/voice.py index c60dee69d..a5cae1ca1 100644 --- a/aider/voice.py +++ b/aider/voice.py @@ -5,9 +5,11 @@ import tempfile import time import warnings -from aider.llm import litellm from prompt_toolkit.shortcuts import prompt from pydub import AudioSegment + +from aider.llm import litellm + from .dump import dump # noqa: F401 warnings.filterwarnings( From 3edcd71a446dd7716f8c093cade28067f163dbbe Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 24 Sep 2024 09:29:00 -0700 Subject: [PATCH 136/149] fix: move pydub import to avoid warnings --- aider/voice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/voice.py b/aider/voice.py index a5cae1ca1..47fb49c6e 100644 --- a/aider/voice.py +++ b/aider/voice.py @@ -6,7 +6,6 @@ import time import warnings from prompt_toolkit.shortcuts import prompt -from pydub import AudioSegment from aider.llm import litellm @@ -16,6 +15,8 @@ warnings.filterwarnings( "ignore", message="Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work" ) +from pydub import AudioSegment # noqa + try: import soundfile as sf except (OSError, ModuleNotFoundError): From 7569dea73ccb49a87c3c901b5a1ef56d50c2dbd2 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 24 Sep 2024 09:36:16 -0700 Subject: [PATCH 137/149] restore dynamic graph --- aider/website/docs/leaderboards/index.md | 164 +++++++++++++++++++++-- 1 file changed, 152 insertions(+), 12 deletions(-) diff --git a/aider/website/docs/leaderboards/index.md b/aider/website/docs/leaderboards/index.md index b78060cf6..601b04708 100644 --- a/aider/website/docs/leaderboards/index.md +++ b/aider/website/docs/leaderboards/index.md @@ -55,14 +55,83 @@ The model also has to successfully apply all its changes to the source file with
+ +