Compare commits

...

833 Commits

Author SHA1 Message Date
Paul Gauthier
7729974253 set version to 0.59.2.dev 2024-10-05 12:30:48 -07:00
Paul Gauthier
27bfb3c662 version bump to 0.59.1 2024-10-05 12:29:27 -07:00
Paul Gauthier
3d5a7dce4f copy 2024-10-05 12:28:10 -07:00
Paul Gauthier
2d0de85976 Merge branch 'main' of github.com:Aider-AI/aider 2024-10-05 11:40:19 -07:00
Paul Gauthier (aider)
ea4e58e509 refactor: improve error message matching flexibility 2024-10-05 11:37:15 -07:00
Paul Gauthier (aider)
48272449bb style: remove unused exception variable 2024-10-05 11:36:11 -07:00
Paul Gauthier
989e7c18fb refactor: Simplify config file check and error handling 2024-10-05 11:36:04 -07:00
Paul Gauthier (aider)
c6d1c45abc style: format code with black and adjust line breaks 2024-10-05 11:32:53 -07:00
Paul Gauthier (aider)
57efba2763 refactor: improve config file error handling and messaging 2024-10-05 11:32:48 -07:00
Paul Gauthier
e56df2391d refactor: Simplify error handling in main function 2024-10-05 11:32:47 -07:00
Paul Gauthier (aider)
28fab9548b style: format long lines in main.py 2024-10-05 11:30:46 -07:00
Paul Gauthier (aider)
7d117d05c5 fix: replace io.tool_output with print for early error handling 2024-10-05 11:30:42 -07:00
Paul Gauthier (aider)
a482ef9bfa feat: add error handling for 'yes:' config issue 2024-10-05 11:29:44 -07:00
Paul Gauthier (aider)
f82ab9cc6e feat: add error handling for 'yes:' config issue 2024-10-05 11:28:00 -07:00
paul-gauthier
13141fc733 Merge pull request #1934 from fry69/openrouter-beta-models-fix
fix: add OpenRouter Sonnet-3.5 beta/self-moderated model
2024-10-05 07:13:29 -07:00
fry69
3c7e285182 fix: add OpenRouter Sonnet-3.5 beta/self-moderated model 2024-10-05 16:12:34 +02:00
Paul Gauthier
96cdd95988 refactor: Reorganize charts and update HISTORY.md structure 2024-10-04 15:56:28 -07:00
Paul Gauthier
c10442087b copy 2024-10-04 15:40:43 -07:00
Paul Gauthier
06bd2ace69 set version to 0.59.1.dev 2024-10-04 15:28:29 -07:00
Paul Gauthier
3759340eb4 version bump to 0.59.0 2024-10-04 15:27:13 -07:00
Paul Gauthier
46e182004e copy 2024-10-04 15:25:43 -07:00
Paul Gauthier
e84de1fb5a Revert "test: add DummyInput and DummyOutput to TestHelp setup"
This reverts commit d098a4cd80.
2024-10-04 15:25:22 -07:00
Paul Gauthier
3b9af69dec copy 2024-10-04 15:19:19 -07:00
Paul Gauthier
d098a4cd80 test: add DummyInput and DummyOutput to TestHelp setup 2024-10-04 14:04:02 -07:00
Paul Gauthier
501a304d32 copy 2024-10-04 13:53:07 -07:00
Paul Gauthier
19b6e79719 copy 2024-10-04 13:47:43 -07:00
Paul Gauthier
d77ae7c2ac copy 2024-10-04 13:36:25 -07:00
Paul Gauthier
2b4206fd57 paul-gauthier -> Aider-AI 2024-10-04 13:06:38 -07:00
Paul Gauthier
4ef7022343 copy 2024-10-04 13:00:01 -07:00
Paul Gauthier
1c67ddcbff copy 2024-10-04 12:58:48 -07:00
Paul Gauthier
516e637c39 Update docs github.com/paul-gauthier -> github.com/Aider-AI 2024-10-04 12:53:45 -07:00
Paul Gauthier
d17bd6ebcc move import 2024-10-04 12:51:39 -07:00
Paul Gauthier (aider)
cde45d9fdf style: fix linting issues and add newline 2024-10-04 12:50:38 -07:00
Paul Gauthier (aider)
bfba7e8e73 refactor: move git index version URL to urls.py 2024-10-04 12:50:32 -07:00
Paul Gauthier
f8243b3632 refactor: Move reply_completed call before KeyboardInterrupt handling 2024-10-04 11:46:44 -07:00
Paul Gauthier
7ff2dc89b4 refactor: modify command parsing to use last word only 2024-10-04 11:20:55 -07:00
Paul Gauthier (aider)
0c743ce8e8 feat: sort completions in completions_raw_read_only method 2024-10-04 11:17:47 -07:00
Paul Gauthier
50f88a8d28 copy 2024-10-04 09:37:34 -07:00
Paul Gauthier
ff230554ce chore: Update edit leaderboard with latest model performance data 2024-10-04 09:35:28 -07:00
Paul Gauthier
af10953534 refactor: Improve completion matching for 'add' command 2024-10-03 11:00:18 -07:00
Paul Gauthier (aider)
6093a4c2bb feat: add 'add' command completions to /read-only command 2024-10-03 10:54:26 -07:00
Paul Gauthier
33b45b68e2 copy 2024-10-02 12:03:47 -07:00
Paul Gauthier (aider)
e33e9c44bb fix: import ANY from unittest.mock to resolve undefined name error 2024-10-02 11:21:28 -07:00
Paul Gauthier (aider)
b35bd06eb8 style: format code in test_models.py 2024-10-02 11:21:17 -07:00
Paul Gauthier (aider)
875fb3a178 test: update sanity_check_models_bogus_editor to expect two warnings 2024-10-02 11:21:13 -07:00
Paul Gauthier (aider)
97d6b68613 fix: add missing sanity_check_model import 2024-10-02 11:20:01 -07:00
Paul Gauthier (aider)
21adf405a0 fix: correct imports and model usage in test_models.py 2024-10-02 11:19:38 -07:00
Paul Gauthier (aider)
1a355cbf74 style: format code in test_models.py 2024-10-02 11:19:25 -07:00
Paul Gauthier (aider)
1a3e8b3375 test: update sanity check test to use real Model instances 2024-10-02 11:19:22 -07:00
Paul Gauthier (aider)
da9af264f8 fix: import sanity_check_models in test_models.py 2024-10-02 11:17:53 -07:00
Paul Gauthier (aider)
93cb615ffd test: add test for sanity check with bogus editor model 2024-10-02 11:15:27 -07:00
Paul Gauthier (aider)
7e55a8f684 style: Format code in test_models.py to improve readability 2024-10-02 11:15:09 -07:00
Paul Gauthier (aider)
433223a7fc test: add sanity check for bogus editor model 2024-10-02 11:15:05 -07:00
Paul Gauthier (aider)
1b58e1f6ad style: format code with linter 2024-10-02 11:13:49 -07:00
Paul Gauthier (aider)
03faad3110 refactor: improve sanity_check_models to include editor model check 2024-10-02 11:13:44 -07:00
Paul Gauthier
992600fcb7 fixes #1889 2024-10-02 11:06:19 -07:00
Paul Gauthier
99c3a1ec7f feat: Rename --yes to --yes-always and update config file syntax 2024-10-02 10:55:59 -07:00
Paul Gauthier
d4fe0b18ad rename --yes to --yes-always #767 2024-10-02 10:45:11 -07:00
Paul Gauthier
8dfda27151 copy 2024-10-02 09:30:35 -07:00
Paul Gauthier (aider)
70a509bbea style: Format error message assertion in test_commands.py 2024-10-02 09:21:23 -07:00
Paul Gauthier (aider)
8c45e25724 test: update cmd_read_only test with full path for nonexistent glob 2024-10-02 09:21:17 -07:00
Paul Gauthier (aider)
f12682a0c1 style: Format code and remove whitespace 2024-10-02 09:20:45 -07:00
Paul Gauthier (aider)
79350ab195 test: add glob functionality tests for cmd_read_only method 2024-10-02 09:20:39 -07:00
Paul Gauthier (aider)
ff0bacc984 style: reorder imports and remove whitespace 2024-10-02 09:18:58 -07:00
Paul Gauthier (aider)
d76f7a597e fix: handle tilde expansion in cmd_read_only for home directories 2024-10-02 09:18:53 -07:00
Paul Gauthier (aider)
9ad915f40e style: reorder imports alphabetically in commands.py 2024-10-02 09:16:13 -07:00
Paul Gauthier (aider)
e5b27355b7 feat: use glob for flexible file matching in cmd_read_only 2024-10-02 09:16:08 -07:00
Paul Gauthier (aider)
510fa24ade feat: add --skip-sanity-check-repo switch 2024-10-01 17:31:34 -07:00
Paul Gauthier
72cb5db530 refactor: remove debug print statement for commit_system 2024-10-01 14:25:35 -07:00
Paul Gauthier
8b6b558483 refactor: Optimize cache key generation in RepoMap class 2024-10-01 14:25:27 -07:00
Paul Gauthier
90e42045df copy 2024-10-01 14:23:16 -07:00
Paul Gauthier (aider)
1ff9157c95 style: Format code to comply with linter rules 2024-10-01 14:22:49 -07:00
Paul Gauthier (aider)
cf1e6e65c7 feat: add mentioned_fnames and mentioned_idents to cache key 2024-10-01 14:22:44 -07:00
Paul Gauthier
be5012db96 refactor: improve sorting of ranked definitions 2024-10-01 14:22:43 -07:00
Paul Gauthier
aec8550e56 Merge branch 'main' of github.com:paul-gauthier/aider 2024-10-01 14:20:30 -07:00
Paul Gauthier
1a4ef0f532 fix: Handle OSError when resolving config file path 2024-10-01 14:19:09 -07:00
paul-gauthier
20ab8eb90a Merge pull request #1876 from itlackey/benchmark/ollama-models
Benchmark/ollama models
2024-10-01 14:17:17 -07:00
itlackey
d621d16255 - Added hermes3 2024-10-01 16:06:15 -05:00
itlackey
61bc130464 - Added yi-coder:9b-chat-fp16 2024-10-01 16:06:15 -05:00
itlackey
aa911a847d - Added mistral-small 2024-10-01 16:06:15 -05:00
itlackey
268331d5c0 - Added hermes3:8b-llama3.1-fp16 2024-10-01 16:06:15 -05:00
itlackey
8d4dd5c9de - Added llama3.2:3b-instruct-fp16 2024-10-01 16:06:15 -05:00
itlackey
fb34af4362 - Added qwen2.5:32b 2024-10-01 16:06:15 -05:00
itlackey
e381260932 - Added mistral-nemo:12b-instruct-2407-q4_K_M 2024-10-01 16:06:15 -05:00
itlackey
e2d5f15aff - Added wojtek/opencodeinterpreter:6.7b 2024-10-01 16:06:15 -05:00
itlackey
d4cecf9fd0 - Added codegeex4 2024-10-01 16:06:15 -05:00
paul-gauthier
12578c0388 Merge pull request #1852 from fry69/commit-prompt-fix
fix: enhance commit prompt to ensure one-line with Haiku
2024-10-01 12:19:37 -07:00
Paul Gauthier
9b22d6248a fix: Swap the order of settings and announcements in the output 2024-10-01 11:56:01 -07:00
Paul Gauthier (aider)
729cad640f feat: Add announcements to /settings output 2024-10-01 11:54:28 -07:00
fry69
7a56be174e fix: enhance commit prompt to ensure one-line with Haiku 2024-10-01 10:09:20 +02:00
Paul Gauthier
9789668ca4 copy 2024-09-30 21:21:50 -07:00
Paul Gauthier
9f7aada9c5 copy 2024-09-30 21:21:40 -07:00
Paul Gauthier
51f46393c3 copy 2024-09-30 21:18:20 -07:00
Paul Gauthier
e1029a3858 copy 2024-09-30 21:17:27 -07:00
Paul Gauthier (aider)
51ba096916 feat: implement cog to fetch and process model data 2024-09-30 21:15:09 -07:00
Paul Gauthier
d9c159fe7a feat: Add documentation for infinite output 2024-09-30 21:15:08 -07:00
Paul Gauthier
8ebd519615 copy 2024-09-30 14:28:05 -07:00
Paul Gauthier
bfcba012fa set version to 0.58.2.dev 2024-09-30 14:25:39 -07:00
Paul Gauthier
8f48c68fc6 version bump to 0.58.1 2024-09-30 14:24:18 -07:00
Paul Gauthier
f2e1e17741 avoid stomping extra_params[max_tokens]=1 in cache warming, which causes loop of 1 token infinite-output responses with prefill models #1842 #1841 2024-09-30 14:22:11 -07:00
Paul Gauthier
8fb0362b47 copy 2024-09-30 09:37:47 -07:00
Paul Gauthier
a42587b8de copy 2024-09-30 09:31:50 -07:00
Paul Gauthier
474056a068 copy 2024-09-30 09:25:37 -07:00
Paul Gauthier
adde5e08d0 copy 2024-09-30 08:34:40 -07:00
Paul Gauthier
0aaa37f528 copy 2024-09-29 16:05:00 -07:00
Paul Gauthier
e5862ae81e Merge branch 'main' of github.com:paul-gauthier/aider 2024-09-29 15:50:53 -07:00
Paul Gauthier
485bfa2492 copy 2024-09-29 15:46:32 -07:00
paul-gauthier
d5117921cf Merge pull request #1826 from mario7421/typo-fix 2024-09-29 12:43:51 -07:00
mario7421
98b3f5bbdb Fix typo in diff prompt 2024-09-29 21:07:20 +02:00
paul-gauthier
b73c518eb2 Merge pull request #1823 from fry69/architect-hot-fix 2024-09-29 09:33:55 -07:00
fry69
457b627b67 doc: hotfix for Full results table 2024-09-29 18:15:08 +02:00
Paul Gauthier
53ca83beea copy 2024-09-29 08:31:13 -07:00
Paul Gauthier
53a83734ca set version to 0.58.1.dev 2024-09-29 08:19:48 -07:00
Paul Gauthier
2bdd9360ab version bump to 0.58.0 2024-09-29 08:18:38 -07:00
Paul Gauthier
805e46a1df publish architect 2024-09-29 08:13:22 -07:00
Paul Gauthier
291ef5711d architect graphic 2024-09-29 08:12:30 -07:00
Paul Gauthier
00605e67fb copy 2024-09-29 08:10:13 -07:00
Paul Gauthier
6c6c6076eb copy 2024-09-29 08:09:50 -07:00
Paul Gauthier
b8ec4a5291 Merge branch 'main' of github.com:paul-gauthier/aider 2024-09-29 08:09:18 -07:00
Paul Gauthier
387a9434f8 copy 2024-09-29 08:06:17 -07:00
paul-gauthier
cc01313500 Merge pull request #1807 from itlackey/benchmark/ollama-codestral 2024-09-28 15:49:49 -07:00
Paul Gauthier
0091ab004c fix: Update autocomplete test to handle partial file names 2024-09-28 15:29:54 -07:00
Paul Gauthier (aider)
d647ebf058 fix: remove unused import of Completion in test_io.py 2024-09-28 15:28:29 -07:00
Paul Gauthier (aider)
c2b48b5256 style: format code and improve readability in test_io.py 2024-09-28 15:28:14 -07:00
Paul Gauthier (aider)
d5b8a15410 test: add unit tests for AutoCompleter.get_command_completions method 2024-09-28 15:28:11 -07:00
Paul Gauthier
2139de76fb test: remove unused test for command completions in TestInputOutput class 2024-09-28 15:28:10 -07:00
Paul Gauthier (aider)
e832ee8450 style: format code and run linter on test_io.py 2024-09-28 15:24:18 -07:00
Paul Gauthier (aider)
37236aa907 fix: update test_get_command_completions to match new method signature with Document and CompleteEvent parameters 2024-09-28 15:24:14 -07:00
Paul Gauthier (aider)
4ea68efd0e test: Fix confirm_ask test to handle invalid input and verify call count 2024-09-28 15:19:19 -07:00
Paul Gauthier (aider)
843cc9ee4e style: run linter and fix whitespace in test_io.py 2024-09-28 15:16:59 -07:00
Paul Gauthier (aider)
ec10ead0c3 test: add unit tests for allow_never option in confirm_ask method 2024-09-28 15:16:56 -07:00
Paul Gauthier
b78d19c7a5 copy 2024-09-28 15:15:42 -07:00
Paul Gauthier
97ddcb2ae6 feat: Add autocomplete support for /read-only command 2024-09-28 15:14:35 -07:00
Paul Gauthier (aider)
d1ee3644ec style: run linter and format import statements in io.py 2024-09-28 15:02:37 -07:00
Paul Gauthier (aider)
b9fb59dc3e fix: remove unused import of PathCompleter from aider/io.py 2024-09-28 15:02:33 -07:00
Paul Gauthier (aider)
ad0497dfdf style: run linter and fix code formatting in io.py 2024-09-28 15:02:13 -07:00
Paul Gauthier (aider)
c1642b5eca feat: add "Never" option to confirm_ask and store user choices in never_prompts set 2024-09-28 15:02:09 -07:00
Paul Gauthier
f8746feaa1 fix: Improve warning message for unsupported streaming 2024-09-28 14:55:22 -07:00
Paul Gauthier
40588ccffa copy 2024-09-28 14:55:16 -07:00
Paul Gauthier (aider)
9884d838ea style: run linter and format test_commands.py for improved readability 2024-09-28 14:48:23 -07:00
Paul Gauthier (aider)
384391129d test: add unit test for /copy command with cur_messages present 2024-09-28 14:48:18 -07:00
Paul Gauthier
0819258e0f test: add unit test for handling bad glob in command add 2024-09-28 14:48:17 -07:00
Paul Gauthier (aider)
1e776863ac style: format code and improve linter compliance in test_commands.py 2024-09-28 14:44:04 -07:00
Paul Gauthier (aider)
202a219d82 test: add tests for the /copy command including success, no messages, and exception handling 2024-09-28 14:44:00 -07:00
Paul Gauthier
817530ccb7 fixed regression allowing non-repo files to move from /read to /add 2024-09-28 14:42:07 -07:00
Paul Gauthier
ffd7364410 Merge branch 'main' into path-completer 2024-09-28 14:33:58 -07:00
Paul Gauthier
bebffee3dd Merge branch 'main' of github.com:paul-gauthier/aider 2024-09-28 14:33:25 -07:00
Paul Gauthier
8cb3e523a5 copy 2024-09-28 14:31:49 -07:00
itlackey
228ae24834 added ollama/codestral benchmark 2024-09-28 16:08:49 -05:00
paul-gauthier
ffc7d35145 Merge pull request #1796 from fry69/git-doc-fix 2024-09-28 07:21:38 -07:00
fry69
010f921c53 doc: fix /paste entry in commands.html spilling into new line 2024-09-28 15:11:26 +02:00
fry69
d7d87847a6 doc: small fixes 2024-09-28 08:31:50 +02:00
Paul Gauthier
91307ecfc4 fix: Remove unnecessary call to dump() in InputOutput.read_style() 2024-09-27 19:50:45 -07:00
Paul Gauthier (aider)
1a75b79c81 fix: change default values for completion menu arguments to None in InputOutput.__init__ method 2024-09-27 19:49:53 -07:00
Paul Gauthier
3ff5f280bb fix: add dump function call to style dictionary processing in InputOutput class 2024-09-27 19:49:52 -07:00
Paul Gauthier (aider)
e465cda5c8 fix: change default values for completion menu arguments from "default" to None in aider/args.py 2024-09-27 19:49:17 -07:00
Paul Gauthier (aider)
2d5db0dc23 style: format code with linter adjustments 2024-09-27 19:47:45 -07:00
Paul Gauthier (aider)
537f5a1f98 fix: update _get_style method to conditionally add completion menu styles based on non-null values 2024-09-27 19:47:41 -07:00
Paul Gauthier
ede3cbb372 refactor: simplify _get_style method in InputOutput class 2024-09-27 19:47:40 -07:00
Paul Gauthier (aider)
d3908ca971 fix: update style dictionary and simplify style retrieval in get_input method 2024-09-27 19:45:14 -07:00
Paul Gauthier (aider)
725b5f7063 feat: centralize pygments.literal.string style configuration in _get_style method and simplify calling code 2024-09-27 19:45:04 -07:00
Paul Gauthier (aider)
fd9dc9e8d2 style: format linter adjustments in io.py for better readability 2024-09-27 19:44:23 -07:00
Paul Gauthier (aider)
c5fb25eec3 fix: correct SEARCH/REPLACE block in aider/io.py to match existing lines exactly 2024-09-27 19:44:20 -07:00
Paul Gauthier (aider)
d2e0d3c06d refactor: ensure _get_style always returns a dictionary and simplify calling code 2024-09-27 19:44:14 -07:00
Paul Gauthier (aider)
1cd5b11b5c style: fix linter issues in io.py 2024-09-27 19:43:34 -07:00
Paul Gauthier (aider)
b16050211c fix: fix line length issue in _get_style method by breaking long string into multiple lines 2024-09-27 19:43:30 -07:00
Paul Gauthier (aider)
0a558682d8 style: format linter adjustments in io.py for better readability 2024-09-27 19:43:16 -07:00
Paul Gauthier (aider)
bff1b3de9c refactor: centralize completion menu styles in _get_style method to reduce code duplication 2024-09-27 19:43:12 -07:00
Paul Gauthier (aider)
cf46d9cdd0 style: run linter and format completion menu style definitions 2024-09-27 19:41:56 -07:00
Paul Gauthier (aider)
2c084d65d9 refactor: centralize style creation logic by introducing _get_style method in InputOutput class 2024-09-27 19:41:51 -07:00
Paul Gauthier (aider)
41d5b284e3 fix: resolve syntax errors in commands.py and improve file handling logic 2024-09-27 19:31:43 -07:00
Paul Gauthier (aider)
45d94b1c7c fix: handle file status correctly in /add and _add_read_only_file commands 2024-09-27 19:30:20 -07:00
Paul Gauthier (aider)
2509f0704f style: Fix formatting in commands.py 2024-09-27 17:10:10 -07:00
Paul Gauthier (aider)
1f56118c99 feat: Simplify completions_raw_read_only method 2024-09-27 17:10:05 -07:00
Paul Gauthier
38d03bca09 fix: Rename _old_completions_add to completions_add 2024-09-27 17:10:04 -07:00
Paul Gauthier (aider)
731f312731 fix: remove unused import of 'shlex' 2024-09-27 17:06:32 -07:00
Paul Gauthier
635a800032 fix: Quote file names with spaces in completions 2024-09-27 17:06:27 -07:00
Paul Gauthier (aider)
87da3a7132 fix: adjust start_position for quoted filename completions in completions_raw_read_only method 2024-09-27 16:53:15 -07:00
Paul Gauthier
eef97e4938 fix: remove redundant import of shlex in commands.py 2024-09-27 16:53:14 -07:00
Paul Gauthier (aider)
36bc8f90db fix: properly quote filenames with spaces and special characters using shlex.quote() 2024-09-27 16:52:06 -07:00
Paul Gauthier (aider)
c4e766a4c4 style: run linter and reorder import statements in commands.py 2024-09-27 16:51:01 -07:00
Paul Gauthier (aider)
8bb9bbef19 feat: modify PathCompleter to quote filenames with spaces in completions 2024-09-27 16:50:57 -07:00
Paul Gauthier
2a79723336 refactor: rename completions_add method to _old_completions_add for clarity 2024-09-27 16:50:57 -07:00
Paul Gauthier
542afbeb74 fix: Use self.coder.root instead of self.root in get_paths function 2024-09-27 16:48:55 -07:00
Paul Gauthier (aider)
9644546a65 feat: add get_paths function to PathCompleter for starting from self.root if not None 2024-09-27 16:47:47 -07:00
Paul Gauthier
79e0b80f34 Merge branch 'main' into path-completer 2024-09-27 16:46:24 -07:00
Paul Gauthier
7e4e6782d1 fix: set max_tokens to 1 for cache warming 2024-09-27 16:46:03 -07:00
Paul Gauthier (aider)
aab01086a2 style: fix formatting in base_coder.py 2024-09-27 16:43:24 -07:00
Paul Gauthier (aider)
f7818c6994 feat: Use **kwargs for extra_params in warm_cache_worker 2024-09-27 16:43:18 -07:00
Paul Gauthier
22c60cad1a refactor: Replace extra_params with extra_headers in cache warming request 2024-09-27 16:43:17 -07:00
Paul Gauthier
237ee1c5a1 Merge branch 'main' into path-completer 2024-09-27 16:40:53 -07:00
Paul Gauthier (aider)
87e4010b8b style: Run linter 2024-09-27 16:39:42 -07:00
Paul Gauthier (aider)
7830dadccf fix: Remove unused imports in aider/commands.py 2024-09-27 16:39:37 -07:00
Paul Gauthier (aider)
6287bf37e5 feat: Implement partial prefix matching for /read-only command in completions_raw_read_only method 2024-09-27 16:39:26 -07:00
Paul Gauthier
369310a7c3 fix: Remove commented-out code in PathCompleter configuration 2024-09-27 16:39:25 -07:00
Paul Gauthier (aider)
7e1497e114 style: Run linter and fix code formatting issues in commands.py 2024-09-27 16:35:27 -07:00
Paul Gauthier (aider)
57257b7c15 fix: correct indentation error in completions_raw_read_only method in aider/commands.py 2024-09-27 16:35:22 -07:00
Paul Gauthier (aider)
68c4817c14 fix: adjust completions_raw_read_only to process only file path input for correct path completions 2024-09-27 16:34:55 -07:00
Paul Gauthier (aider)
c35a41466b fix: correct completions_raw_read_only method to yield all path completions without unnecessary filtering 2024-09-27 16:25:39 -07:00
Paul Gauthier
bb740f3004 refactor: Replace extra_headers with extra_params in cache warming request 2024-09-27 16:22:17 -07:00
Paul Gauthier
c745d0dc38 wip 2024-09-27 16:21:18 -07:00
Paul Gauthier (aider)
9c5ef0b41a style: run linter 2024-09-27 16:17:41 -07:00
Paul Gauthier (aider)
2d3605156e feat: Implement file path completion for read-only command 2024-09-27 16:17:37 -07:00
Paul Gauthier
8e276939a7 feat: Implement completions_raw_read_only method
diff --git a/aider/commands.py b/aider/commands.py
index 80dd81dd..d4d4d4d1 100644
--- a/aider/commands.py
+++ b/aider/commands.py
@@ -580,7 +580,31 @@ class Commands:
         return fname

     def completions_raw_read_only(self, document, complete_event):
-        pass
+        # Extract the part of the input after the command
+        text = document.text[len("/read-only") :].lstrip()
+
+        # Create a PathCompleter
+        path_completer = PathCompleter(
+            only_directories=False,
+            expanduser=True,
+            get_paths=lambda: [self.coder.root],
+        )
+
+        # Create a new Document object with the modified text
+        new_document = Document(text, cursor_position=len(text))
+
+        # Get completions from the PathCompleter
+        completions = path_completer.get_completions(new_document, complete_event)
+
+        # Yield the completions
+        for completion in completions:
+            # Adjust the start position to account for the command
+            yield Completion(
+                completion.text,
+                start_position=completion.start_position - len(document.text) + len(text),
+                display=completion.display,
+                display_meta=completion.display_meta,
+            )

     def completions_add(self):
         files = set(self.coder.get_all_relative_files())
2024-09-27 16:17:35 -07:00
Paul Gauthier (aider)
c2afdcfdb9 fix: Create new Document object for path completion in completions_raw_read_only 2024-09-27 16:10:16 -07:00
Paul Gauthier
8e02cadfbc fix: Ensure command starts with slash before retrieving raw completions 2024-09-27 16:10:14 -07:00
Paul Gauthier (aider)
0a77b6cfac feat: Add Completion import to aider/commands.py 2024-09-27 16:07:35 -07:00
Paul Gauthier (aider)
f8390a889b style: Ran the linter 2024-09-27 16:06:44 -07:00
Paul Gauthier (aider)
b930a1db40 feat: Add raw completer for cmd_read_only command 2024-09-27 16:06:39 -07:00
Paul Gauthier (aider)
ee4de6bd1c feat: Add get_raw_completions method to Commands class 2024-09-27 16:05:40 -07:00
Paul Gauthier (aider)
6c2c3942bf feat: Add document and complete_event parameters to get_command_completions 2024-09-27 16:04:17 -07:00
Paul Gauthier
3ec0861727 fix: Add support for raw completers in AutoCompleter 2024-09-27 16:04:16 -07:00
Paul Gauthier (aider)
37b512e4fc feat: Update get_command_completions and get_completions methods 2024-09-27 15:59:56 -07:00
Paul Gauthier
01437fa58c copy 2024-09-27 14:29:35 -07:00
Paul Gauthier
927d03cc37 copy 2024-09-27 14:28:53 -07:00
Paul Gauthier (aider)
114fb2a889 style: Improve code formatting and readability 2024-09-27 14:26:56 -07:00
Paul Gauthier (aider)
f95c4626cf fix: Handle clipboard copy errors in cmd_copy 2024-09-27 14:26:50 -07:00
Paul Gauthier (aider)
11db5d95a0 feat: Add /copy command to copy last assistant message 2024-09-27 14:25:22 -07:00
Paul Gauthier (aider)
7d79dd00af style: Improve code formatting and readability 2024-09-27 14:21:43 -07:00
Paul Gauthier (aider)
0c470662bb feat: Add /copy command to copy last assistant message to clipboard 2024-09-27 14:21:37 -07:00
Paul Gauthier
7c1318274e Revert "feat: include non-repo files for completing /read"
This reverts commit d2fbc92507.
2024-09-27 13:17:36 -07:00
Paul Gauthier
a766395651 Merge branch 'main' of github.com:paul-gauthier/aider 2024-09-27 13:16:15 -07:00
paul-gauthier
2dfc47f5c6 Merge pull request #1757 from jbellis/read-nonrepo
feat: include non-repo files for completing /read
2024-09-27 13:15:23 -07:00
Paul Gauthier
48bd616092 copy 2024-09-27 13:10:41 -07:00
Paul Gauthier
810aeccf94 fix: Replace extra_headers and extra_body with extra_params in Coder, ChatSummary, and GitRepo 2024-09-27 13:09:43 -07:00
Paul Gauthier (aider)
c24e947b18 style: Run linter 2024-09-27 13:02:47 -07:00
Paul Gauthier (aider)
74f615bbb4 feat: Consolidate extra parameters in sendchat.py 2024-09-27 13:02:44 -07:00
Paul Gauthier (aider)
eb0331baed feat: wrap max_tokens in extra_params for ModelSettings 2024-09-27 13:01:20 -07:00
Paul Gauthier (aider)
c3e44b498d feat: update ModelSettings in aider/models.py 2024-09-27 12:58:45 -07:00
Paul Gauthier (aider)
58c856505b feat: Add extra_params field to ModelSettings class and update instances 2024-09-27 12:58:21 -07:00
Paul Gauthier
932aaea845 copy 2024-09-27 12:56:47 -07:00
Paul Gauthier
d50d97ab26 Merge branch 'main' of github.com:paul-gauthier/aider 2024-09-27 12:32:09 -07:00
Paul Gauthier
3c8f15f924 copy 2024-09-27 12:32:03 -07:00
paul-gauthier
c2c4dbd2a8 Merge pull request #1595 from jbellis/paste
feat: rename /clipboard to /paste
2024-09-27 12:31:53 -07:00
paul-gauthier
04d6fc5ef4 Merge pull request #1742 from rti/fix-apply-tool-warning-color
fix(InputOutput): apply tool warning color
2024-09-27 12:29:49 -07:00
Paul Gauthier (aider)
b2549a78bd fix: Move imports to top of file 2024-09-27 12:25:10 -07:00
Paul Gauthier
3b9f561956 fix: Refactor code to handle exceptions more gracefully 2024-09-27 12:25:02 -07:00
Paul Gauthier (aider)
6ab1fdfe36 fix: fix indentation error in get_index function in aider/help.py 2024-09-27 12:23:09 -07:00
Paul Gauthier (aider)
8b0314ae77 style: run linter and fix formatting issues in aider/help.py 2024-09-27 12:22:12 -07:00
Paul Gauthier (aider)
cb1f6f2e3a fix: handle exceptions during index loading and recreate cache if necessary in aider/help.py 2024-09-27 12:22:09 -07:00
Paul Gauthier
a230fa10b3 feat: Add option to show announcements only when verbose mode is enabled 2024-09-27 12:12:35 -07:00
Paul Gauthier
1971285345 copy 2024-09-27 11:56:52 -07:00
Paul Gauthier
e1c2dd53cf copy 2024-09-27 11:54:23 -07:00
Paul Gauthier
cfbf943eb1 copy 2024-09-27 11:48:38 -07:00
Paul Gauthier (aider)
57b832fed1 style: add minimal border to table 2024-09-27 11:31:26 -07:00
Paul Gauthier (aider)
da3e0f6ec8 style: Implement responsive table design 2024-09-27 11:28:52 -07:00
Paul Gauthier
9575f4e5ea feat: Increase font size of chart title 2024-09-27 11:28:51 -07:00
Paul Gauthier (aider)
6e0f981689 fix: Update legend colors to match bar colors in chart 2024-09-27 11:23:41 -07:00
Paul Gauthier (aider)
04978a232b feat: Add gpt-4o-mini to chart configuration 2024-09-27 11:22:16 -07:00
Paul Gauthier
44b61fc370 fix: Update label format in architect post 2024-09-27 11:22:15 -07:00
Paul Gauthier
0bd8058589 copy 2024-09-27 11:09:44 -07:00
Paul Gauthier
ad38339f74 Bring commit hashes back from editor_coder, to allow /undo 2024-09-27 11:06:37 -07:00
Paul Gauthier
2f951cde0a copy 2024-09-27 10:54:48 -07:00
Paul Gauthier
84eca42ca8 feat: Add upgrade-strategy option to pip install command 2024-09-27 10:43:55 -07:00
Paul Gauthier
1df67b0650 copy 2024-09-27 10:36:38 -07:00
Paul Gauthier
8eed1b6ca5 fix: Update pip install command to use --upgrade-strategy only-if-needed 2024-09-27 10:34:09 -07:00
Paul Gauthier
0d55a51033 copy 2024-09-27 10:27:33 -07:00
Paul Gauthier
31e33ec8ef Merge branch 'main' of github.com:paul-gauthier/aider 2024-09-27 10:27:18 -07:00
Paul Gauthier
b16027e500 copy 2024-09-27 10:27:01 -07:00
Paul Gauthier
1acb4da8d0 copy 2024-09-27 10:26:48 -07:00
Paul Gauthier (aider)
f38ea0c8e2 feat: Add cmd_architect method to aider/commands.py 2024-09-27 10:25:50 -07:00
paul-gauthier
9d55197cd8 Merge pull request #1776 from fry69/junior-rename 2024-09-27 05:38:01 -07:00
fry69
667a58052e feat: change edit format from "senior" to "architect" 2024-09-27 09:03:42 +02:00
fry69
e3e0d57512 chore: update parameter names in args and benchmark 2024-09-27 08:57:22 +02:00
Paul Gauthier
c742642df2 copy 2024-09-26 19:06:01 -07:00
Paul Gauthier
c063bdb039 copy 2024-09-26 19:03:48 -07:00
Paul Gauthier
6230060d6a feat: Adjust chart settings for different screen sizes 2024-09-26 19:02:46 -07:00
Paul Gauthier (aider)
2b03b58018 feat: Add x-axis label rotation and adjust chart height 2024-09-26 18:58:02 -07:00
Paul Gauthier
f0c55a949c fix: update chart settings based on screen width 2024-09-26 18:58:01 -07:00
Paul Gauthier (aider)
d9e5d66957 feat: Introduce responsive font sizes based on screen width 2024-09-26 18:55:56 -07:00
Paul Gauthier
5ac71d8b6d copy 2024-09-26 17:46:52 -07:00
Paul Gauthier (aider)
1099cda9e4 feat: Add responsive options to the Chart.js configuration 2024-09-26 17:44:50 -07:00
Paul Gauthier
d1dd640577 cleanup 2024-09-26 17:43:05 -07:00
Paul Gauthier (aider)
9bc7c8f3b0 feat: Add title to chart legend 2024-09-26 17:43:01 -07:00
Paul Gauthier
7027b7b724 feat: Add new blog post for 'architect' 2024-09-26 17:40:31 -07:00
Paul Gauthier
87c6c636d1 Merge branch 'main' of github.com:paul-gauthier/aider 2024-09-26 17:39:03 -07:00
Paul Gauthier
0ab5b40f52 copy 2024-09-26 17:29:45 -07:00
Paul Gauthier (aider)
6f8fe44fd6 feat: Move "Previous SOTA" label to the left side of the graph 2024-09-26 17:28:39 -07:00
Paul Gauthier (aider)
7c8f0ea7b6 feat: Reverse order of bars and legend in chart 2024-09-26 17:28:04 -07:00
Paul Gauthier
6c946006e8 rename 2024-09-26 17:27:04 -07:00
Paul Gauthier
edab00064d architect/editor copy 2024-09-26 16:17:24 -07:00
Paul Gauthier
d6cf8377f1 rename files architect/editor 2024-09-26 16:16:05 -07:00
Paul Gauthier
eb21cf2830 architect/editor 2024-09-26 16:10:19 -07:00
paul-gauthier
17108c4328 Merge pull request #1762 from fry69/git-history-tip 2024-09-26 14:44:07 -07:00
fry69
0e9f384732 feat: add section on including git history in aider context 2024-09-26 23:03:13 +02:00
fry69
162afd0cdd doc: Add tips for including git history in Aider chat context 2024-09-26 22:59:46 +02:00
Paul Gauthier
b551e29de3 copy 2024-09-26 13:34:29 -07:00
Paul Gauthier
51bf028860 copy 2024-09-26 13:03:40 -07:00
Paul Gauthier
fadd362dbd copy 2024-09-26 12:54:35 -07:00
Paul Gauthier
7a12ca90d4 copy 2024-09-26 12:53:04 -07:00
Paul Gauthier
0b6c3f1c28 copy 2024-09-26 12:41:00 -07:00
Paul Gauthier
6d5575c705 copy 2024-09-26 12:24:10 -07:00
Paul Gauthier (aider)
857cc787a5 fix: Overlay stripe pattern on existing background color 2024-09-26 12:12:39 -07:00
Paul Gauthier (aider)
6b85e29ea7 fix: Update condition to check for empty item.junior_model 2024-09-26 12:11:53 -07:00
Paul Gauthier (aider)
bb50e1a959 feat: add thin stripes to all the "No Junior" columns in the graph 2024-09-26 12:10:59 -07:00
Paul Gauthier
bb8b0e32f2 feat: Increase font sizes in chart elements 2024-09-26 12:10:06 -07:00
Paul Gauthier (aider)
74a5ef51d4 feat: increase font sizes in graph 2024-09-26 12:04:36 -07:00
Paul Gauthier
f5cdaa06c8 feat: Separate code reasoning and editing 2024-09-26 12:04:35 -07:00
Paul Gauthier
7fe3518c8c copy 2024-09-26 11:57:55 -07:00
Paul Gauthier
e2d5545b48 copy 2024-09-26 11:52:47 -07:00
Paul Gauthier
862968ed20 copy 2024-09-26 11:50:25 -07:00
Paul Gauthier
50fb95c8b1 force pip to install aider's deps 2024-09-26 11:47:05 -07:00
Paul Gauthier
6b6f682a94 pip install -> pip install -U 2024-09-26 11:40:48 -07:00
Paul Gauthier
5e419ef8a6 copy 2024-09-26 11:36:40 -07:00
Paul Gauthier
c3b9d34e24 copy 2024-09-26 11:35:33 -07:00
Paul Gauthier (aider)
5a78e7d1b8 chore: Run the linter 2024-09-26 11:35:13 -07:00
Paul Gauthier (aider)
1c05192b69 fix: Only record junior_model and junior_edit_format in the results array if edit_format is "senior" 2024-09-26 11:35:09 -07:00
Paul Gauthier
068ff01cee restor 2024-09-26 11:34:02 -07:00
Paul Gauthier
7feaccd35a cleanup 2024-09-26 11:29:39 -07:00
Paul Gauthier (aider)
bf015e27d6 feat: Add --senior switch as alias for --edit-format senior 2024-09-26 11:27:55 -07:00
Paul Gauthier (aider)
3fe3e0f700 feat: Add --o1-mini and --o1-preview aliases for model selection 2024-09-26 11:27:14 -07:00
Paul Gauthier
b3e3a5a401 better 2024-09-26 11:21:35 -07:00
Paul Gauthier
d375103b64 data 2024-09-26 11:20:22 -07:00
Paul Gauthier (aider)
b7ddd74631 fix: Remove stripes and dots from color patches in legends 2024-09-26 11:19:02 -07:00
Paul Gauthier (aider)
4b6dd92f73 feat: Add polka dot pattern to Deepseek diff bars 2024-09-26 11:17:45 -07:00
Paul Gauthier
aa7949467c feat: Reduce height of pass rate chart to 300px 2024-09-26 11:17:43 -07:00
Paul Gauthier (aider)
0cb8c891d9 feat: Add striped pattern to Deepseek whole bars 2024-09-26 11:16:39 -07:00
Paul Gauthier
1d454c1729 feat: Increase height of pass rate chart to 400px 2024-09-26 11:16:38 -07:00
Paul Gauthier
b867c04354 feat: Implement Senior/Junior approach for code editing 2024-09-26 11:14:19 -07:00
Paul Gauthier (aider)
b4bd5ffb69 feat: add horizontal dashed line at y=79.7 labeled "Previous SOTA" 2024-09-26 10:21:24 -07:00
Paul Gauthier
337b5f1f7a feat: Add new blog post on senior and junior developers 2024-09-26 10:21:23 -07:00
Paul Gauthier (aider)
2d5962ef2f fix: Properly nest x-axis title within x-axis configuration 2024-09-26 10:19:08 -07:00
Paul Gauthier
4f32da2bf0 feat: Add y-axis title to chart in senior-junior blog post 2024-09-26 10:19:07 -07:00
Paul Gauthier (aider)
5378171ed1 feat: add x-axis label to chart 2024-09-26 10:18:04 -07:00
Paul Gauthier
975f35dfbc feat: Add support for using two models to complete each coding task 2024-09-26 10:18:03 -07:00
Paul Gauthier (aider)
a4df572cfe feat: add legend for senior models 2024-09-26 10:12:19 -07:00
Paul Gauthier (aider)
e83c285d4f feat: color each bar based on the Senior model 2024-09-26 10:11:28 -07:00
Paul Gauthier (aider)
10eb25f5f5 feat: add bar graph of pass rate data 2024-09-26 10:10:32 -07:00
Paul Gauthier
04cc9d03e9 feat: Add senior/junior code editing benchmark chart 2024-09-26 10:07:59 -07:00
Paul Gauthier (aider)
c7e2255570 refactor: Change chart type from stacked to grouped bars 2024-09-26 09:43:14 -07:00
Paul Gauthier (aider)
d699f3025d feat: Increase chart height and improve title and axis label readability 2024-09-26 09:42:01 -07:00
Paul Gauthier (aider)
c33dd0ee7b fix: Avoid declaring dataset variable multiple times 2024-09-26 09:40:04 -07:00
Paul Gauthier (aider)
63a4ce0fe2 feat: Add a graph that displays the Pass Rate for each Senior/Junior/EditFormat 2024-09-26 09:39:16 -07:00
Paul Gauthier
222b9cff09 feat: Add support for using two models to complete coding tasks 2024-09-26 09:39:14 -07:00
Paul Gauthier (aider)
89aa385613 style: right-align cost entries in table 2024-09-26 08:31:26 -07:00
Paul Gauthier
ab8672574a fix: Update formatting for seconds per case and total cost in blog post 2024-09-26 08:31:25 -07:00
Paul Gauthier (aider)
034e65912e style: Format cost column to show two decimal places 2024-09-26 08:29:15 -07:00
Paul Gauthier
40bf3a1e58 feat: Update table formatting in blog post 2024-09-26 08:29:14 -07:00
Jonathan Ellis
d2fbc92507 feat: include non-repo files for completing /read 2024-09-26 10:28:03 -05:00
Paul Gauthier (aider)
fb9ffca9ea style: format cost column with two decimal places 2024-09-26 08:27:47 -07:00
Paul Gauthier
fbe0aa2a7b fix: Update table formatting for total_cost column 2024-09-26 08:27:46 -07:00
Paul Gauthier (aider)
3661c2c08a feat: Display cost with two decimal places 2024-09-26 08:26:41 -07:00
Paul Gauthier (aider)
8d22cadd30 style: format cost column as standard money 2024-09-26 08:26:11 -07:00
Paul Gauthier
f691878390 feat: Add edit format column to senior-junior benchmark table 2024-09-26 08:26:09 -07:00
Paul Gauthier (aider)
50570c4762 fix: Display edit_format if junior_edit_format is not available 2024-09-26 08:24:51 -07:00
Paul Gauthier
8ca92cdec0 fix: Update table styles in blog post 2024-09-26 08:24:51 -07:00
Paul Gauthier (aider)
bc1559fbc9 style: Enhance table styling to improve visual distinction of shaded rows 2024-09-26 08:12:19 -07:00
Paul Gauthier (aider)
ac9d46c1f7 feat: Shade every second group of Seniors 2024-09-26 08:11:07 -07:00
Paul Gauthier
fb2e59cf08 fix: Remove unnecessary horizontal rule from table 2024-09-26 08:11:06 -07:00
Paul Gauthier (aider)
e93744c990 style: replace markdown table with HTML <table> 2024-09-26 08:09:39 -07:00
Paul Gauthier (aider)
2698d80c63 refactor: Simplify sorting and grouping of data in senior-junior.md 2024-09-26 08:08:46 -07:00
Paul Gauthier (aider)
4d7d7ecd2b feat: Generate table from YAML data with dynamic sorting and grouping 2024-09-26 08:07:37 -07:00
Paul Gauthier
46f8b6dfe4 feat: Update benchmark data table in senior-junior blog post 2024-09-26 08:07:36 -07:00
Paul Gauthier (aider)
1676653ffb feat: Add dividers between blocks of same senior model in benchmark data table 2024-09-26 08:02:41 -07:00
Paul Gauthier
98e28642f9 feat: Update benchmark data table in senior-junior blog post 2024-09-26 08:02:28 -07:00
Paul Gauthier (aider)
f21c35c42a feat: Add benchmark data table 2024-09-26 07:58:26 -07:00
Paul Gauthier
3602dc4819 feat: Add new blog post on senior vs junior engineers 2024-09-26 07:58:25 -07:00
rti
6ccb8e3a13 fix(InputOutput): apply tool warning color 2024-09-26 08:41:13 +02:00
Paul Gauthier
e682eb8669 fix: Add junior model and junior edit format to benchmark results 2024-09-25 16:31:40 -07:00
Paul Gauthier (aider)
9f3cd92b18 feat: add junior_edit_format="junior-diff" to gpt-4o model settings 2024-09-25 14:33:20 -07:00
Paul Gauthier
25e833bbd4 fix: Rename JuniorWholeFileCoder and JuniorWholeFilePrompts classes 2024-09-25 14:25:16 -07:00
Paul Gauthier (aider)
3f682ed908 feat: Update 'openai/o1-mini' settings to include junior model information 2024-09-25 14:23:54 -07:00
Paul Gauthier
6568cd71d4 feat: add junior model settings to the model configuration 2024-09-25 14:23:54 -07:00
Paul Gauthier (aider)
c18d6a8960 chore: Run linter 2024-09-25 14:14:48 -07:00
Paul Gauthier (aider)
2ff5e4969e feat: Add JuniorEditBlockCoder and JuniorWholeFileCoder to __init__.py 2024-09-25 14:14:44 -07:00
Paul Gauthier (aider)
b3ae2c878f feat: Update junior_edit_format to use "junior-diff" instead of "diff" 2024-09-25 14:13:54 -07:00
Paul Gauthier
d1d043d924 fix: Simplify junior model assignment logic 2024-09-25 14:09:44 -07:00
Paul Gauthier
839ebe5a7c fix: Add missing attributes to junior coder 2024-09-25 14:03:24 -07:00
Paul Gauthier (aider)
ed7503dbbe feat: optimize find_latest_benchmark_dir to check only .md files and limit to one file per subtree 2024-09-25 12:20:45 -07:00
Paul Gauthier (aider)
e21cdafb15 style: run linter and fix code formatting issues 2024-09-25 12:18:43 -07:00
Paul Gauthier (aider)
8d90df1ebc feat: implement automatic selection of the most recently updated benchmark directory when using --stats without dirnames 2024-09-25 12:18:39 -07:00
Paul Gauthier
e6c938c489 feat: Add default junior edit format if not set 2024-09-25 12:03:25 -07:00
Paul Gauthier (aider)
24c959af2d feat: Add --junior-model and --junior-edit-format flags to the benchmark 2024-09-25 11:44:34 -07:00
Paul Gauthier
15cc709322 feat: Improve senior coder's edit format handling 2024-09-25 11:42:09 -07:00
Paul Gauthier (aider)
856d617610 feat: update all the claude 3.5 sonnet ModelSettings to use the appropriate junior_model_name and junior_edit_format=diff 2024-09-25 11:38:48 -07:00
Paul Gauthier
24c15db8d7 feat: add junior_edit_format parameter to get_junior_model method 2024-09-25 11:37:41 -07:00
Paul Gauthier (aider)
0ded63cd31 feat: Reorder Junior and Weak Model announcements 2024-09-25 11:18:17 -07:00
Paul Gauthier (aider)
f0d02f2c76 style: Improve formatting of long string 2024-09-25 11:17:39 -07:00
Paul Gauthier (aider)
f8cef655f0 feat: Add junior model information to announcement for senior edit format 2024-09-25 11:17:34 -07:00
Paul Gauthier (aider)
0a7e5f313f style: Run linter 2024-09-25 11:10:06 -07:00
Paul Gauthier (aider)
888d60d472 feat: Add --junior-edit-format argument and plumb it into Model() 2024-09-25 11:09:56 -07:00
Paul Gauthier (aider)
6d19abf7ec fix: Remove unused import of Model from aider/coders/senior_coder.py 2024-09-25 11:04:48 -07:00
Paul Gauthier (aider)
e718b43fc8 style: Fix formatting in senior_coder.py 2024-09-25 11:04:39 -07:00
Paul Gauthier (aider)
a4aa88a440 feat: Adapt SeniorCoder to use Model.junior_model 2024-09-25 11:04:34 -07:00
Paul Gauthier (aider)
e74e76e51c style: run linter 2024-09-25 11:03:25 -07:00
Paul Gauthier (aider)
926b3c9240 feat: Add --junior-model argument and plumb it into Model() 2024-09-25 11:03:15 -07:00
Paul Gauthier
11cdc4175f feat: Update model settings for claude-3-5-sonnet-20240620 2024-09-25 11:03:13 -07:00
Paul Gauthier
df8f57b628 feat: create a new junior coder with updated kwargs 2024-09-25 10:55:16 -07:00
Paul Gauthier
7bd1d49f23 feat: update model settings to include junior model and edit format 2024-09-25 10:47:31 -07:00
Paul Gauthier
130c6f7308 fix: Prompt user to confirm file edits before proceeding 2024-09-25 10:29:58 -07:00
Paul Gauthier
26745426ae fix: Update SeniorCoder class to configure and run JuniorCoder with appropriate settings 2024-09-25 10:27:27 -07:00
Paul Gauthier
087dbb40a3 feat: Add SeniorCoder and update prompts 2024-09-25 10:23:31 -07:00
Paul Gauthier (aider)
095bae6513 fix: Remove unused import and fix undefined name in senior_coder.py 2024-09-25 09:54:54 -07:00
Paul Gauthier (aider)
95c70951fd fix: Remove unused import and import correct base class 2024-09-25 09:54:39 -07:00
Paul Gauthier (aider)
58c27e401e style: Fix import order in junior_whole_coder.py 2024-09-25 09:54:27 -07:00
Paul Gauthier (aider)
f2d60528f7 fix: Remove unused import and fix undefined name 2024-09-25 09:54:23 -07:00
Paul Gauthier
65e57df7ea feat: Implement changes to handle files content in Coder and prompts 2024-09-25 09:54:16 -07:00
Paul Gauthier
075bc828f6 stand alone junior message 2024-09-25 08:41:49 -07:00
Paul Gauthier
c912982747 senior-junior 2024-09-25 08:25:11 -07:00
Paul Gauthier
a9e9f9cdbe Merge branch 'main' into ask-plan-simple 2024-09-25 07:46:15 -07:00
Paul Gauthier
75e1d519da fix: Handle all exceptions when loading parser in linter 2024-09-24 16:49:29 -07:00
Paul Gauthier
3c87e3670c copy 2024-09-24 14:05:49 -07:00
Paul Gauthier (aider)
ee3bf2311c fix: Resolve flake8 line length errors in aider/io.py 2024-09-24 14:03:30 -07:00
Paul Gauthier
6c570b1847 feat: Add modal cursor shape configuration 2024-09-24 14:03:20 -07:00
paul-gauthier
bbfafed372 Merge pull request #1634 from smh/customize-completion-menu-colors
style: completion menu colors customizable
2024-09-24 13:19:34 -07:00
paul-gauthier
0adb7e0fd3 Merge pull request #1590 from hypn4/main
feat: add `extra_body`field and use in model settings.
2024-09-24 13:16:38 -07:00
Paul Gauthier
486c5ab224 build: don't login to docker hub for docker build test 2024-09-24 13:02:31 -07:00
Paul Gauthier
99bf23c5ff fix: Set AIDER_CHECK_UPDATE environment variable to false in test setup 2024-09-24 12:42:37 -07:00
Paul Gauthier
82ebb7713a Return True to indicate successful install even if no module 2024-09-24 12:28:54 -07:00
Paul Gauthier
117ff96c76 fix: Properly refactor mdstream from Coder into IO 2024-09-24 11:53:05 -07:00
Paul Gauthier
46ab701782 copy 2024-09-24 09:52:17 -07:00
Paul Gauthier
ba6ef29896 feat: Add new leaderboard entry for gemini/gemini-1.5-flash-8b-exp-0924 model 2024-09-24 09:46:56 -07:00
Paul Gauthier
eff68a669d copy 2024-09-24 09:45:45 -07:00
Paul Gauthier
d8dd7a259b feat: Add new Gemini model configurations 2024-09-24 09:45:36 -07:00
Paul Gauthier
7569dea73c restore dynamic graph 2024-09-24 09:36:16 -07:00
Paul Gauthier
3edcd71a44 fix: move pydub import to avoid warnings 2024-09-24 09:29:00 -07:00
Paul Gauthier (aider)
ab786279e6 style: Fix linter warnings 2024-09-24 09:28:31 -07:00
Paul Gauthier (aider)
e267dc13af fix: Move imports to top of file 2024-09-24 09:28:28 -07:00
Paul Gauthier (aider)
d0e6dc2c1e style: Wrap long lines in voice.py 2024-09-24 09:28:16 -07:00
Paul Gauthier (aider)
da752bb00c fix: Suppress warning about missing ffmpeg or avconv 2024-09-24 09:28:13 -07:00
Paul Gauthier (aider)
6b5fe9bee3 style: Run linter on scripts/issues.py 2024-09-24 08:25:31 -07:00
Paul Gauthier (aider)
8422441f74 fix: Skip processing open issues that have been closed and re-opened 2024-09-24 08:25:28 -07:00
Paul Gauthier
86faaa65ff copy 2024-09-23 12:53:10 -07:00
Paul Gauthier
543437dd28 copy 2024-09-23 12:48:00 -07:00
Paul Gauthier (aider)
3e594877d7 style: Run linter on Python script 2024-09-23 12:27:13 -07:00
Paul Gauthier (aider)
c2a35fef05 refactor: Modify script to only show versions compatible with Python 3.8 or lower 2024-09-23 12:27:10 -07:00
Paul Gauthier (aider)
bbeb4749cb style: Run linter 2024-09-23 12:26:23 -07:00
Paul Gauthier (aider)
00662aef54 feat: Add Python version support information to yank-old-versions.py 2024-09-23 12:26:20 -07:00
Paul Gauthier (aider)
7a0196e039 style: Run linter on Python script 2024-09-23 12:24:55 -07:00
Paul Gauthier (aider)
ee6cbddf65 feat: Add script to enumerate PyPI versions supporting Python 3.8 or lower 2024-09-23 12:24:52 -07:00
Paul Gauthier
7016ccc150 chore: Add script to yank old versions 2024-09-23 12:24:51 -07:00
Paul Gauthier
a4b79127b0 fix: Handle ZeroDivisionError in PageRank calculation 2024-09-23 11:49:44 -07:00
Paul Gauthier (aider)
ed1eb38c5f fix: Split long comment line in aider/repo.py 2024-09-23 11:41:34 -07:00
Paul Gauthier
8f583ca119 fix: Handle ValueError when getting relative path in ignored_file_raw 2024-09-23 11:41:28 -07:00
Paul Gauthier (aider)
1fe2be4633 fix: ignore unicode errors in append_chat_history 2024-09-23 11:38:51 -07:00
Paul Gauthier
d063be23c9 fix: Improve error handling in load_dotenv_files function 2024-09-23 11:36:49 -07:00
Paul Gauthier (aider)
25c3a959dd fix: Handle OSError when loading dotenv files 2024-09-23 11:35:27 -07:00
Paul Gauthier
924eeb43de fix: Update test assertions for API key checks 2024-09-23 11:34:49 -07:00
Paul Gauthier
d518493bb9 fix: Update model sanity check output format 2024-09-23 11:32:52 -07:00
Paul Gauthier
ba0a328196 fix: Disable SSL verification for LiteLLM client sessions 2024-09-23 11:28:17 -07:00
Paul Gauthier
1de8c13974 copy 2024-09-23 10:30:22 -07:00
Paul Gauthier (aider)
f2397bb0cc chore: Reorganize command-line arguments in aider/args.py 2024-09-23 09:08:07 -07:00
Paul Gauthier (aider)
5779006db0 feat: Add Voice Settings section 2024-09-23 09:06:57 -07:00
Paul Gauthier (aider)
39b2f7bdee feat: Add Cache Settings section 2024-09-23 09:06:31 -07:00
Paul Gauthier (aider)
5e9a4e01f9 feat: Move map-tokens, map-refresh and map-multiplier into a new Repomap Setting section 2024-09-23 09:04:46 -07:00
Paul Gauthier
9c47f26052 copy 2024-09-23 09:03:02 -07:00
Paul Gauthier (aider)
b03d5d1099 style: Wrap long help text in args.py 2024-09-23 09:02:49 -07:00
Paul Gauthier (aider)
c9ac01f474 docs: update help message for --map-refresh option 2024-09-23 09:02:45 -07:00
paul-gauthier
c5245d3d8b Merge pull request #1660 from fry69/bad_ver-fix
fix: add missing variable initialization
2024-09-23 07:14:27 -07:00
hypn4
a4044f4175 feat: add .venv directory 2024-09-23 20:37:10 +09:00
hypn4
6dc846d41b fix: added missing parameters.
added missing parameters in `simple_send_with_retries` function.
2024-09-23 20:37:10 +09:00
hypn4
d0bce02c00 feat: add extra_bodyfield 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/<YOUR_MODEL>"
  edit_format: "whole"
  use_repo_map: true
  extra_body:
    provider:
      order:
      - Azure
      allow_fallbacks: false
```
2024-09-23 20:37:10 +09:00
fry69
7a5947fc49 feat: add tests for sanity_check_repo function 2024-09-23 07:55:45 +02:00
fry69
a695c6c46e fix: add missing variable initialization 2024-09-23 07:02:33 +02:00
Paul Gauthier
ca4141564f copy 2024-09-22 17:03:43 -07:00
Paul Gauthier
6cc0f96e33 Merge remote-tracking branch 'refs/remotes/origin/main' 2024-09-22 17:03:04 -07:00
Paul Gauthier
a1bd0c97ee copy 2024-09-22 17:01:47 -07:00
Paul Gauthier (aider)
6a733f8e76 refactor: Rename print_model_settings_as_yaml to get_model_settings_as_yaml 2024-09-22 16:55:58 -07:00
Paul Gauthier (aider)
60082d0d16 style: format code using linter 2024-09-22 16:54:56 -07:00
Paul Gauthier (aider)
ea72ad61fe feat: add function to print model settings as YAML 2024-09-22 16:54:51 -07:00
paul-gauthier
a4f608f3dd Merge pull request #1543 from fry69/ctrl-space-fix 2024-09-22 13:42:34 -07:00
paul-gauthier
737ccdec11 Merge pull request #1639 from curran/patch-1 2024-09-22 13:34:31 -07:00
Paul Gauthier
129afd0396 copy 2024-09-22 13:06:52 -07:00
paul-gauthier
62f4dc2097 Merge pull request #1640 from mbailey/feature-voice-compression
feat: Option to compress audio files by ~90%
2024-09-22 13:05:18 -07:00
Stein Martin Hustad
ef75ba9495 style: completion menu colorization (additional location) 2024-09-22 22:59:57 +04:00
Paul Gauthier
cee0bb7135 add test for hash filenames 2024-09-22 08:24:55 -07:00
Paul Gauthier
54cfbc4142 handle ### filename.ext in whole format 2024-09-22 08:21:15 -07:00
Curran Kelleher
330fa863c8 Add benchmark results for Codestral-22B 2024-09-22 08:26:04 -04:00
Mike Bailey
1cc30a22f9 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
2024-09-22 22:20:07 +10:00
Stein Martin Hustad
a91d3fed01 style: completion menu colors customizable 2024-09-22 10:45:00 +04:00
Paul Gauthier
edf8fc6327 fix: Remove progress bar when closing duplicate issues 2024-09-21 19:06:08 -07:00
Paul Gauthier
12f1bf643a fix: Add ValueError to ANY_GIT_ERROR tuple 2024-09-21 19:02:35 -07:00
Paul Gauthier
2314179b83 fix: Add default encoding to load_dotenv_files function 2024-09-21 19:01:24 -07:00
Paul Gauthier (aider)
516a3a6647 style: Fix formatting in load_dotenv_files function 2024-09-21 18:58:48 -07:00
Paul Gauthier (aider)
07a95deaba fix: Use args.encoding when loading .env files 2024-09-21 18:58:43 -07:00
Paul Gauthier
212e22b2b7 fix: Handle file read errors in linter 2024-09-21 18:55:24 -07:00
Paul Gauthier (aider)
3a96a10d06 style: Format code with black 2024-09-21 18:46:24 -07:00
Paul Gauthier (aider)
3dfc63ce79 feat: Add support for following redirects in httpx-based scraping 2024-09-21 18:46:21 -07:00
Paul Gauthier
a77c8ccfa9 copy 2024-09-21 18:43:02 -07:00
Paul Gauthier (aider)
eff9325f2b style: Fix formatting in issue comment 2024-09-21 18:38:03 -07:00
Paul Gauthier (aider)
0101ae76d1 refactor: Move comment_body to a global multiline string 2024-09-21 18:37:59 -07:00
Paul Gauthier
26f9a10324 fix: Add greeting to comment when closing duplicate issue 2024-09-21 18:36:33 -07:00
Paul Gauthier (aider)
6731815251 style: Fix formatting in issues.py 2024-09-21 18:30:39 -07:00
Paul Gauthier (aider)
b4fdb72a3a fix: Only print Oldest issue #{oldest_issue['number']} left open if it is open 2024-09-21 18:30:35 -07:00
Paul Gauthier
f3ad683d70 set version to 0.57.2.dev 2024-09-21 18:28:55 -07:00
Paul Gauthier
bd398525e0 version bump to 0.57.1 2024-09-21 18:27:31 -07:00
Paul Gauthier
7f156830fe Handle TypeError coming from git ops 2024-09-21 17:09:08 -07:00
Paul Gauthier
739bd07c04 copy 2024-09-21 17:06:31 -07:00
Paul Gauthier
dced6c8052 Revert "feat: switch --deepseek to use model "deepseek-coder""
This reverts commit 925560ac1f.
2024-09-21 17:06:11 -07:00
Paul Gauthier
5c7f35f24b copy 2024-09-21 16:28:10 -07:00
Paul Gauthier
7abfd3236b copy 2024-09-21 16:28:03 -07:00
Paul Gauthier
aca60a9127 no tqdm for groups 2024-09-21 16:26:45 -07:00
Paul Gauthier (aider)
8cc747da3a style: Fix linting issues in scripts/issues.py 2024-09-21 16:05:59 -07:00
Paul Gauthier (aider)
26dcdcc1d2 feat: add total page count to progress bar in get_issues function 2024-09-21 16:05:55 -07:00
Paul Gauthier (aider)
5606791df2 style: Fix import order in scripts/issues.py 2024-09-21 16:05:19 -07:00
Paul Gauthier (aider)
de87418647 feat: add progress bar while collecting issues 2024-09-21 16:05:16 -07:00
Paul Gauthier (aider)
10fee78ddd feat: Add progress bar while collecting the groups 2024-09-21 16:04:26 -07:00
Paul Gauthier
237002f941 fix: Resolve version conflict between requirements-help and requirements-playwright for greenlet 2024-09-21 15:57:41 -07:00
Paul Gauthier (aider)
5d80e11e5b feat: Add Docker full image build to CI workflow 2024-09-21 13:59:50 -07:00
Paul Gauthier
c234df0ff1 copy 2024-09-21 13:55:37 -07:00
Paul Gauthier
ced3336176 updated blame data 2024-09-21 13:55:34 -07:00
Paul Gauthier (aider)
925560ac1f feat: switch --deepseek to use model "deepseek-coder" 2024-09-21 13:56:32 -07:00
Paul Gauthier (aider)
4a9700fcd9 feat: add ModelSettings for plain "deepseek-coder" and "deepseek-chat" 2024-09-21 13:55:49 -07:00
Paul Gauthier
6408a9fbf9 set version to 0.57.1.dev 2024-09-21 13:39:55 -07:00
Paul Gauthier
cf56369410 version bump to 0.57.0 2024-09-21 13:38:42 -07:00
Paul Gauthier
2ca093fb84 Bumping all dependencies 2024-09-21 11:04:57 -07:00
Paul Gauthier
237c4ab323 copy 2024-09-21 10:44:25 -07:00
Paul Gauthier
cfe1d540f1 update fence test to use backticks at start of line 2024-09-21 10:42:58 -07:00
Paul Gauthier
f29825ff22 copy 2024-09-21 10:41:43 -07:00
Paul Gauthier
565c305aa6 update o1-preview leaderboard to diff only 2024-09-21 10:27:50 -07:00
Paul Gauthier
b27738d39a copy 2024-09-21 10:16:51 -07:00
Paul Gauthier
412b8e7c3c copy 2024-09-21 10:09:26 -07:00
Paul Gauthier
5493654981 Merge remote-tracking branch 'refs/remotes/origin/main' 2024-09-21 09:32:51 -07:00
paul-gauthier
167b1ed491 Merge pull request #1586 from anjor/patch-1
Fix broken link
2024-09-21 09:32:27 -07:00
Paul Gauthier (aider)
454a2ebdcf style: format code using linter 2024-09-20 13:44:07 -07:00
Paul Gauthier (aider)
7fa1620f58 feat: Allow flexible matching of 5-9 characters in SEARCH/REPLACE block prefixes 2024-09-20 13:44:02 -07:00
Paul Gauthier (aider)
230ec50209 refactor: Improve choose_fence function to check for fence start in lines 2024-09-20 13:40:44 -07:00
Paul Gauthier
2753ac6b62 feat: Add new benchmark test case for qwen-2.5-72b-instruct-diff model 2024-09-20 13:27:58 -07:00
Paul Gauthier
5139594fa0 copy 2024-09-20 13:19:36 -07:00
Paul Gauthier
d26fca0bca feat: Add new leaderboard entry for qwen-2.5-72b-instruct model 2024-09-20 13:19:26 -07:00
paul-gauthier
d7051ce736 Merge pull request #1610 from youknow04/qwen2.5-7b-8q
Add Qwen2.5-coder:7b-instruct-q8_0 benchmark result to leaderboard
2024-09-20 12:57:25 -07:00
Paul Gauthier
b3e5caf330 fix: Add BufferError to ANY_GIT_ERROR tuple 2024-09-20 12:39:33 -07:00
Paul Gauthier
2a4527a5af fix: Ensure path_in_repo function handles empty path 2024-09-20 12:29:50 -07:00
Paul Gauthier (aider)
243be27eb8 style: Fix formatting in aider/models.py 2024-09-20 12:21:03 -07:00
Paul Gauthier (aider)
671c633d8f fix: handle errors when creating cache directory in get_model_info 2024-09-20 12:20:59 -07:00
Paul Gauthier
d94c1c0e1f fix: Remove redundant message when no changes were made 2024-09-20 12:14:52 -07:00
Paul Gauthier
88eaf8cf1d copy 2024-09-20 11:52:28 -07:00
Paul Gauthier
84ca8dd582 fix unicode errors in run_install 2024-09-20 11:52:24 -07:00
Paul Gauthier
8349cd5c15 fix: Handle FileNotFoundError in get_git_root function 2024-09-20 11:45:48 -07:00
Paul Gauthier (aider)
7d766d53ee style: format code for better readability 2024-09-20 11:40:28 -07:00
Paul Gauthier (aider)
2cabf9718c feat: Add comment count to issue output 2024-09-20 11:40:25 -07:00
Paul Gauthier (aider)
0030d11ac7 style: Improve formatting and readability of issues.py script 2024-09-20 11:38:57 -07:00
Paul Gauthier (aider)
31655889cf feat: List open issues in descending order by number 2024-09-20 11:38:54 -07:00
Paul Gauthier (aider)
851f0653d6 style: Run linter on Python script 2024-09-20 11:32:53 -07:00
Paul Gauthier (aider)
c111e7a30e feat: Add confirmation prompt and logic to comment and close duplicate issues 2024-09-20 11:32:49 -07:00
Paul Gauthier
7dd0a0f348 fix: Handle cases where there are no related issues for a subject 2024-09-20 11:32:30 -07:00
Paul Gauthier (aider)
3d70f88bcc style: Wrap long lines in f-strings 2024-09-20 11:23:53 -07:00
Paul Gauthier (aider)
215833d326 feat: Print issue URLs instead of issue numbers 2024-09-20 11:23:50 -07:00
Paul Gauthier (aider)
ba257d653c fix: Move import re statement to top of file 2024-09-20 11:21:34 -07:00
Paul Gauthier (aider)
99d196d06e style: format code 2024-09-20 11:20:42 -07:00
Paul Gauthier (aider)
619127925d feat: Add filter to only print issues matching "Uncaught xxx in xxx line ###" pattern 2024-09-20 11:20:39 -07:00
Paul Gauthier
86dc25d342 fix: Improve handling of issues with single subject 2024-09-20 11:20:38 -07:00
Paul Gauthier (aider)
dd1ae5bd3a style: Wrap long lines in f-strings 2024-09-20 11:18:13 -07:00
Paul Gauthier (aider)
40202a9cb8 chore: only print out issues with >1 in the group 2024-09-20 11:18:09 -07:00
Paul Gauthier (aider)
08d465c252 refactor: Improve efficiency by fetching all issues once and reusing the data 2024-09-20 11:16:53 -07:00
Paul Gauthier (aider)
81bad77fa9 refactor: Simplify script by hardcoding repository details 2024-09-20 11:12:02 -07:00
Paul Gauthier
ada7b3d7ab fix: make issues.py executable 2024-09-20 11:12:01 -07:00
Paul Gauthier (aider)
04aecbe9a9 chore: add shebang and chmod 2024-09-20 11:10:54 -07:00
Paul Gauthier (aider)
6b9fc86e99 style: Run linter on Python script 2024-09-20 11:09:48 -07:00
Paul Gauthier (aider)
1ede98bc07 feat: Implement GitHub issue analysis script 2024-09-20 11:09:44 -07:00
Paul Gauthier
eb078906b3 feat: Add issues.py script 2024-09-20 11:09:43 -07:00
Paul Gauthier
51017d7a5b copy 2024-09-20 11:05:33 -07:00
youknow
2463cbfd6c add Qwen2.5-7b-8q to leaderboard 2024-09-21 01:25:39 +09:00
Jonathan Ellis
dca9b18871 feat: rename /clipboard to /paste 2024-09-19 09:45:59 -05:00
Anjor Kanekar
c13aadaa0e Fix broken link 2024-09-18 14:54:04 +01:00
fry69
baddc0b63c fix: add keybinding to insert space on Ctrl+Space 2024-09-15 15:18:09 +02:00
paul-gauthier
e6037140be Update 2024-09-12-o1.md 2024-09-12 21:09:15 -07:00
Paul Gauthier
eba845ea51 copy 2024-09-12 20:40:12 -07:00
Paul Gauthier (aider)
d747a3781d feat: add openrouter versions of o1-mini and o1-preview 2024-09-12 19:15:48 -07:00
Paul Gauthier
9768e84fcd feat: Change model settings from 'whole' to 'diff' 2024-09-12 19:15:47 -07:00
Paul Gauthier
8cb83afcc4 ask transient whole, o1-preview deep 2024-09-12 17:21:35 -07:00
Paul Gauthier
83662b7470 Merge branch 'main' into ask-plan-simple 2024-09-12 17:19:14 -07:00
Paul Gauthier
72f52bdef0 copy 2024-09-12 15:41:02 -07:00
Paul Gauthier
c00ac80909 o1-mini diff results 2024-09-12 15:38:40 -07:00
Paul Gauthier
1fbb5079d5 unhack o1 mini 2024-09-12 15:38:28 -07:00
Paul Gauthier (aider)
752e823da8 feat: Dynamically generate legend labels based on unique edit formats 2024-09-12 15:23:33 -07:00
Paul Gauthier (aider)
45474a230e feat: Add distinct colors for edit formats in leaderboard chart 2024-09-12 15:22:28 -07:00
Paul Gauthier
af407c4c8f copy 2024-09-12 15:20:23 -07:00
Paul Gauthier (aider)
b4dad65e9f feat: Add configuration to display all x-axis labels 2024-09-12 15:18:57 -07:00
Paul Gauthier
291d3509eb copy 2024-09-12 15:17:32 -07:00
Paul Gauthier (aider)
84b1c1031a feat: add label to y-axis of leaderboard graph 2024-09-12 15:13:22 -07:00
Paul Gauthier (aider)
71c5fd1372 feat: Add legend to leaderboard chart 2024-09-12 15:12:10 -07:00
Paul Gauthier (aider)
2605d44db6 feat: Add different colors for 'whole' and 'diff' edit formats in leaderboard graph 2024-09-12 15:10:32 -07:00
Paul Gauthier
4598a376fd copy 2024-09-12 15:01:27 -07:00
Paul Gauthier
9f4d9d801e copy 2024-09-12 14:52:27 -07:00
Paul Gauthier (aider)
859fc1f184 fix: Adjust streaming settings before creating Coder object 2024-09-12 14:49:21 -07:00
Paul Gauthier
99a75ac213 feat: Add streaming option to ModelSettings 2024-09-12 14:47:18 -07:00
Paul Gauthier (aider)
94a2bc5ef5 style: Improve formatting of warning message 2024-09-12 14:46:36 -07:00
Paul Gauthier (aider)
efa0c0e292 fix: Disable streaming if main model does not support it 2024-09-12 14:46:32 -07:00
Paul Gauthier
fb420de09e feat: Add new model settings for openai/o1-preview and o1-preview 2024-09-12 14:42:52 -07:00
Paul Gauthier
09cb4c4b09 copy 2024-09-12 14:27:35 -07:00
Paul Gauthier
1755d2e0f4 fix: Use temperature setting from model configuration 2024-09-12 14:24:21 -07:00
Paul Gauthier
8aee4d25ed add ModelSettings.use_system_prompt 2024-09-12 14:19:53 -07:00
Paul Gauthier
71f3f3a22b copy 2024-09-12 14:12:48 -07:00
Paul Gauthier
297b51b997 pct 2024-09-12 14:11:26 -07:00
Paul Gauthier
6eb993999a copy 2024-09-12 14:07:41 -07:00
Paul Gauthier
96587f5f46 o1-mini blog article 2024-09-12 14:07:06 -07:00
Paul Gauthier
291b456a45 hack for o1-mini: no system prompt, no temperature 2024-09-12 13:05:25 -07:00
Paul Gauthier (aider)
d84a9d6df2 fix: update scale configuration in leaderboard_graph.html 2024-09-12 13:04:10 -07:00
Paul Gauthier (aider)
13d3b7c9b3 refactor: Refactor the edit leaderboard graph into a reusable component 2024-09-12 13:01:55 -07:00
Paul Gauthier
94af92c784 feat: Add leaderboard graph component 2024-09-12 13:01:54 -07:00
Paul Gauthier
36fa773376 fix: Simplify get_help_md function in commands.py 2024-09-11 14:38:23 -07:00
Paul Gauthier (aider)
05b3b3df88 fix: Remove f-string prefix from line without placeholders 2024-09-11 14:01:15 -07:00
Paul Gauthier
1603ffa6c2 fix: Update sample.aider.conf.yml and args_formatter.py 2024-09-11 14:01:10 -07:00
Paul Gauthier
615dc5fe4b copy 2024-09-11 13:18:07 -07:00
Paul Gauthier
385f2693c4 copy 2024-09-11 13:14:40 -07:00
Paul Gauthier
35588b6984 fix: Fix formatting of assistant_output assignment in base_coder.py 2024-09-11 09:54:47 -07:00
Paul Gauthier
ca43a37567 copy 2024-09-11 09:53:13 -07:00
Paul Gauthier
5408dcb185 wip 2024-09-11 09:32:14 -07:00
Paul Gauthier
94a609d75e fix: Update model names in edit_leaderboard.yml 2024-09-11 08:56:46 -07:00
Paul Gauthier
13ac0f0968 fix: Update model names and commands in edit_leaderboard.yml 2024-09-11 08:55:25 -07:00
Paul Gauthier
408ecc1bd7 copy 2024-09-11 08:50:35 -07:00
Paul Gauthier
ba54e4a6e0 feat: Add new leaderboard entries for command-r-plus-08-2024 and command-r-08-2024 models 2024-09-11 08:50:28 -07:00
paul-gauthier
b43ed20085 Merge pull request #1492 from jalammar/cohere-model-refresh
Add New Cohere Models
2024-09-11 08:39:42 -07:00
Paul Gauthier
007f841328 copy 2024-09-11 08:18:07 -07:00
Jay Alammar
5cdcbb1a26 Add to docs 2024-09-11 11:04:38 -04:00
Jay Alammar
7315624b98 bugfix 2024-09-11 10:55:45 -04:00
Paul Gauthier
0a3b4147fa test: update main tests to handle None input and add --exit flag 2024-09-10 15:32:43 -07:00
Paul Gauthier (aider)
fa49ab09c4 test: update code_theme tests to check InputOutput initialization 2024-09-10 15:24:11 -07:00
Paul Gauthier
39ae106bb3 wip 2024-09-10 15:21:54 -07:00
paul-gauthier
d1384e9d5f Merge pull request #1402 from caseymcc/io_assistant_output
Modify output from Assistant and Commands to go through InputOutput
2024-09-10 15:08:10 -07:00
Paul Gauthier
33b11d0efb refactor: simplify console initialization and error handling 2024-09-10 14:48:54 -07:00
Paul Gauthier
fd18adb072 refactor: handle prompt toolkit initialization errors gracefully 2024-09-10 14:34:25 -07:00
Paul Gauthier
454c2f4d0e feat: add --exit flag to test cases for controlled termination 2024-09-10 14:30:04 -07:00
Paul Gauthier (aider)
59bdc45728 refactor: Remove unused mock_open import 2024-09-10 14:18:56 -07:00
Paul Gauthier (aider)
645252168c style: sort imports and fix quotation marks 2024-09-10 14:18:37 -07:00
Paul Gauthier (aider)
fb87dd883c test: patch input() to return empty string
This commit patches the `input()` builtin to return an empty string in the test setup, preventing tests from hanging while waiting for user input. It also adds cleanup for the patch in the teardown method.
2024-09-10 14:18:32 -07:00
Paul Gauthier (aider)
8da88eef64 fix: remove unused import of builtins module 2024-09-10 14:09:40 -07:00
Paul Gauthier (aider)
3685f307c7 style: reorder imports in test_io.py 2024-09-10 14:09:33 -07:00
Paul Gauthier (aider)
d5d087123a test: update input mocking in TestInputOutput 2024-09-10 14:09:29 -07:00
Paul Gauthier (aider)
1d312e372d refactor: Remove unused import of 'prompt' from prompt_toolkit 2024-09-10 14:07:32 -07:00
Paul Gauthier (aider)
13fe2036db style: remove trailing whitespace in io.py 2024-09-10 14:06:55 -07:00
Paul Gauthier (aider)
d4e47bc7e7 refactor: update confirm_ask to use prompt_session or input 2024-09-10 14:06:51 -07:00
Paul Gauthier (aider)
79a424bc10 refactor: conditionally initialize and use PromptSession based on pretty flag 2024-09-10 13:49:22 -07:00
Paul Gauthier
ed866d33e4 pip-compiled 2024-09-10 13:40:19 -07:00
Paul Gauthier
04556ef32d Merge remote-tracking branch 'refs/remotes/origin/main' 2024-09-10 13:39:06 -07:00
paul-gauthier
36553d797f Merge pull request #1003 from cclauss/patch-1
Fix typos discovered by codespell
2024-09-10 13:38:59 -07:00
Paul Gauthier
2c08cc47e6 copy 2024-09-10 13:38:25 -07:00
Paul Gauthier (aider)
971fe5017a feat: enable automatic writing of codespell changes in pyproject.toml 2024-09-10 13:38:14 -07:00
Paul Gauthier (aider)
e3e6437dca chore: configure codespell to use pyproject.toml and skip specific files 2024-09-10 13:37:18 -07:00
Paul Gauthier (aider)
c575bae710 feat: add codespell as pre-commit hook 2024-09-10 13:33:27 -07:00
Paul Gauthier (aider)
13f9685f13 style: Format code to comply with linter rules 2024-09-10 13:03:36 -07:00
Paul Gauthier (aider)
00f03d89b9 feat: expand read-only command to handle directories 2024-09-10 13:03:31 -07:00
Paul Gauthier
484fdd7aa3 fix: handle ValueError exception in run_cmd_pexpect function 2024-09-10 12:06:45 -07:00
Paul Gauthier
c152c96fcc copy 2024-09-10 10:05:01 -07:00
Paul Gauthier (aider)
89891efbb8 style: format prompt_session.prompt call to fit on one line 2024-09-10 10:00:05 -07:00
Paul Gauthier (aider)
43eaf91e8d refactor: use pre-initialized PromptSession in prompt_ask function 2024-09-10 10:00:00 -07:00
Paul Gauthier (aider)
bf3a165961 refactor: initialize and reuse PromptSession in InputOutput class 2024-09-10 09:57:09 -07:00
Paul Gauthier
33b69d2ee8 pip-compiled 2024-09-10 09:48:23 -07:00
Paul Gauthier (aider)
766569a278 refactor: Remove unused ctypes import 2024-09-10 09:45:05 -07:00
Paul Gauthier (aider)
cc94b51a0b style: use double quotes for string literals in run_cmd.py 2024-09-10 09:44:57 -07:00
Paul Gauthier (aider)
f1d1d1b37a feat: improve Windows parent process detection using psutil 2024-09-10 09:44:54 -07:00
Paul Gauthier
e84caa48a0 refactor: modify stdout reading chunk size in run_cmd_subprocess 2024-09-10 09:44:52 -07:00
Paul Gauthier (aider)
ab9d9c8429 refactor: improve subprocess output handling for real-time display 2024-09-10 09:34:58 -07:00
Paul Gauthier (aider)
625a49752b refactor: remove psutil dependency and check parent process only on Windows 2024-09-10 09:30:36 -07:00
Paul Gauthier
e5ff5eff75 refactor: rename and simplify parent process name retrieval function 2024-09-10 09:30:35 -07:00
Paul Gauthier (aider)
cb42464676 style: Reorder imports and format code 2024-09-10 09:28:42 -07:00
Paul Gauthier (aider)
5de0a0f7a9 feat: improve shell detection for Windows environments 2024-09-10 09:28:39 -07:00
Paul Gauthier
765ea801b1 refactor: simplify shell command execution logic 2024-09-10 09:25:50 -07:00
Paul Gauthier (aider)
1327c1e893 style: format command string for PowerShell execution 2024-09-10 06:51:43 -07:00
Paul Gauthier (aider)
4605969921 fix: improve PowerShell command execution and output capture on Windows 2024-09-10 06:51:38 -07:00
Paul Gauthier (aider)
e3b7b80280 feat: respect user's shell environment in subprocess execution 2024-09-10 06:40:07 -07:00
Paul Gauthier
b8ce472cb6 copy 2024-09-09 15:20:36 -07:00
Paul Gauthier
6a0ad9629b copy 2024-09-09 15:04:37 -07:00
Paul Gauthier
d99191e07b copy 2024-09-09 15:01:53 -07:00
Paul Gauthier
6cddc800f1 docs: update HISTORY.md and remove git operations from versionbump.py 2024-09-09 15:01:08 -07:00
Paul Gauthier (aider)
de84a08924 style: Apply linter suggestions to versionbump.py 2024-09-09 15:00:41 -07:00
Paul Gauthier (aider)
fb1a9254c7 feat: remove aider/__version__.py after version bump 2024-09-09 15:00:37 -07:00
Paul Gauthier
5420f67b2b copy 2024-09-09 14:56:44 -07:00
Paul Gauthier
fe2e36afda cache ro+repo or just ro if no repo 2024-09-09 14:51:33 -07:00
Paul Gauthier
b216d57107 copy 2024-09-09 14:47:56 -07:00
Paul Gauthier
509c880b68 set version to 0.56.1.dev 2024-09-09 14:46:20 -07:00
Paul Gauthier
6f2b064f53 version bump to 0.56.0 2024-09-09 14:45:11 -07:00
Paul Gauthier
26c2b2e3ed copy 2024-09-09 14:43:35 -07:00
Paul Gauthier
3976d4b8f1 copy 2024-09-09 14:37:18 -07:00
Paul Gauthier
964fe7e2dc fix: handle UnicodeEncodeError in prompt session 2024-09-09 13:56:27 -07:00
Paul Gauthier
eced076602 feat: add IndexError to ANY_GIT_ERROR tuple in repo.py 2024-09-09 13:46:03 -07:00
Paul Gauthier
bd21122e64 refactor: improve error handling for git version check 2024-09-09 13:44:02 -07:00
Paul Gauthier
00f42590c8 feat: add AssertionError to ANY_GIT_ERROR tuple 2024-09-09 13:41:28 -07:00
Paul Gauthier
4e63254704 refactor: Improve error handling in git repository checks 2024-09-09 13:40:56 -07:00
Paul Gauthier
3cd6790d9a fix: handle OSError in git repo operations 2024-09-09 13:37:24 -07:00
Paul Gauthier
d82d21b8c1 refactor: improve error handling for SQLite operations in RepoMap 2024-09-09 13:34:49 -07:00
Paul Gauthier
1a6284cb24 feat: add error handling for parser loading in basic_lint function 2024-09-09 13:28:04 -07:00
Paul Gauthier
abf6a9db2e fix: Handle additional Git-related errors in GitRepo.list_files 2024-09-09 13:26:07 -07:00
Paul Gauthier
73e7d7bd2a fix: handle git errors when listing files in the repository 2024-09-09 12:42:20 -07:00
Paul Gauthier
82f8aa5d6a copy 2024-09-09 10:26:32 -07:00
Paul Gauthier
cee348614e copy 2024-09-08 17:07:25 -07:00
Paul Gauthier
e40a07a8a1 refactor: move import check before API key setup 2024-09-08 09:26:39 -07:00
Paul Gauthier
99dc235a00 Merge remote-tracking branch 'refs/remotes/origin/main' 2024-09-08 09:20:20 -07:00
Paul Gauthier
9982f439e4 feat: improve error handling for import loading 2024-09-08 09:18:20 -07:00
Paul Gauthier (aider)
1e9ff842f3 style: format code with linter 2024-09-08 09:11:08 -07:00
Paul Gauthier (aider)
aeea629d17 feat: add verbose output to check_and_load_imports function 2024-09-08 09:11:03 -07:00
Paul Gauthier
b4389f98fb refactor: Synchronize slow imports and improve error handling 2024-09-08 09:11:00 -07:00
Paul Gauthier (aider)
f54b6860db feat: optimize slow imports loading based on version and executable 2024-09-08 09:07:19 -07:00
Paul Gauthier (aider)
ed7a9c6562 refactor: extract thread launch for load_slow_imports into function 2024-09-08 09:05:55 -07:00
paul-gauthier
ab35e473f3 Merge pull request #1423 from fry69/win-lint-fix
fix: handle OSError when executing lint command
2024-09-08 08:58:14 -07:00
fry69
e526d2890c fix: handle OSError when executing lint command 2024-09-08 13:15:31 +02:00
Paul Gauthier
2eae3738ff Merge remote-tracking branch 'refs/remotes/origin/main' 2024-09-07 07:27:21 -07:00
paul-gauthier
f98b64dd98 Merge pull request #1409 from fry69/fry69-contributing
Update CONTRIBUTING.md
2024-09-07 07:23:15 -07:00
Paul Gauthier
d2379a6d73 feat: add shell command suggestion toggle and related prompts 2024-09-07 07:21:41 -07:00
fry69
84758c6c8d Update CONTRIBUTING.md
fix link to benchmark data folder
2024-09-07 16:11:00 +02:00
Krazer
f4853d166f remove console 2024-09-06 18:08:51 -05:00
Krazer
69b9a4510d remove unused 2024-09-06 17:40:40 -05:00
Krazer
9d4316b1d5 add default empty message 2024-09-06 17:39:22 -05:00
Krazer
11020c8aee send output through InputOutput 2024-09-06 17:35:55 -05:00
Jay Alammar (aider)
df33498cad fix: correct syntax error by removing extra closing parenthesis in ModelSettings definition 2024-09-06 17:07:32 -04:00
Jay Alammar (aider)
d85979e1fb fix: correct syntax error by fixing misplaced parenthesis in ModelSettings entries 2024-09-06 17:07:23 -04:00
Jay Alammar (aider)
74f1ceff93 fix: resolve syntax error by removing extra closing parenthesis in model settings list 2024-09-06 17:07:16 -04:00
Jay Alammar (aider)
68bd2b75c6 refactor: group Cohere models together in the model settings list 2024-09-06 17:06:51 -04:00
Jay Alammar (aider)
5344052aeb feat: add support for new Cohere models command-r-08-2024 and command-r-plus-08-2024 2024-09-06 17:06:11 -04:00
Paul Gauthier
304566a914 added reflection 70b 2024-09-06 13:50:08 -07:00
Paul Gauthier
e9c0c82e03 added reflection 70b 2024-09-06 13:47:14 -07:00
Paul Gauthier
2aef59e624 update name to DeepSeek V2.5 2024-09-06 13:32:15 -07:00
Paul Gauthier
74631eec98 Merge remote-tracking branch 'refs/remotes/origin/main' 2024-09-06 12:02:20 -07:00
Paul Gauthier
abd484bfa7 wip 2024-09-06 12:01:51 -07:00
Paul Gauthier
cc15909629 clean diff edit format 2024-09-06 11:25:20 -07:00
Paul Gauthier
5b584db90c sonnet-sonnet gets 60.2/84.2 2024-09-06 09:49:01 -07:00
paul-gauthier
3a36edb8ec Merge pull request #1397 from fry69/prompt-cache
Enable prompt caching for OpenRouter
2024-09-06 06:04:32 -07:00
fry69
795810ffb8 fix: update model configurations 2024-09-06 13:44:42 +02:00
paul-gauthier
2663233b60 Merge pull request #1388 from cheahjs/docs/cleanup-yi-coder
docs: clean up yi-coder model names
2024-09-05 15:20:29 -07:00
Jun Siang Cheah
8d151a3573 docs: clean up yi-coder model names 2024-09-05 23:04:54 +01:00
Paul Gauthier
1c73e7d43a turn off suggest shell commands during benchmarks 2024-09-05 14:35:34 -07:00
Paul Gauthier
05dcbeecac noop 2024-09-05 14:25:09 -07:00
Paul Gauthier
ff3a75413b sonnet+deep got 60.9/82.0 2024-09-05 13:30:25 -07:00
Paul Gauthier
8cfdcbd976 refactor: remove redundant get_system_info method and update related test 2024-09-05 13:00:32 -07:00
Paul Gauthier (aider)
45855bd96c feat: add get_system_info method to Coder base class 2024-09-05 12:59:12 -07:00
Paul Gauthier (aider)
b57468a963 test: add test for Spanish chat language option 2024-09-05 12:58:18 -07:00
Paul Gauthier
34099408a5 copy 2024-09-05 12:55:09 -07:00
Paul Gauthier (aider)
781996fe84 feat: pass chat language to Coder.create 2024-09-05 12:52:26 -07:00
Paul Gauthier (aider)
3d73fac84c feat: add chat_language parameter to Coder class 2024-09-05 12:49:11 -07:00
Paul Gauthier (aider)
2bcc9a54a9 feat: add --chat-language argument for specifying chat language 2024-09-05 12:47:53 -07:00
Paul Gauthier
e4cbbb1fa8 remove eslint as default linter 2024-09-05 12:45:12 -07:00
Paul Gauthier
a35c532211 refactor: Move json import to top of file and remove unused import 2024-09-05 12:00:44 -07:00
Paul Gauthier (aider)
c2b8522e9a refactor: remove unused json import at top level 2024-09-05 12:00:28 -07:00
Paul Gauthier (aider)
5123d8c5de feat: add json import to main.py 2024-09-05 12:00:13 -07:00
Paul Gauthier (aider)
9b924237b7 style: add newline after json import in main.py 2024-09-05 11:59:56 -07:00
Paul Gauthier (aider)
c04453d282 feat: print model info as formatted JSON in verbose mode 2024-09-05 11:59:50 -07:00
Paul Gauthier
f02da16353 set max_tokens=8192 for deepseek models 2024-09-05 11:58:20 -07:00
Paul Gauthier
6c739d391b refactor: rename --models flag to --list-models 2024-09-05 11:40:31 -07:00
paul-gauthier
e3cd9a8f9a Merge pull request #1383 from fry69/list-models
Add --list-models alias for --models
2024-09-05 10:12:44 -07:00
Paul Gauthier
76bc0e11b8 add deepseek v2.5 to refac bench 2024-09-05 10:07:46 -07:00
fry69 (aider)
485d5487af feat: add --list-models alias for --models option 2024-09-05 18:27:05 +02:00
fry69
246ce318d2 fix: rename --models to --list-models in website docs 2024-09-05 18:23:55 +02:00
Paul Gauthier
6e3d8d90de Add deepseek v2.5 2024-09-05 07:59:32 -07:00
Paul Gauthier
2d866418da feat: add ignore_mentions attribute to cloned Coder instances 2024-09-04 14:40:21 -07:00
Paul Gauthier
ff15bcdb30 copy 2024-09-04 14:34:40 -07:00
Paul Gauthier
e799ada6f5 Merge remote-tracking branch 'refs/remotes/origin/main' 2024-09-04 14:33:59 -07:00
Paul Gauthier (aider)
7c5cad74ab style: Format code to comply with linter rules 2024-09-04 14:32:38 -07:00
Paul Gauthier (aider)
41e8f4401e fix: make test_get_rel_fname compatible with Windows 2024-09-04 14:32:35 -07:00
paul-gauthier
e271941aa2 Merge pull request #1349 from cheahjs/patch-1
docs: add benchmark results for yi-coder 9b
2024-09-04 14:14:36 -07:00
Paul Gauthier (aider)
6152a82513 fix: handle ValueError in os.path.relpath calls 2024-09-04 14:10:56 -07:00
Paul Gauthier
937a1cd847 fix: correct string handling in ESLint file path check 2024-09-04 14:06:30 -07:00
Paul Gauthier
867d19952c fix: handle spaces in ESLint file path for TypeScript linting 2024-09-04 14:05:44 -07:00
Paul Gauthier
7c5d999032 fix: correct eslint path in node_modules directory 2024-09-04 14:02:56 -07:00
Paul Gauthier
6d23b22e6f refactor: Remove redundant TypeScript linter fallback 2024-09-04 14:02:02 -07:00
Paul Gauthier
168598dad4 test: remove redundant Windows-specific ESLint test 2024-09-04 14:01:25 -07:00
Paul Gauthier (aider)
bd7ff9cca4 style: run linter and fix import order 2024-09-04 14:00:33 -07:00
Paul Gauthier (aider)
51f360ab9f fix: update ESLint command assertion in Windows test 2024-09-04 14:00:30 -07:00
Paul Gauthier
66ae9ae079 test: add debug output for linter languages in TestLinter 2024-09-04 14:00:28 -07:00
Paul Gauthier (aider)
65fd6b444c fix: simplify ESLint Windows test mock 2024-09-04 13:58:46 -07:00
Paul Gauthier (aider)
15abe6b921 style: Format long line in test_get_rel_fname method 2024-09-04 13:57:16 -07:00
Paul Gauthier (aider)
d8027030b0 fix: update ESLint check and test expectations 2024-09-04 13:57:09 -07:00
Paul Gauthier (aider)
edd9b44ad3 refactor: Remove unused import of Path from test_linter.py 2024-09-04 13:56:25 -07:00
Paul Gauthier (aider)
14fc3e3ad1 style: format code with black and isort 2024-09-04 13:55:53 -07:00
Paul Gauthier (aider)
cd551dbf63 test: add basic tests for Linter class 2024-09-04 13:55:49 -07:00
Paul Gauthier
ed349b65b5 test: add basic linter tests 2024-09-04 13:55:48 -07:00
Paul Gauthier (aider)
bb5bca5227 feat: support Windows ESLint executables in linter detection 2024-09-04 13:53:18 -07:00
Paul Gauthier (aider)
e98645698b refactor: make ESLint path detection cross-platform compatible 2024-09-04 13:52:41 -07:00
Paul Gauthier (aider)
376e8617f3 style: format eslint paths and remove trailing whitespace 2024-09-04 13:51:57 -07:00
Paul Gauthier (aider)
a3d585a4b4 feat: add ESLint detection for TypeScript linting 2024-09-04 13:51:53 -07:00
Jun Siang Cheah
5853c7fa92 docs: add benchmark results for yi-coder 9b 2024-09-04 18:34:52 +01:00
Paul Gauthier
18bf3a9f36 fixes #1348 2024-09-04 10:27:18 -07:00
Paul Gauthier
e7253d819e copy 2024-09-04 10:16:11 -07:00
Paul Gauthier
75c27a5dfb feat: enhance GitHub issue reporting functionality 2024-09-04 10:14:25 -07:00
Paul Gauthier (aider)
7598f883f5 style: format long line in report command for better readability 2024-09-04 10:09:13 -07:00
Paul Gauthier (aider)
1b5ef76c18 refactor: update cmd_report to use confirm=False and conditional user report prefix 2024-09-04 10:09:07 -07:00
Paul Gauthier (aider)
70994cfc5b feat: add confirm parameter to report_github_issue function 2024-09-04 10:08:16 -07:00
Paul Gauthier
c5ac621da1 docs: Update description of 'report' command 2024-09-04 10:08:08 -07:00
Paul Gauthier (aider)
5c6d4dbbf1 feat: add /report command to submit GitHub issues 2024-09-04 10:05:43 -07:00
Paul Gauthier
9434f99458 copy 2024-09-04 09:27:12 -07:00
Paul Gauthier
9988a3ff79 updated blame 2024-09-04 09:20:40 -07:00
Paul Gauthier
7620067d32 set version to 0.55.1.dev 2024-09-04 09:13:53 -07:00
Paul Gauthier
9c2d13e8a0 version bump to 0.55.0 2024-09-04 09:12:47 -07:00
Paul Gauthier
5a16015f57 copy 2024-09-04 09:10:27 -07:00
Paul Gauthier
8cd2f0ef71 defend against spawn TypeError: sequence item 2: expected str instance, list found 2024-09-04 09:06:17 -07:00
Paul Gauthier
c4e4967691 refactor: improve error handling in run_cmd function 2024-09-04 08:56:34 -07:00
Paul Gauthier (aider)
d8639bac48 feat: add error handling and flexible error reporting to run_cmd 2024-09-04 08:54:30 -07:00
Paul Gauthier
db7590048e refactor: Remove unused import of sys module in run_cmd function 2024-09-04 08:54:26 -07:00
Paul Gauthier
40d5880b44 refactor: improve error handling and messaging for git auto-commit 2024-09-04 08:52:48 -07:00
Paul Gauthier (aider)
cef78282bd feat: add error handling for git operations in auto_commit method 2024-09-04 08:52:11 -07:00
Paul Gauthier (aider)
8d0f7daa3a refactor: update method calls to match renamed raw command methods 2024-09-04 08:44:53 -07:00
Paul Gauthier (aider)
aa98e43d59 refactor: rename raw command methods for consistency 2024-09-04 08:44:25 -07:00
Paul Gauthier (aider)
8609594c0e refactor: split cmd_undo and cmd_commit into raw and exception-handling methods 2024-09-04 08:43:00 -07:00
Paul Gauthier (aider)
bb9cb629e4 style: Remove extra blank line in commands.py 2024-09-04 08:40:28 -07:00
Paul Gauthier (aider)
d68aff6c6b refactor: implement cmd_diff and fix error message 2024-09-04 08:40:23 -07:00
Paul Gauthier
3a78f217b2 feat: add error handling to cmd_diff and create cmd_diff_raw 2024-09-04 08:40:20 -07:00
Paul Gauthier
f3cce95419 refactor: Remove unnecessary strip parameter from tool_output calls 2024-09-03 20:03:11 -07:00
Paul Gauthier
64effaae68 copy 2024-09-03 17:43:41 -07:00
Paul Gauthier (aider)
98835d1f6d test: update sanity check tests to use tool_output instead of tool_warning 2024-09-03 17:21:06 -07:00
Paul Gauthier
9e1ca487e2 copy 2024-09-03 17:15:40 -07:00
Paul Gauthier
1e8f2cbbb9 refactor: handle UnicodeEncodeError by recreating InputOutput object 2024-09-03 17:15:20 -07:00
Paul Gauthier
cc053b0b04 copy 2024-09-03 17:12:05 -07:00
Paul Gauthier
9348a10aaf copy 2024-09-03 15:48:37 -07:00
Paul Gauthier (aider)
e76bd89bc1 style: remove unnecessary whitespace and simplify list comprehension 2024-09-03 15:39:23 -07:00
Paul Gauthier (aider)
098f94d38b refactor: filter special_fnames to exclude existing ranked tags 2024-09-03 15:39:20 -07:00
Paul Gauthier
1e5fdfa4be refactor: Filter out duplicate filenames from special_fnames list 2024-09-03 15:39:18 -07:00
Paul Gauthier
75de2989f8 fix --map-refresh=manual 2024-09-03 15:28:08 -07:00
Paul Gauthier (aider)
d8c78cf8cd test: update sanity_check_model tests to use tool_warning 2024-09-03 13:50:10 -07:00
Paul Gauthier
a6892c0421 copy 2024-09-03 13:47:18 -07:00
Paul Gauthier
a2634224e2 copy 2024-09-03 13:30:38 -07:00
Paul Gauthier
dff814a7a8 refactor: change tool_error to tool_warning for non-critical messages 2024-09-03 13:30:04 -07:00
Paul Gauthier
00fa9efba4 refactor: remove duplicate --light-mode argument 2024-09-03 12:43:59 -07:00
Paul Gauthier (aider)
d92605c447 style: change tool warning color to orange hex code 2024-09-03 12:42:41 -07:00
Paul Gauthier (aider)
84b5433ace feat: add tool_warning_color argument and update color modes 2024-09-03 12:42:25 -07:00
Paul Gauthier (aider)
b088627fcc refactor: extract common code from tool_warning and tool_error 2024-09-03 12:41:05 -07:00
Paul Gauthier (aider)
b4ba159f27 feat: add tool_warning method and warning color option 2024-09-03 12:39:41 -07:00
Paul Gauthier
d9764c1201 copy 2024-09-03 12:35:12 -07:00
Paul Gauthier
53fefa0246 disable built in linter for typescript #1132 2024-09-03 12:28:08 -07:00
Paul Gauthier
8eda666672 copy 2024-09-03 11:17:20 -07:00
Paul Gauthier
9b2c4a501d copy 2024-09-03 10:50:57 -07:00
Paul Gauthier
aedba59c6e feat: add error handling for transcription in Voice class 2024-09-03 08:59:58 -07:00
Paul Gauthier
b3ce70234e feat: add error handling for file writing in InputOutput class 2024-09-03 08:33:22 -07:00
Paul Gauthier
b3928dabbc fix: Resolve KeyError in RepoMap.get_tags_for_file method 2024-09-03 08:10:30 -07:00
Paul Gauthier
8172b7be4b move imports into method 2024-09-03 08:05:21 -07:00
Paul Gauthier (aider)
7b336c9eb4 style: Reorder imports in scrape.py 2024-09-03 08:04:12 -07:00
Paul Gauthier (aider)
58abad72cd refactor: update Playwright error handling 2024-09-03 08:04:08 -07:00
Paul Gauthier
ef4a9dc4ca feat: add error handling for pypandoc conversion in Scraper class 2024-09-03 08:01:45 -07:00
Paul Gauthier
be1e45a4b3 refactor: simplify file existence check and error handling in RepoMap 2024-09-03 07:55:48 -07:00
Paul Gauthier
c8b2024f8b refactor: simplify error handling in get_tracked_files method 2024-09-02 16:03:54 -07:00
Paul Gauthier
387df7f1db fixes #1276 2024-09-02 11:41:10 -07:00
Paul Gauthier
4063015560 ensure IO obeys pretty flag, catch UnicodeDecodeError on launch and disable pretty 2024-09-02 11:31:39 -07:00
Paul Gauthier
3bf403ba05 fixes #1288 2024-09-02 11:18:43 -07:00
Paul Gauthier
d7d3f3a740 catch git errors from all /commands 2024-09-02 11:14:55 -07:00
Paul Gauthier
fcf83cb9ee fixes #1297 2024-09-02 11:10:37 -07:00
Paul Gauthier
7db3ca50e8 fixes #1298 2024-09-02 11:08:38 -07:00
Paul Gauthier
bd012d63e9 catch git errors for commit and diff 2024-09-02 11:02:33 -07:00
Paul Gauthier
2cfdd7ab5b adopt pip's get_best_invocation_for_this_python 2024-09-02 07:24:29 -07:00
Paul Gauthier
ecf80a799d feat: improve version upgrade messaging and display 2024-09-02 07:06:20 -07:00
Paul Gauthier (aider)
f8e2780d40 fix: remove unnecessary f-string prefix 2024-09-02 07:02:08 -07:00
Paul Gauthier
62c89f60bf feat: improve version update handling for Windows and Docker 2024-09-02 07:02:03 -07:00
Paul Gauthier
5fe85f7233 cleanup 2024-09-02 06:46:50 -07:00
Paul Gauthier
e3180f7882 do --no-verify on .dev push 2024-09-01 08:09:15 -07:00
Christian Clauss
9364ce1f15 Fix typos discovered by codespell 2024-08-05 13:37:28 +02:00
140 changed files with 7342 additions and 1143 deletions

View File

@@ -27,22 +27,24 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
env:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
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

1
.gitignore vendored
View File

@@ -11,3 +11,4 @@ _site
.jekyll-cache/
.jekyll-metadata
aider/__version__.py
.venv/

View File

@@ -14,3 +14,9 @@ repos:
hooks:
- id: flake8
args: ["--show-source"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli

View File

@@ -17,10 +17,10 @@ Contributions of
[LLM benchmark results](https://aider.chat/docs/leaderboards/)
are welcome!
See the
[benchmark README](https://github.com/paul-gauthier/aider/blob/main/benchmark/README.md)
[benchmark README](https://github.com/Aider-AI/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/_data/).
[benchmark results data files](https://github.com/Aider-AI/aider/blob/main/aider/website/_data/).
## Pull Requests
@@ -45,7 +45,7 @@ terms.
### Clone the Repository
```
git clone https://github.com/paul-gauthier/aider.git
git clone https://github.com/Aider-AI/aider.git
cd aider
```
@@ -154,6 +154,10 @@ The project's documentation is built using Jekyll and hosted on GitHub Pages. To
```
bundle exec jekyll build
```
5. Preview the website while editing (optional):
```
bundle exec jekyll serve
```
The built documentation will be available in the `aider/website/_site` directory.

View File

@@ -1,6 +1,118 @@
# Release history
### v0.59.0
- Improvements to `/read-only`:
- Now supports shell-style auto-complete of the full file system.
- Still auto-completes the full paths of the repo files like `/add`.
- Now supports globs like `src/**/*.py`
- Renamed `--yes` to `--yes-always`.
- Now uses `AIDER_YES_ALWAYS` env var and `yes-always:` yaml key.
- Existing YAML and .env files will need to be updated.
- Can still abbreviate to `--yes` on the command line.
- Config file now uses standard YAML list syntax with ` - list entries`, one per line.
- `/settings` now includes the same announcement lines that would print at launch.
- Sanity checks the `--editor-model` on launch now, same as main and weak models.
- Added `--skip-sanity-check-repo` switch to speedup launch in large repos.
- Bugfix so architect mode handles Control-C properly.
- Repo-map is deterministic now, with improved caching logic.
- Improved commit message prompt.
- Aider wrote 77% of the code in this release.
### Aider v0.58.1
- Fixed bug where cache warming pings caused subsequent user messages to trigger a tight loop of LLM requests.
### Aider v0.58.0
- [Use a pair of Architect/Editor models for improved coding](https://aider.chat/2024/09/26/architect.html)
- Use a strong reasoning model like o1-preview as your Architect.
- Use a cheaper, faster model like gpt-4o as your Editor.
- New `--o1-preview` and `--o1-mini` shortcuts.
- Support for new Gemini 002 models.
- Better support for Qwen 2.5 models.
- Many confirmation questions can be skipped for the rest of the session with "(D)on't ask again" response.
- Autocomplete for `/read-only` supports the entire filesystem.
- New settings for completion menu colors.
- New `/copy` command to copy the last LLM response to the clipboard.
- Renamed `/clipboard` to `/paste`.
- Will now follow HTTP redirects when scraping urls.
- New `--voice-format` switch to send voice audio as wav/mp3/webm, by @mbailey.
- ModelSettings takes `extra_params` dict to specify any extras to pass to `litellm.completion()`.
- Support for cursor shapes when in vim mode.
- Numerous bug fixes.
- Aider wrote 53% of the code in this release.
### Aider v0.57.1
- Fixed dependency conflict between aider-chat[help] and [playwright].
### Aider v0.57.0
- Support for OpenAI o1 models:
- 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`.
- 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.
- 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
- Enables prompt caching for Sonnet via OpenRouter by @fry69
- Enables 8k output tokens for Sonnet via VertexAI and DeepSeek V2.5.
- New `/report` command to open your browser with a pre-populated GitHub Issue.
- New `--chat-language` switch to set the spoken language.
- Now `--[no-]suggest-shell-commands` controls both prompting for and offering to execute shell commands.
- Check key imports on launch, provide helpful error message if dependencies aren't available.
- Renamed `--models` to `--list-models` by @fry69.
- Numerous bug fixes for corner case crashes.
- Aider wrote 56% of the code in this release.
### Aider v0.55.0
- Only print the pip command when self updating on Windows, without running it.
- Converted many error messages to warning messages.
- Added `--tool-warning-color` setting.
- Blanket catch and handle git errors in any `/command`.
- Catch and handle glob errors in `/add`, errors writing files.
- Disabled built in linter for typescript.
- Catch and handle terminals which don't support pretty output.
- Catch and handle playwright and pandoc errors.
- Catch `/voice` transcription exceptions, show the WAV file so the user can recover it.
- Aider wrote 53% of the code in this release.
### Aider v0.54.12
- Switched to `vX.Y.Z.dev` version naming.
### Aider v0.54.11
- Improved printed pip command output on Windows.
### Aider v0.54.10
- Bugfix to test command in platform info.
### Aider v0.54.9
- Include important devops files in the repomap.
- Print quoted pip install commands to the user.
- Adopt setuptools_scm to provide dev versions with git hashes.
- Share active test and lint commands with the LLM.
- Catch and handle most errors creating new files, reading existing files.
- Catch and handle most git errors.
- Added --verbose debug output for shell commands.
### Aider v0.54.8
- Startup QOL improvements:
@@ -10,7 +122,6 @@
- Do not fuzzy match filenames when LLM is creating a new file, by @ozapinq
- Numerous corner case bug fixes submitted via new crash report -> GitHub Issue feature.
- Crash reports now include python version, OS, etc.
- Aider wrote 56% of the code in this release.
### Aider v0.54.7
@@ -597,7 +708,7 @@
### Aider v0.14.0
- [Support for Claude2 and other LLMs via OpenRouter](https://aider.chat/docs/faq.html#accessing-other-llms-with-openrouter) by @joshuavial
- Documentation for [running the aider benchmarking suite](https://github.com/paul-gauthier/aider/tree/main/benchmark)
- Documentation for [running the aider benchmarking suite](https://github.com/Aider-AI/aider/tree/main/benchmark)
- Aider now requires Python >= 3.9
@@ -642,7 +753,7 @@
- Added `/git` command to run git from inside aider chats.
- Use Meta-ENTER (Esc+ENTER in some environments) to enter multiline chat messages.
- Create a `.gitignore` with `.aider*` to prevent users from accidentaly adding aider files to git.
- Create a `.gitignore` with `.aider*` to prevent users from accidentally adding aider files to git.
- Check pypi for newer versions and notify user.
- Updated keyboard interrupt logic so that 2 ^C in 2 seconds always forces aider to exit.
- Provide GPT with detailed error if it makes a bad edit block, ask for a retry.

View File

@@ -46,7 +46,7 @@ cog.out(open("aider/website/_includes/get-started.md").read())
You can get started quickly like this:
```
python -m pip install aider-chat
python -m pip install -U aider-chat
# Change directory into a git repo
cd /to/your/git/repo
@@ -107,7 +107,7 @@ projects like django, scikitlearn, matplotlib, etc.
- [Configuration](https://aider.chat/docs/config.html)
- [Troubleshooting](https://aider.chat/docs/troubleshooting.html)
- [LLM Leaderboards](https://aider.chat/docs/leaderboards/)
- [GitHub](https://github.com/paul-gauthier/aider)
- [GitHub](https://github.com/Aider-AI/aider)
- [Discord](https://discord.gg/Tv2uQnR88V)
- [Blog](https://aider.chat/blog/)
@@ -118,14 +118,14 @@ projects like django, scikitlearn, matplotlib, etc.
- *The best AI coding assistant so far.* -- [Matthew Berman](https://www.youtube.com/watch?v=df8afeb1FY8)
- *Aider ... has easily quadrupled my coding productivity.* -- [SOLAR_FIELDS](https://news.ycombinator.com/item?id=36212100)
- *It's a cool workflow... Aider's ergonomics are perfect for me.* -- [qup](https://news.ycombinator.com/item?id=38185326)
- *It's really like having your senior developer live right in your Git repo - truly amazing!* -- [rappster](https://github.com/paul-gauthier/aider/issues/124)
- *What an amazing tool. It's incredible.* -- [valyagolev](https://github.com/paul-gauthier/aider/issues/6#issue-1722897858)
- *Aider is such an astounding thing!* -- [cgrothaus](https://github.com/paul-gauthier/aider/issues/82#issuecomment-1631876700)
- *It's really like having your senior developer live right in your Git repo - truly amazing!* -- [rappster](https://github.com/Aider-AI/aider/issues/124)
- *What an amazing tool. It's incredible.* -- [valyagolev](https://github.com/Aider-AI/aider/issues/6#issue-1722897858)
- *Aider is such an astounding thing!* -- [cgrothaus](https://github.com/Aider-AI/aider/issues/82#issuecomment-1631876700)
- *It was WAY faster than I would be getting off the ground and making the first few working versions.* -- [Daniel Feldman](https://twitter.com/d_feldman/status/1662295077387923456)
- *THANK YOU for Aider! It really feels like a glimpse into the future of coding.* -- [derwiki](https://news.ycombinator.com/item?id=38205643)
- *It's just amazing. It is freeing me to do things I felt were out my comfort zone before.* -- [Dougie](https://discord.com/channels/1131200896827654144/1174002618058678323/1174084556257775656)
- *This project is stellar.* -- [funkytaco](https://github.com/paul-gauthier/aider/issues/112#issuecomment-1637429008)
- *Amazing project, definitely the best AI coding assistant I've used.* -- [joshuavial](https://github.com/paul-gauthier/aider/issues/84)
- *This project is stellar.* -- [funkytaco](https://github.com/Aider-AI/aider/issues/112#issuecomment-1637429008)
- *Amazing project, definitely the best AI coding assistant I've used.* -- [joshuavial](https://github.com/Aider-AI/aider/issues/84)
- *I absolutely love using Aider ... It makes software development feel so much lighter as an experience.* -- [principalideal0](https://discord.com/channels/1131200896827654144/1133421607499595858/1229689636012691468)
- *I have been recovering from multiple shoulder surgeries ... and have used aider extensively. It has allowed me to continue productivity.* -- [codeninja](https://www.reddit.com/r/OpenAI/s/nmNwkHy1zG)
- *I am an aider addict. I'm getting so much more work done, but in less time.* -- [dandandan](https://discord.com/channels/1131200896827654144/1131200896827654149/1135913253483069470)

View File

@@ -1,6 +1,6 @@
try:
from aider.__version__ import __version__
except Exception:
__version__ = "0.54.13.dev"
__version__ = "0.59.2.dev"
__all__ = [__version__]

View File

@@ -25,6 +25,7 @@ def get_parser(default_config_files, git_root):
description="aider is AI pair programming in your terminal",
add_config_file_help=True,
default_config_files=default_config_files,
config_file_parser_class=configargparse.YAMLConfigFileParser,
auto_env_var_prefix="AIDER_",
)
group = parser.add_argument_group("Main")
@@ -117,10 +118,27 @@ def get_parser(default_config_files, git_root):
const=deepseek_model,
help=f"Use {deepseek_model} model for the main chat",
)
o1_mini_model = "o1-mini"
group.add_argument(
"--o1-mini",
action="store_const",
dest="model",
const=o1_mini_model,
help=f"Use {o1_mini_model} model for the main chat",
)
o1_preview_model = "o1-preview"
group.add_argument(
"--o1-preview",
action="store_const",
dest="model",
const=o1_preview_model,
help=f"Use {o1_preview_model} model for the main chat",
)
##########
group = parser.add_argument_group("Model Settings")
group.add_argument(
"--list-models",
"--models",
metavar="MODEL",
help="List known models which match the (partial) MODEL name",
@@ -180,6 +198,13 @@ def get_parser(default_config_files, git_root):
default=None,
help="Specify what edit format the LLM should use (default depends on model)",
)
group.add_argument(
"--architect",
action="store_const",
dest="edit_format",
const="architect",
help="Use architect edit format for the main chat",
)
group.add_argument(
"--weak-model",
metavar="WEAK_MODEL",
@@ -189,42 +214,24 @@ def get_parser(default_config_files, git_root):
" depends on --model)"
),
)
group.add_argument(
"--editor-model",
metavar="EDITOR_MODEL",
default=None,
help="Specify the model to use for editor tasks (default depends on --model)",
)
group.add_argument(
"--editor-edit-format",
metavar="EDITOR_EDIT_FORMAT",
default=None,
help="Specify the edit format for the editor model (default: depends on editor model)",
)
group.add_argument(
"--show-model-warnings",
action=argparse.BooleanOptionalAction,
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 (default: auto)",
)
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(
"--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,
@@ -243,6 +250,45 @@ 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(
"--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 = (
@@ -315,13 +361,51 @@ def get_parser(default_config_files, git_root):
group.add_argument(
"--tool-error-color",
default="#FF2222",
help="Set the color for tool error messages (default: red)",
help="Set the color for tool error messages (default: #FF2222)",
)
group.add_argument(
"--tool-warning-color",
default="#FFA500",
help="Set the color for tool warning messages (default: #FFA500)",
)
group.add_argument(
"--assistant-output-color",
default="#0088ff",
help="Set the color for assistant output (default: #0088ff)",
)
group.add_argument(
"--completion-menu-color",
metavar="COLOR",
default=None,
help="Set the color for the completion menu (default: terminal's default text color)",
)
group.add_argument(
"--completion-menu-bg-color",
metavar="COLOR",
default=None,
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=None,
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=None,
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",
@@ -419,6 +503,12 @@ def get_parser(default_config_files, git_root):
default=False,
help="Perform a dry run without modifying files (default: False)",
)
group.add_argument(
"--skip-sanity-check-repo",
action="store_true",
help="Skip the sanity check for the git repository (default: False)",
default=False,
)
group = parser.add_argument_group("Fixing and committing")
group.add_argument(
"--lint",
@@ -480,10 +570,10 @@ def get_parser(default_config_files, git_root):
default=False,
)
group.add_argument(
"--voice-language",
metavar="VOICE_LANGUAGE",
default="en",
help="Specify the language for voice using ISO 639-1 code (default: auto)",
"--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",
@@ -522,7 +612,7 @@ def get_parser(default_config_files, git_root):
help="Apply the changes from the given file instead of running the chat (debug)",
)
group.add_argument(
"--yes",
"--yes-always",
action="store_true",
help="Always say yes to every confirmation",
default=None,
@@ -599,6 +689,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

View File

@@ -144,8 +144,15 @@ class YamlHelpFormatter(argparse.HelpFormatter):
if default:
parts.append(f"#{switch}: {default}\n")
elif action.nargs in ("*", "+") or isinstance(action, argparse._AppendAction):
parts.append(f"#{switch}: xxx")
parts.append("## Specify multiple values like this:")
parts.append(f"#{switch}:")
parts.append(f"# - xxx")
parts.append(f"# - yyy")
parts.append(f"# - zzz")
else:
parts.append(f"#{switch}:\n")
parts.append(f"#{switch}: xxx\n")
###
# parts.append(str(action))

View File

@@ -1,13 +1,16 @@
from .architect_coder import ArchitectCoder
from .ask_coder import AskCoder
from .base_coder import Coder
from .editblock_coder import EditBlockCoder
from .editblock_fenced_coder import EditBlockFencedCoder
from .editor_editblock_coder import EditorEditBlockCoder
from .editor_whole_coder import EditorWholeFileCoder
from .help_coder import HelpCoder
# from .single_wholefile_func_coder import SingleWholeFileFunctionCoder
from .udiff_coder import UnifiedDiffCoder
from .wholefile_coder import WholeFileCoder
# from .single_wholefile_func_coder import SingleWholeFileFunctionCoder
__all__ = [
HelpCoder,
AskCoder,
@@ -17,4 +20,7 @@ __all__ = [
WholeFileCoder,
UnifiedDiffCoder,
# SingleWholeFileFunctionCoder,
ArchitectCoder,
EditorEditBlockCoder,
EditorWholeFileCoder,
]

View File

@@ -0,0 +1,44 @@
from .architect_prompts import ArchitectPrompts
from .ask_coder import AskCoder
from .base_coder import Coder
class ArchitectCoder(AskCoder):
edit_format = "architect"
gpt_prompts = ArchitectPrompts()
def reply_completed(self):
content = self.partial_response_content
if not self.io.confirm_ask("Edit the files?"):
return
kwargs = dict()
# Use the editor_model from the main_model if it exists, otherwise use the main_model itself
editor_model = self.main_model.editor_model or self.main_model
kwargs["main_model"] = editor_model
kwargs["edit_format"] = self.main_model.editor_edit_format
kwargs["suggest_shell_commands"] = False
kwargs["map_tokens"] = 0
kwargs["total_cost"] = self.total_cost
kwargs["cache_prompts"] = False
kwargs["num_cache_warming_pings"] = 0
kwargs["summarize_from_coder"] = False
new_kwargs = dict(io=self.io, from_coder=self)
new_kwargs.update(kwargs)
editor_coder = Coder.create(**new_kwargs)
editor_coder.cur_messages = []
editor_coder.done_messages = []
if self.verbose:
editor_coder.show_announcements()
editor_coder.run(with_message=content, preproc=False)
self.move_back_cur_messages("I made those changes to the files.")
self.total_cost = editor_coder.total_cost
self.aider_commit_hashes = editor_coder.aider_commit_hashes

View File

@@ -0,0 +1,40 @@
# flake8: noqa: E501
from .base_prompts import CoderPrompts
class ArchitectPrompts(CoderPrompts):
main_system = """Act as an expert architect engineer and provide direction to your editor engineer.
Study the change request and the current code.
Describe how to modify the code to complete the request.
The editor engineer will rely solely on your instructions, so make them unambiguous and complete.
Explain all needed code changes clearly and completely, but concisely.
Just show the changes needed.
DO NOT show the entire updated function/file/etc!
Always reply in the same language as the change request.
"""
example_messages = []
files_content_prefix = """I have *added these files to the chat* so you see all of their contents.
*Trust this message as the true contents of the files!*
Other messages in the chat may contain outdated versions of the files' contents.
""" # noqa: E501
files_content_assistant_reply = (
"Ok, I will use that as the true, current contents of the files."
)
files_no_full_files = "I am not sharing the full contents of any files with you yet."
files_no_full_files_with_repo_map = ""
files_no_full_files_with_repo_map_reply = ""
repo_content_prefix = """I am working with you on code in a git repository.
Here are summaries of some files present in my git repo.
If you need to see the full contents of any files to answer my questions, ask me to *add them to the chat*.
"""
system_reminder = ""

View File

@@ -6,7 +6,6 @@ from .base_prompts import CoderPrompts
class AskPrompts(CoderPrompts):
main_system = """Act as an expert code analyst.
Answer questions about the supplied code.
Always reply to the user in the same language they are using.
"""
@@ -17,6 +16,10 @@ Always reply to the user in the same language they are using.
Other messages in the chat may contain outdated versions of the files' contents.
""" # noqa: E501
files_content_assistant_reply = (
"Ok, I will use that as the true, current contents of the files."
)
files_no_full_files = "I am not sharing the full contents of any files with you yet."
files_no_full_files_with_repo_map = ""

View File

@@ -18,16 +18,12 @@ from datetime import datetime
from json.decoder import JSONDecodeError
from pathlib import Path
from rich.console import Console, Text
from rich.markdown import Markdown
from aider import __version__, models, prompts, urls, utils
from aider.commands import Commands
from aider.history import ChatSummary
from aider.io import ConfirmGroup, InputOutput
from aider.linter import Linter
from aider.llm import litellm
from aider.mdstream import MarkdownStream
from aider.repo import ANY_GIT_ERROR, GitRepo
from aider.repomap import RepoMap
from aider.run_cmd import run_cmd
@@ -93,6 +89,7 @@ class Coder:
num_cache_warming_pings = 0
suggest_shell_commands = True
ignore_mentions = None
chat_language = None
@classmethod
def create(
@@ -159,7 +156,9 @@ class Coder:
raise ValueError(f"Unknown edit format {edit_format}")
def clone(self, **kwargs):
return Coder.create(from_coder=self, **kwargs)
new_coder = Coder.create(from_coder=self, **kwargs)
new_coder.ignore_mentions = self.ignore_mentions
return new_coder
def get_announcements(self):
lines = []
@@ -181,6 +180,13 @@ class Coder:
output += ", infinite output"
lines.append(output)
if self.edit_format == "architect":
output = (
f"Editor model: {main_model.editor_model.name} with"
f" {main_model.editor_edit_format} edit format"
)
lines.append(output)
if weak_model is not main_model:
output = f"Weak model: {weak_model.name}"
lines.append(output)
@@ -238,8 +244,6 @@ class Coder:
dry_run=False,
map_tokens=1024,
verbose=False,
assistant_output_color="blue",
code_theme="default",
stream=True,
use_git=True,
cur_messages=None,
@@ -258,7 +262,9 @@ class Coder:
cache_prompts=False,
num_cache_warming_pings=0,
suggest_shell_commands=True,
chat_language=None,
):
self.chat_language = chat_language
self.commit_before_message = []
self.aider_commit_hashes = set()
self.rejected_urls = set()
@@ -310,17 +316,10 @@ class Coder:
self.auto_commits = auto_commits
self.dirty_commits = dirty_commits
self.assistant_output_color = assistant_output_color
self.code_theme = code_theme
self.dry_run = dry_run
self.pretty = self.io.pretty
if self.pretty:
self.console = Console()
else:
self.console = Console(force_terminal=False, no_color=True)
self.main_model = main_model
if cache_prompts and self.main_model.cache_control:
@@ -349,18 +348,18 @@ class Coder:
for fname in fnames:
fname = Path(fname)
if self.repo and self.repo.ignored_file(fname):
self.io.tool_error(f"Skipping {fname} that matches aiderignore spec.")
self.io.tool_warning(f"Skipping {fname} that matches aiderignore spec.")
continue
if not fname.exists():
if utils.touch_file(fname):
self.io.tool_output(f"Creating empty file {fname}")
else:
self.io.tool_error(f"Can not create {fname}, skipping.")
self.io.tool_warning(f"Can not create {fname}, skipping.")
continue
if not fname.is_file():
self.io.tool_error(f"Skipping {fname} that is not a normal file.")
self.io.tool_warning(f"Skipping {fname} that is not a normal file.")
continue
fname = str(fname.resolve())
@@ -378,7 +377,7 @@ class Coder:
if os.path.exists(abs_fname):
self.abs_read_only_fnames.add(abs_fname)
else:
self.io.tool_error(f"Error: Read-only file {fname} does not exist. Skipping.")
self.io.tool_warning(f"Error: Read-only file {fname} does not exist. Skipping.")
if map_tokens is None:
use_repo_map = main_model.use_repo_map
@@ -487,7 +486,7 @@ class Coder:
if content is None:
relative_fname = self.get_rel_fname(fname)
self.io.tool_error(f"Dropping {relative_fname} from the chat.")
self.io.tool_warning(f"Dropping {relative_fname} from the chat.")
self.abs_fnames.remove(fname)
else:
yield fname, content
@@ -501,9 +500,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
@@ -512,7 +512,7 @@ class Coder:
self.fence = (fence_open, fence_close)
else:
self.fence = self.fences[0]
self.io.tool_error(
self.io.tool_warning(
"Unable to find a fencing strategy! Falling back to:"
f" {self.fence[0]}...{self.fence[1]}"
)
@@ -655,7 +655,7 @@ class Coder:
if self.abs_fnames:
files_content = self.gpt_prompts.files_content_prefix
files_content += self.get_files_content()
files_reply = "Ok, any changes I propose will be to those files."
files_reply = self.gpt_prompts.files_content_assistant_reply
elif self.get_repo_map() and self.gpt_prompts.files_no_full_files_with_repo_map:
files_content = self.gpt_prompts.files_no_full_files_with_repo_map
files_reply = self.gpt_prompts.files_no_full_files_with_repo_map_reply
@@ -776,7 +776,7 @@ class Coder:
break
if self.num_reflections >= self.max_reflections:
self.io.tool_error(f"Only {self.max_reflections} reflections allowed, stopping.")
self.io.tool_warning(f"Only {self.max_reflections} reflections allowed, stopping.")
return
self.num_reflections += 1
@@ -789,7 +789,9 @@ class Coder:
group = ConfirmGroup(urls)
for url in urls:
if url not in self.rejected_urls:
if self.io.confirm_ask("Add URL to the chat?", subject=url, group=group):
if self.io.confirm_ask(
"Add URL to the chat?", subject=url, group=group, allow_never=True
):
inp += "\n\n"
inp += self.commands.cmd_web(url)
added_urls.append(url)
@@ -803,10 +805,10 @@ class Coder:
thresh = 2 # seconds
if self.last_keyboard_interrupt and now - self.last_keyboard_interrupt < thresh:
self.io.tool_error("\n\n^C KeyboardInterrupt")
self.io.tool_warning("\n\n^C KeyboardInterrupt")
sys.exit()
self.io.tool_error("\n\n^C again to exit")
self.io.tool_warning("\n\n^C again to exit")
self.last_keyboard_interrupt = now
@@ -826,7 +828,7 @@ class Coder:
try:
self.summarized_done_messages = self.summarizer.summarize(self.done_messages)
except ValueError as err:
self.io.tool_error(err.args[0])
self.io.tool_warning(err.args[0])
if self.verbose:
self.io.tool_output("Finished summarizing chat history.")
@@ -854,6 +856,9 @@ class Coder:
self.cur_messages = []
def get_user_language(self):
if self.chat_language:
return self.chat_language
try:
lang = locale.getlocale()[0]
if lang:
@@ -915,10 +920,21 @@ class Coder:
lazy_prompt = self.gpt_prompts.lazy_prompt if self.main_model.lazy else ""
platform_text = self.get_platform_info()
if self.suggest_shell_commands:
shell_cmd_prompt = self.gpt_prompts.shell_cmd_prompt.format(platform=platform_text)
shell_cmd_reminder = self.gpt_prompts.shell_cmd_reminder.format(platform=platform_text)
else:
shell_cmd_prompt = self.gpt_prompts.no_shell_cmd_prompt.format(platform=platform_text)
shell_cmd_reminder = self.gpt_prompts.no_shell_cmd_reminder.format(
platform=platform_text
)
prompt = prompt.format(
fence=self.fence,
lazy_prompt=lazy_prompt,
platform=platform_text,
shell_cmd_prompt=shell_cmd_prompt,
shell_cmd_reminder=shell_cmd_reminder,
)
return prompt
@@ -960,9 +976,16 @@ class Coder:
chunks = ChatChunks()
chunks.system = [
dict(role="system", content=main_sys),
]
if self.main_model.use_system_prompt:
chunks.system = [
dict(role="system", content=main_sys),
]
else:
chunks.system = [
dict(role="user", content=main_sys),
dict(role="assistant", content="Ok."),
]
chunks.examples = example_messages
self.summarize_end()
@@ -1050,16 +1073,18 @@ class Coder:
self.warming_pings_left -= 1
self.next_cache_warm = time.time() + delay
kwargs = dict(self.main_model.extra_params) or dict()
kwargs["max_tokens"] = 1
try:
completion = litellm.completion(
model=self.main_model.name,
messages=self.cache_warming_chunks.cacheable_messages(),
stream=False,
max_tokens=1,
extra_headers=self.main_model.extra_headers,
**kwargs,
)
except Exception as err:
self.io.tool_error(f"Cache warming error: {str(err)}")
self.io.tool_warning(f"Cache warming error: {str(err)}")
continue
cache_hit_tokens = getattr(
@@ -1089,8 +1114,7 @@ class Coder:
self.multi_response_content = ""
if self.show_pretty() and self.stream:
mdargs = dict(style=self.assistant_output_color, code_theme=self.code_theme)
self.mdstream = MarkdownStream(mdargs=mdargs)
self.mdstream = self.io.get_assistant_mdstream()
else:
self.mdstream = None
@@ -1105,7 +1129,7 @@ class Coder:
yield from self.send(messages, functions=self.functions)
break
except retry_exceptions() as err:
self.io.tool_error(str(err))
self.io.tool_warning(str(err))
retry_delay *= 2
if retry_delay > 60:
break
@@ -1169,6 +1193,11 @@ class Coder:
else:
content = ""
try:
self.reply_completed()
except KeyboardInterrupt:
interrupted = True
if interrupted:
content += "\n^C KeyboardInterrupt"
self.cur_messages += [dict(role="assistant", content=content)]
@@ -1225,6 +1254,9 @@ class Coder:
else:
self.reflected_message = add_rel_files_message
def reply_completed(self):
pass
def show_exhausted_error(self):
output_tokens = 0
if self.partial_response_content:
@@ -1293,7 +1325,7 @@ class Coder:
res += "\n"
if res:
self.io.tool_error(res)
self.io.tool_warning(res)
return res
@@ -1354,7 +1386,7 @@ class Coder:
added_fnames = []
group = ConfirmGroup(new_mentions)
for rel_fname in sorted(new_mentions):
if self.io.confirm_ask(f"Add {rel_fname} to the chat?", group=group):
if self.io.confirm_ask(f"Add {rel_fname} to the chat?", group=group, allow_never=True):
self.add_rel_fname(rel_fname)
added_fnames.append(rel_fname)
else:
@@ -1372,6 +1404,11 @@ class Coder:
self.io.log_llm_history("TO LLM", format_messages(messages))
if self.main_model.use_temperature:
temp = self.temperature
else:
temp = None
completion = None
try:
hash_object, completion = send_completion(
@@ -1379,9 +1416,8 @@ class Coder:
messages,
functions,
self.stream,
self.temperature,
extra_headers=model.extra_headers,
max_tokens=model.max_tokens,
temp,
extra_params=model.extra_params,
)
self.chat_completion_call_hashes.append(hash_object.hexdigest())
@@ -1444,14 +1480,7 @@ class Coder:
raise Exception("No data found in LLM response!")
show_resp = self.render_incremental_response(True)
if self.show_pretty():
show_resp = Markdown(
show_resp, style=self.assistant_output_color, code_theme=self.code_theme
)
else:
show_resp = Text(show_resp or "<no response>")
self.io.console.print(show_resp)
self.io.assistant_output(show_resp, pretty=self.show_pretty())
if (
hasattr(completion.choices[0], "finish_reason")
@@ -1624,7 +1653,10 @@ class Coder:
return cur + new
def get_rel_fname(self, fname):
return os.path.relpath(fname, self.root)
try:
return os.path.relpath(fname, self.root)
except ValueError:
return fname
def get_inchat_relative_files(self):
files = [self.get_rel_fname(fname) for fname in self.abs_fnames]
@@ -1687,7 +1719,7 @@ class Coder:
if not Path(full_path).exists():
if not self.io.confirm_ask("Create new file?", subject=path):
self.io.tool_error(f"Skipping edits to {path}")
self.io.tool_output(f"Skipping edits to {path}")
return
if not self.dry_run:
@@ -1709,7 +1741,7 @@ class Coder:
"Allow edits to file that has not been added to the chat?",
subject=path,
):
self.io.tool_error(f"Skipping edits to {path}")
self.io.tool_output(f"Skipping edits to {path}")
return
if need_to_add:
@@ -1744,8 +1776,8 @@ class Coder:
if tokens < warn_number_of_tokens:
return
self.io.tool_error("Warning: it's best to only add files that need changes to the chat.")
self.io.tool_error(urls.edit_errors)
self.io.tool_warning("Warning: it's best to only add files that need changes to the chat.")
self.io.tool_warning(urls.edit_errors)
self.warning_given = True
def prepare_to_edit(self, edits):
@@ -1788,9 +1820,9 @@ class Coder:
err = err.args[0]
self.io.tool_error("The LLM did not conform to the edit format.")
self.io.tool_error(urls.edit_errors)
self.io.tool_error()
self.io.tool_error(str(err), strip=False)
self.io.tool_output(urls.edit_errors)
self.io.tool_output()
self.io.tool_output(str(err))
self.reflected_message = str(err)
return edited
@@ -1859,17 +1891,20 @@ class Coder:
if not context:
context = self.get_context_from_history(self.cur_messages)
res = self.repo.commit(fnames=edited, context=context, aider_edits=True)
if res:
self.show_auto_commit_outcome(res)
commit_hash, commit_message = res
return self.gpt_prompts.files_content_gpt_edits.format(
hash=commit_hash,
message=commit_message,
)
try:
res = self.repo.commit(fnames=edited, context=context, aider_edits=True)
if res:
self.show_auto_commit_outcome(res)
commit_hash, commit_message = res
return self.gpt_prompts.files_content_gpt_edits.format(
hash=commit_hash,
message=commit_message,
)
self.io.tool_output("No changes made to git tracked files.")
return self.gpt_prompts.files_content_gpt_no_edits
return self.gpt_prompts.files_content_gpt_no_edits
except ANY_GIT_ERROR as err:
self.io.tool_error(f"Unable to commit: {str(err)}")
return
def show_auto_commit_outcome(self, res):
commit_hash, commit_message = res
@@ -1928,7 +1963,11 @@ class Coder:
)
prompt = "Run shell command?" if command_count == 1 else "Run shell commands?"
if not self.io.confirm_ask(
prompt, subject="\n".join(commands), explicit_yes_required=True, group=group
prompt,
subject="\n".join(commands),
explicit_yes_required=True,
group=group,
allow_never=True,
):
return
@@ -1942,12 +1981,12 @@ class Coder:
self.io.tool_output(f"Running {command}")
# Add the command to input history
self.io.add_to_input_history(f"/run {command.strip()}")
exit_status, output = run_cmd(command)
exit_status, output = run_cmd(command, error_print=self.io.tool_error)
if output:
accumulated_output += f"Output from {command}\n{output}\n"
if accumulated_output.strip() and not self.io.confirm_ask(
"Add command output to the chat?"
"Add command output to the chat?", allow_never=True
):
accumulated_output = ""

View File

@@ -22,6 +22,8 @@ You always COMPLETELY IMPLEMENT the needed code!
Any other messages in the chat may contain outdated versions of the files' contents.
""" # noqa: E501
files_content_assistant_reply = "Ok, any changes I propose will be to those files."
files_no_full_files = "I am not sharing any files that you can edit yet."
files_no_full_files_with_repo_map = """Don't try and edit any existing code without asking me to add the files to the chat!
@@ -43,3 +45,8 @@ If you need to edit any of these files, ask me to *add them to the chat* first.
read_only_files_prefix = """Here are some READ ONLY files, provided for your reference.
Do not edit these files!
"""
shell_cmd_prompt = ""
shell_cmd_reminder = ""
no_shell_cmd_prompt = ""
no_shell_cmd_reminder = ""

View File

@@ -31,10 +31,12 @@ class ChatChunks:
else:
self.add_cache_control(self.system)
if self.readonly_files:
self.add_cache_control(self.readonly_files)
else:
if self.repo:
# this will mark both the readonly_files and repomap chunk as cacheable
self.add_cache_control(self.repo)
else:
# otherwise, just cache readonly_files if there are any
self.add_cache_control(self.readonly_files)
self.add_cache_control(self.chat_files)

View File

@@ -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])
@@ -396,7 +400,7 @@ def strip_filename(filename, fence):
filename = filename.strip("`")
filename = filename.strip("*")
# https://github.com/paul-gauthier/aider/issues/1158
# https://github.com/Aider-AI/aider/issues/1158
# filename = filename.replace("\\_", "_")
return filename
@@ -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,15 +448,13 @@ 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(
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:
@@ -460,21 +466,27 @@ 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)

View File

@@ -27,16 +27,18 @@ You can keep asking if you then decide you need to edit more files.
All changes to files must use this *SEARCH/REPLACE block* format.
ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
{shell_cmd_prompt}
"""
shell_cmd_prompt = """
4. *Concisely* suggest any shell commands the user might want to run in ```bash blocks.
Just suggest shell commands this way, not example code.
Only suggest complete shell commands that area ready to execute, without placeholders.
Only suggest complete shell commands that are ready to execute, without placeholders.
Only suggest at most a few shell commands at a time, not more than 1-3.
Use the appropriate shell based on the user's system info:
{platform}
Examples of when to suggest shell commands:
- If you changed a self-contained html file, suggest an OS-appropriate command to open a browser to view it to see the updated content.
@@ -47,6 +49,10 @@ Examples of when to suggest shell commands:
- Etc.
"""
no_shell_cmd_prompt = """
Keep in mind these details about the user's platform and environment:
{platform}
"""
example_messages = [
dict(
role="user",
@@ -176,7 +182,10 @@ To rename files which have been added to the chat, use shell commands at the end
{lazy_prompt}
ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
{shell_cmd_reminder}
"""
shell_cmd_reminder = """
Examples of when to suggest shell commands:
- If you changed a self-contained html file, suggest an OS-appropriate command to open a browser to view it to see the updated content.

View File

@@ -0,0 +1,7 @@
from .editblock_coder import EditBlockCoder
from .editor_editblock_prompts import EditorEditBlockPrompts
class EditorEditBlockCoder(EditBlockCoder):
edit_format = "editor-diff"
gpt_prompts = EditorEditBlockPrompts()

View File

@@ -0,0 +1,16 @@
# flake8: noqa: E501
from .editblock_prompts import EditBlockPrompts
class EditorEditBlockPrompts(EditBlockPrompts):
main_system = """Act as an expert software developer who edits source code.
{lazy_prompt}
Describe each change with a *SEARCH/REPLACE block* per the examples below.
All changes to files must use this *SEARCH/REPLACE block* format.
ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
"""
shell_cmd_prompt = ""
no_shell_cmd_prompt = ""
shell_cmd_reminder = ""

View File

@@ -0,0 +1,7 @@
from .editor_whole_prompts import EditorWholeFilePrompts
from .wholefile_coder import WholeFileCoder
class EditorWholeFileCoder(WholeFileCoder):
edit_format = "editor-whole"
gpt_prompts = EditorWholeFilePrompts()

View File

@@ -0,0 +1,10 @@
# flake8: noqa: E501
from .wholefile_prompts import WholeFilePrompts
class EditorWholeFilePrompts(WholeFilePrompts):
main_system = """Act as an expert software developer and make changes to source code.
{lazy_prompt}
Output a copy of each file that needs changes.
"""

View File

@@ -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:
@@ -127,15 +129,16 @@ class WholeFileCoder(Coder):
def do_live_diff(self, full_path, new_lines, final):
if Path(full_path).exists():
orig_lines = self.io.read_text(full_path).splitlines(keepends=True)
orig_lines = self.io.read_text(full_path)
if orig_lines is not None:
orig_lines = orig_lines.splitlines(keepends=True)
show_diff = diffs.diff_partial_update(
orig_lines,
new_lines,
final=final,
).splitlines()
output = show_diff
else:
output = ["```"] + new_lines + ["```"]
show_diff = diffs.diff_partial_update(
orig_lines,
new_lines,
final=final,
).splitlines()
return show_diff
output = ["```"] + new_lines + ["```"]
return output

View File

@@ -1,13 +1,17 @@
import glob
import os
import re
import subprocess
import sys
import tempfile
from collections import OrderedDict
from os.path import expanduser
from pathlib import Path
import pyperclip
from PIL import Image, ImageGrab
from prompt_toolkit.completion import Completion, PathCompleter
from prompt_toolkit.document import Document
from aider import models, prompts, voice
from aider.format_settings import format_settings
@@ -147,7 +151,7 @@ class Commands:
if not self.scraper:
res = install_playwright(self.io)
if not res:
self.io.tool_error("Unable to initialize playwright.")
self.io.tool_warning("Unable to initialize playwright.")
self.scraper = Scraper(
print_error=self.io.tool_error, playwright_available=res, verify_ssl=self.verify_ssl
@@ -163,6 +167,14 @@ class Commands:
def is_command(self, inp):
return inp[0] in "/!"
def get_raw_completions(self, cmd):
assert cmd.startswith("/")
cmd = cmd[1:]
cmd = cmd.replace("-", "_")
raw_completer = getattr(self, f"completions_raw_{cmd}", None)
return raw_completer
def get_completions(self, cmd):
assert cmd.startswith("/")
cmd = cmd[1:]
@@ -188,10 +200,14 @@ class Commands:
cmd_name = cmd_name.replace("-", "_")
cmd_method_name = f"cmd_{cmd_name}"
cmd_method = getattr(self, cmd_method_name, None)
if cmd_method:
return cmd_method(args)
else:
if not cmd_method:
self.io.tool_output(f"Error: Command {cmd_name} not found.")
return
try:
return cmd_method(args)
except ANY_GIT_ERROR as err:
self.io.tool_error(f"Unable to complete {cmd_name}: {err}")
def matching_commands(self, inp):
words = inp.strip().split()
@@ -227,13 +243,18 @@ class Commands:
def cmd_commit(self, args=None):
"Commit edits to the repo made outside the chat (commit message optional)"
try:
self.raw_cmd_commit(args)
except ANY_GIT_ERROR as err:
self.io.tool_error(f"Unable to complete commit: {err}")
def raw_cmd_commit(self, args=None):
if not self.coder.repo:
self.io.tool_error("No git repository found.")
return
if not self.coder.repo.is_dirty():
self.io.tool_error("No more changes to commit.")
self.io.tool_warning("No more changes to commit.")
return
commit_message = args.strip() if args else None
@@ -254,7 +275,7 @@ class Commands:
fnames = self.coder.repo.get_dirty_files()
if not fnames:
self.io.tool_error("No dirty files to lint.")
self.io.tool_warning("No dirty files to lint.")
return
fnames = [self.coder.abs_root_path(fname) for fname in fnames]
@@ -265,13 +286,13 @@ class Commands:
errors = self.coder.linter.lint(fname)
except FileNotFoundError as err:
self.io.tool_error(f"Unable to lint {fname}")
self.io.tool_error(str(err))
self.io.tool_output(str(err))
continue
if not errors:
continue
self.io.tool_error(errors)
self.io.tool_output(errors)
if not self.io.confirm_ask(f"Fix lint errors in {fname}?", default="y"):
continue
@@ -419,6 +440,12 @@ class Commands:
def cmd_undo(self, args):
"Undo the last git commit if it was done by aider"
try:
self.raw_cmd_undo(args)
except ANY_GIT_ERROR as err:
self.io.tool_error(f"Unable to complete undo: {err}")
def raw_cmd_undo(self, args):
if not self.coder.repo:
self.io.tool_error("No git repository found.")
return
@@ -432,7 +459,7 @@ class Commands:
last_commit_message = self.coder.repo.get_head_commit_message("(unknown)").strip()
if last_commit_hash not in self.coder.aider_commit_hashes:
self.io.tool_error("The last commit was not made by aider in this chat session.")
self.io.tool_error(
self.io.tool_output(
"You could try `/git reset --hard HEAD^` but be aware that this is a destructive"
" command!"
)
@@ -492,12 +519,12 @@ class Commands:
if unrestored:
self.io.tool_error(f"Error restoring {file_path}, aborting undo.")
self.io.tool_error("Restored files:")
self.io.tool_output("Restored files:")
for file in restored:
self.io.tool_error(f" {file}")
self.io.tool_error("Unable to restore files:")
self.io.tool_output(f" {file}")
self.io.tool_output("Unable to restore files:")
for file in unrestored:
self.io.tool_error(f" {file}")
self.io.tool_output(f" {file}")
return
# Move the HEAD back before the latest commit
@@ -515,6 +542,12 @@ class Commands:
def cmd_diff(self, args=""):
"Display the diff of changes since the last message"
try:
self.raw_cmd_diff(args)
except ANY_GIT_ERROR as err:
self.io.tool_error(f"Unable to complete diff: {err}")
def raw_cmd_diff(self, args=""):
if not self.coder.repo:
self.io.tool_error("No git repository found.")
return
@@ -530,7 +563,7 @@ class Commands:
commit_before_message = self.coder.commit_before_message[-2]
if not commit_before_message or commit_before_message == current_head:
self.io.tool_error("No changes to display since the last message.")
self.io.tool_warning("No changes to display since the last message.")
return
self.io.tool_output(f"Diff since {commit_before_message[:7]}...")
@@ -541,16 +574,69 @@ class Commands:
"HEAD",
)
# don't use io.tool_output() because we don't want to log or further colorize
print(diff)
self.io.print(diff)
def quote_fname(self, fname):
if " " in fname and '"' not in fname:
fname = f'"{fname}"'
return fname
def completions_read_only(self):
return self.completions_add()
def completions_raw_read_only(self, document, complete_event):
# Get the text before the cursor
text = document.text_before_cursor
# Skip the first word and the space after it
after_command = text.split()[-1]
# Create a new Document object with the text after the command
new_document = Document(after_command, cursor_position=len(after_command))
def get_paths():
return [self.coder.root] if self.coder.root else None
path_completer = PathCompleter(
get_paths=get_paths,
only_directories=False,
expanduser=True,
)
# Adjust the start_position to replace all of 'after_command'
adjusted_start_position = -len(after_command)
# Collect all completions
all_completions = []
# Iterate over the completions and modify them
for completion in path_completer.get_completions(new_document, complete_event):
quoted_text = self.quote_fname(after_command + completion.text)
all_completions.append(
Completion(
text=quoted_text,
start_position=adjusted_start_position,
display=completion.display,
style=completion.style,
selected_style=completion.selected_style,
)
)
# Add completions from the 'add' command
add_completions = self.completions_add()
for completion in add_completions:
if after_command in completion:
all_completions.append(
Completion(
text=completion,
start_position=adjusted_start_position,
display=completion,
)
)
# Sort all completions based on their text
sorted_completions = sorted(all_completions, key=lambda c: c.text)
# Yield the sorted completions
for completion in sorted_completions:
yield completion
def completions_add(self):
files = set(self.coder.get_all_relative_files())
@@ -559,14 +645,17 @@ class Commands:
return files
def glob_filtered_to_repo(self, pattern):
if not pattern:
if not pattern.strip():
return []
try:
if os.path.isabs(pattern):
# Handle absolute paths
raw_matched_files = [Path(pattern)]
else:
raw_matched_files = list(Path(self.coder.root).glob(pattern))
try:
raw_matched_files = list(Path(self.coder.root).glob(pattern))
except IndexError:
raw_matched_files = []
except ValueError as err:
self.io.tool_error(f"Error matching {pattern}: {err}")
raw_matched_files = []
@@ -602,7 +691,7 @@ class Commands:
fname = Path(self.coder.root) / word
if self.coder.repo and self.coder.repo.ignored_file(fname):
self.io.tool_error(f"Skipping {fname} due to aiderignore or --subtree-only.")
self.io.tool_warning(f"Skipping {fname} due to aiderignore or --subtree-only.")
continue
if fname.exists():
@@ -625,7 +714,7 @@ class Commands:
if fname.exists() and fname.is_dir() and self.coder.repo:
self.io.tool_error(f"Directory {fname} is not in git.")
self.io.tool_error(f"You can add to git with: /git add {fname}")
self.io.tool_output(f"You can add to git with: /git add {fname}")
continue
if self.io.confirm_ask(f"No files matched '{word}'. Do you want to create {fname}?"):
@@ -645,7 +734,8 @@ class Commands:
continue
if abs_file_path in self.coder.abs_fnames:
self.io.tool_error(f"{matched_file} is already in the chat")
self.io.tool_error(f"{matched_file} is already in the chat as an editable file")
continue
elif abs_file_path in self.coder.abs_read_only_fnames:
if self.coder.repo and self.coder.repo.path_in_repo(matched_file):
self.coder.abs_read_only_fnames.remove(abs_file_path)
@@ -712,7 +802,7 @@ class Commands:
self.io.tool_output(f"Removed {matched_file} from the chat")
def cmd_git(self, args):
"Run a git command"
"Run a git command (output excluded from chat)"
combined_output = None
try:
args = "git " + args
@@ -742,19 +832,26 @@ class Commands:
if not args and self.coder.test_cmd:
args = self.coder.test_cmd
if not args:
return
if not callable(args):
if type(args) is not str:
raise ValueError(repr(args))
return self.cmd_run(args, True)
errors = args()
if not errors:
return
self.io.tool_error(errors, strip=False)
self.io.tool_output(errors)
return errors
def cmd_run(self, args, add_on_nonzero_exit=False):
"Run a shell command and optionally add the output to the chat (alias: !)"
exit_status, combined_output = run_cmd(args, verbose=self.verbose)
exit_status, combined_output = run_cmd(
args, verbose=self.verbose, error_print=self.io.tool_error
)
instructions = None
if combined_output is None:
@@ -915,6 +1012,10 @@ class Commands:
"Ask for changes to your code"
return self._generic_chat_command(args, self.coder.main_model.edit_format)
def cmd_architect(self, args):
"Enter architect mode to discuss high-level design and architecture"
return self._generic_chat_command(args, "architect")
def _generic_chat_command(self, args, edit_format):
if not args.strip():
self.io.tool_error(f"Please provide a question or topic for the {edit_format} chat.")
@@ -967,7 +1068,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?"
@@ -999,14 +1100,15 @@ class Commands:
if text:
self.io.add_to_input_history(text)
print()
self.io.print()
self.io.user_input(text, log_only=False)
print()
self.io.print()
return text
def cmd_clipboard(self, args):
"Add image/text from the clipboard to the chat (optionally provide a name for the image)"
def cmd_paste(self, args):
"""Paste image/text from the clipboard into the chat.\
Optionally provide a name for the image."""
try:
# Check for image first
image = ImageGrab.grabclipboard()
@@ -1057,33 +1159,60 @@ class Commands:
def cmd_read_only(self, args):
"Add files to the chat that are for reference, not to be edited"
if not args.strip():
self.io.tool_error("Please provide filenames to read.")
self.io.tool_error("Please provide filenames or directories to read.")
return
filenames = parse_quoted_filenames(args)
for word in filenames:
# Expand the home directory if the path starts with "~"
expanded_path = os.path.expanduser(word)
abs_path = self.coder.abs_root_path(expanded_path)
for pattern in filenames:
# Expand tilde for home directory
expanded_pattern = expanduser(pattern)
if not os.path.exists(abs_path):
self.io.tool_error(f"File not found: {abs_path}")
expanded_paths = glob.glob(expanded_pattern, recursive=True)
if not expanded_paths:
self.io.tool_error(f"No matches found for: {pattern}")
continue
if not os.path.isfile(abs_path):
self.io.tool_error(f"Not a file: {abs_path}")
continue
if abs_path in self.coder.abs_fnames:
self.io.tool_error(f"{word} is already in the chat as an editable file")
continue
if abs_path in self.coder.abs_read_only_fnames:
self.io.tool_error(f"{word} is already in the chat as a read-only file")
continue
for path in expanded_paths:
abs_path = self.coder.abs_root_path(path)
if os.path.isfile(abs_path):
self._add_read_only_file(abs_path, path)
elif os.path.isdir(abs_path):
self._add_read_only_directory(abs_path, path)
else:
self.io.tool_error(f"Not a file or directory: {abs_path}")
def _add_read_only_file(self, abs_path, original_name):
if abs_path in self.coder.abs_read_only_fnames:
self.io.tool_error(f"{original_name} is already in the chat as a read-only file")
return
elif abs_path in self.coder.abs_fnames:
self.coder.abs_fnames.remove(abs_path)
self.coder.abs_read_only_fnames.add(abs_path)
self.io.tool_output(f"Added {word} to read-only files.")
self.io.tool_output(
f"Moved {original_name} from editable to read-only files in the chat"
)
else:
self.coder.abs_read_only_fnames.add(abs_path)
self.io.tool_output(f"Added {original_name} to read-only files.")
def _add_read_only_directory(self, abs_path, original_name):
added_files = 0
for root, _, files in os.walk(abs_path):
for file in files:
file_path = os.path.join(root, file)
if (
file_path not in self.coder.abs_fnames
and file_path not in self.coder.abs_read_only_fnames
):
self.coder.abs_read_only_fnames.add(file_path)
added_files += 1
if added_files > 0:
self.io.tool_output(
f"Added {added_files} files from directory {original_name} to read-only files."
)
else:
self.io.tool_output(f"No new files added from directory {original_name}.")
def cmd_map(self, args):
"Print out the current repository map"
@@ -1102,7 +1231,50 @@ class Commands:
def cmd_settings(self, args):
"Print out the current settings"
settings = format_settings(self.parser, self.args)
self.io.tool_output(settings)
announcements = "\n".join(self.coder.get_announcements())
output = f"{announcements}\n{settings}"
self.io.tool_output(output)
def cmd_copy(self, args):
"Copy the last assistant message to the clipboard"
all_messages = self.coder.done_messages + self.coder.cur_messages
assistant_messages = [msg for msg in reversed(all_messages) if msg["role"] == "assistant"]
if not assistant_messages:
self.io.tool_error("No assistant messages found to copy.")
return
last_assistant_message = assistant_messages[0]["content"]
try:
pyperclip.copy(last_assistant_message)
preview = (
last_assistant_message[:50] + "..."
if len(last_assistant_message) > 50
else last_assistant_message
)
self.io.tool_output(f"Copied last assistant message to clipboard. Preview: {preview}")
except pyperclip.PyperclipException as e:
self.io.tool_error(f"Failed to copy to clipboard: {str(e)}")
self.io.tool_output(
"You may need to install xclip or xsel on Linux, or pbcopy on macOS."
)
except Exception as e:
self.io.tool_error(f"An unexpected error occurred while copying to clipboard: {str(e)}")
def cmd_report(self, args):
"Report a problem by opening a GitHub Issue"
from aider.report import report_github_issue
announcements = "\n".join(self.coder.get_announcements())
issue_text = announcements
if args.strip():
title = args.strip()
else:
title = None
report_github_issue(issue_text, title=title, confirm=False)
def expand_subdir(file_path):
@@ -1123,11 +1295,7 @@ def parse_quoted_filenames(args):
def get_help_md():
from aider.coders import Coder
from aider.models import Model
coder = Coder(Model("gpt-3.5-turbo"), None)
md = coder.commands.get_help_md()
md = Commands(None, None).get_help_md()
return md

View File

@@ -26,6 +26,10 @@ class CaptureIO(InputOutput):
self.lines.append(msg)
super().tool_error(msg)
def tool_warning(self, msg):
self.lines.append(msg)
super().tool_warning(msg)
def get_captured_lines(self):
lines = self.lines
self.lines = []
@@ -156,7 +160,7 @@ class GUI:
st.warning(
"This browser version of aider is experimental. Please share feedback in [GitHub"
" issues](https://github.com/paul-gauthier/aider/issues)."
" issues](https://github.com/Aider-AI/aider/issues)."
)
def do_settings_tab(self):
@@ -524,7 +528,7 @@ def gui_main():
page_icon=urls.favicon,
menu_items={
"Get Help": urls.website,
"Report a bug": "https://github.com/paul-gauthier/aider/issues",
"Report a bug": "https://github.com/Aider-AI/aider/issues",
"About": "# Aider\nAI pair programming in your browser.",
},
)

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env python
import json
import os
import shutil
import warnings
from pathlib import Path
@@ -69,12 +71,17 @@ def get_index():
dname = Path.home() / ".aider" / "caches" / ("help." + __version__)
if dname.exists():
storage_context = StorageContext.from_defaults(
persist_dir=dname,
)
index = load_index_from_storage(storage_context)
else:
index = None
try:
if dname.exists():
storage_context = StorageContext.from_defaults(
persist_dir=dname,
)
index = load_index_from_storage(storage_context)
except (OSError, json.JSONDecodeError):
shutil.rmtree(dname)
if index is None:
parser = MarkdownNodeParser()
nodes = []

View File

@@ -109,7 +109,7 @@ class ChatSummary:
for model in self.models:
try:
summary = simple_send_with_retries(
model.name, summarize_messages, extra_headers=model.extra_headers
model.name, summarize_messages, extra_params=model.extra_params
)
if summary is not None:
summary = prompts.summary_prefix + summary

View File

@@ -5,8 +5,8 @@ from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from prompt_toolkit import prompt
from prompt_toolkit.completion import Completer, Completion, ThreadedCompleter
from prompt_toolkit.cursor_shapes import ModalCursorShapeConfig
from prompt_toolkit.enums import EditingMode
from prompt_toolkit.history import FileHistory
from prompt_toolkit.key_binding import KeyBindings
@@ -16,9 +16,12 @@ 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 aider.mdstream import MarkdownStream
from .dump import dump # noqa: F401
from .utils import is_image_file
@@ -90,17 +93,16 @@ class AutoCompleter(Completer):
(token[1], f"`{token[1]}`") for token in tokens if token[0] in Token.Name
)
def get_command_completions(self, text, words):
candidates = []
def get_command_completions(self, document, complete_event, text, words):
if len(words) == 1 and not text[-1].isspace():
partial = words[0].lower()
candidates = [cmd for cmd in self.command_names if cmd.startswith(partial)]
return candidates
for candidate in sorted(candidates):
yield Completion(candidate, start_position=-len(words[-1]))
return
if len(words) <= 1:
return []
if text[-1].isspace():
return []
if len(words) <= 1 or text[-1].isspace():
return
cmd = words[0]
partial = words[-1].lower()
@@ -111,6 +113,11 @@ class AutoCompleter(Completer):
elif cmd not in matches:
return
raw_completer = self.commands.get_raw_completions(cmd)
if raw_completer:
yield from raw_completer(document, complete_event)
return
if cmd not in self.command_completions:
candidates = self.commands.get_completions(cmd)
self.command_completions[cmd] = candidates
@@ -121,7 +128,8 @@ class AutoCompleter(Completer):
return
candidates = [word for word in candidates if partial in word.lower()]
return candidates
for candidate in sorted(candidates):
yield Completion(candidate, start_position=-len(words[-1]))
def get_completions(self, document, complete_event):
self.tokenize()
@@ -136,11 +144,8 @@ class AutoCompleter(Completer):
return
if text[0] == "/":
candidates = self.get_command_completions(text, words)
if candidates is not None:
for candidate in sorted(candidates):
yield Completion(candidate, start_position=-len(words[-1]))
return
yield from self.get_command_completions(document, complete_event, text, words)
return
candidates = self.words
candidates.update(set(self.fname_to_rel_fnames))
@@ -176,11 +181,19 @@ class InputOutput:
user_input_color="blue",
tool_output_color=None,
tool_error_color="red",
tool_warning_color="#FFA500",
assistant_output_color="blue",
completion_menu_color=None,
completion_menu_bg_color=None,
completion_menu_current_color=None,
completion_menu_current_bg_color=None,
code_theme="default",
encoding="utf-8",
dry_run=False,
llm_history_file=None,
editingmode=EditingMode.EMACS,
):
self.never_prompts = set()
self.editingmode = editingmode
no_color = os.environ.get("NO_COLOR")
if no_color is not None and no_color != "":
@@ -189,6 +202,14 @@ class InputOutput:
self.user_input_color = user_input_color if pretty else None
self.tool_output_color = tool_output_color if pretty else None
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
self.output = output
@@ -209,14 +230,65 @@ class InputOutput:
self.encoding = encoding
self.dry_run = dry_run
if pretty:
self.console = Console()
else:
self.console = Console(force_terminal=False, no_color=True)
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
self.append_chat_history(f"\n# aider chat started at {current_time}\n\n")
self.prompt_session = None
if self.pretty:
# Initialize PromptSession
session_kwargs = {
"input": self.input,
"output": self.output,
"lexer": PygmentsLexer(MarkdownLexer),
"editing_mode": self.editingmode,
"cursor": ModalCursorShapeConfig(),
}
if self.input_history_file is not None:
session_kwargs["history"] = FileHistory(self.input_history_file)
try:
self.prompt_session = PromptSession(**session_kwargs)
self.console = Console() # pretty console
except Exception as err:
self.console = Console(force_terminal=False, no_color=True)
self.tool_error(f"Can't initialize prompt toolkit: {err}") # non-pretty
else:
self.console = Console(force_terminal=False, no_color=True) # non-pretty
def _get_style(self):
style_dict = {}
if not self.pretty:
return Style.from_dict(style_dict)
if self.user_input_color:
style_dict.setdefault("", self.user_input_color)
style_dict.update(
{
"pygments.literal.string": f"bold italic {self.user_input_color}",
}
)
# Conditionally add 'completion-menu' style
completion_menu_style = []
if self.completion_menu_bg_color:
completion_menu_style.append(f"bg:{self.completion_menu_bg_color}")
if self.completion_menu_color:
completion_menu_style.append(self.completion_menu_color)
if completion_menu_style:
style_dict["completion-menu"] = " ".join(completion_menu_style)
# Conditionally add 'completion-menu.completion.current' style
completion_menu_current_style = []
if self.completion_menu_current_bg_color:
completion_menu_current_style.append(f"bg:{self.completion_menu_current_bg_color}")
if self.completion_menu_current_color:
completion_menu_current_style.append(self.completion_menu_current_color)
if completion_menu_current_style:
style_dict["completion-menu.completion.current"] = " ".join(
completion_menu_current_style
)
return Style.from_dict(style_dict)
def read_image(self, filename):
try:
with open(str(filename), "rb") as image_file:
@@ -259,8 +331,18 @@ class InputOutput:
def write_text(self, filename, content):
if self.dry_run:
return
with open(str(filename), "w", encoding=self.encoding) as f:
f.write(content)
try:
with open(str(filename), "w", encoding=self.encoding) as f:
f.write(content)
except OSError as err:
self.tool_error(f"Unable to write file {filename}: {err}")
def rule(self):
if self.pretty:
style = dict(style=self.user_input_color) if self.user_input_color else dict()
self.console.rule(**style)
else:
print()
def get_input(
self,
@@ -271,11 +353,7 @@ class InputOutput:
abs_read_only_fnames=None,
edit_format=None,
):
if self.pretty:
style = dict(style=self.user_input_color) if self.user_input_color else dict()
self.console.rule(**style)
else:
print()
self.rule()
rel_fnames = list(rel_fnames)
show = ""
@@ -288,15 +366,7 @@ class InputOutput:
inp = ""
multiline_input = False
if self.user_input_color:
style = Style.from_dict(
{
"": self.user_input_color,
"pygments.literal.string": f"bold italic {self.user_input_color}",
}
)
else:
style = None
style = self._get_style()
completer_instance = ThreadedCompleter(
AutoCompleter(
@@ -309,35 +379,36 @@ 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")
while True:
if multiline_input:
show = ". "
session_kwargs = {
"message": show,
"completer": completer_instance,
"reserve_space_for_menu": 4,
"complete_style": CompleteStyle.MULTI_COLUMN,
"input": self.input,
"output": self.output,
"lexer": PygmentsLexer(MarkdownLexer),
}
if style:
session_kwargs["style"] = style
if self.input_history_file is not None:
session_kwargs["history"] = FileHistory(self.input_history_file)
kb = KeyBindings()
@kb.add("escape", "c-m", eager=True)
def _(event):
event.current_buffer.insert_text("\n")
session = PromptSession(
key_bindings=kb, editing_mode=self.editingmode, **session_kwargs
)
line = session.prompt()
try:
if self.prompt_session:
line = self.prompt_session.prompt(
show,
completer=completer_instance,
reserve_space_for_menu=4,
complete_style=CompleteStyle.MULTI_COLUMN,
style=style,
key_bindings=kb,
)
else:
line = input(show)
except UnicodeEncodeError as err:
self.tool_error(str(err))
return ""
if line and line[0] == "{" and not multiline_input:
multiline_input = True
@@ -380,8 +451,12 @@ class InputOutput:
log_file.write(content + "\n")
def user_input(self, inp, log_only=True):
if not log_only and self.pretty:
style = dict(style=self.user_input_color) if self.user_input_color else dict()
if not log_only:
if self.pretty and self.user_input_color:
style = dict(style=self.user_input_color)
else:
style = dict()
self.console.print(Text(inp), **style)
prefix = "####"
@@ -403,12 +478,25 @@ class InputOutput:
self.append_chat_history(hist)
def confirm_ask(
self, question, default="y", subject=None, explicit_yes_required=False, group=None
self,
question,
default="y",
subject=None,
explicit_yes_required=False,
group=None,
allow_never=False,
):
self.num_user_asks += 1
question_id = (question, subject)
if question_id in self.never_prompts:
return False
if group and not group.show_group:
group = None
if group:
allow_never = True
valid_responses = ["yes", "no"]
options = " (Y)es/(N)o"
@@ -418,6 +506,10 @@ class InputOutput:
valid_responses.append("all")
options += "/(S)kip all"
valid_responses.append("skip")
if allow_never:
options += "/(D)on't ask again"
valid_responses.append("don't")
question += options + " [Yes]: "
if subject:
@@ -431,10 +523,7 @@ class InputOutput:
else:
self.tool_output(subject, bold=True)
if self.pretty and self.user_input_color:
style = {"": self.user_input_color}
else:
style = dict()
style = self._get_style()
def is_valid_response(text):
if not text:
@@ -450,10 +539,14 @@ class InputOutput:
self.user_input(f"{question}{res}", log_only=False)
else:
while True:
res = prompt(
question,
style=Style.from_dict(style),
)
if self.prompt_session:
res = self.prompt_session.prompt(
question,
style=style,
)
else:
res = input(question)
if not res:
res = "y" # Default to Yes if no input
break
@@ -467,6 +560,12 @@ class InputOutput:
res = res.lower()[0]
if res == "d" and allow_never:
self.never_prompts.add(question_id)
hist = f"{question.strip()} {res}"
self.append_chat_history(hist, linebreak=True, blockquote=True)
return False
if explicit_yes_required:
is_yes = res == "y"
else:
@@ -493,17 +592,17 @@ class InputOutput:
self.tool_output()
self.tool_output(subject, bold=True)
if self.pretty and self.user_input_color:
style = Style.from_dict({"": self.user_input_color})
else:
style = None
style = self._get_style()
if self.yes is True:
res = "yes"
elif self.yes is False:
res = "no"
else:
res = prompt(question + " ", default=default, style=style)
if self.prompt_session:
res = self.prompt_session.prompt(question + " ", default=default, style=style)
else:
res = input(question + " ")
hist = f"{question.strip()} {res.strip()}"
self.append_chat_history(hist, linebreak=True, blockquote=True)
@@ -512,36 +611,68 @@ class InputOutput:
return res
def tool_error(self, message="", strip=True):
self.num_error_outputs += 1
def _tool_message(self, message="", strip=True, color=None):
if message.strip():
if "\n" in message:
for line in message.splitlines():
self.append_chat_history(line, linebreak=True, blockquote=True, strip=strip)
else:
if strip:
hist = message.strip()
else:
hist = message
hist = message.strip() if strip else message
self.append_chat_history(hist, linebreak=True, blockquote=True)
message = Text(message)
style = dict(style=self.tool_error_color) if self.tool_error_color else dict()
style = dict(style=color) if self.pretty and color else dict()
self.console.print(message, **style)
def tool_error(self, message="", strip=True):
self.num_error_outputs += 1
self._tool_message(message, strip, self.tool_error_color)
def tool_warning(self, message="", strip=True):
self._tool_message(message, strip, self.tool_warning_color)
def tool_output(self, *messages, log_only=False, bold=False):
if messages:
hist = " ".join(messages)
hist = f"{hist.strip()}"
self.append_chat_history(hist, linebreak=True, blockquote=True)
if not log_only:
messages = list(map(Text, messages))
style = dict(color=self.tool_output_color) if self.tool_output_color else dict()
if log_only:
return
messages = list(map(Text, messages))
style = dict()
if self.pretty:
if self.tool_output_color:
style["color"] = self.tool_output_color
style["reverse"] = bold
style = RichStyle(**style)
self.console.print(*messages, style=style)
style = RichStyle(**style)
self.console.print(*messages, style=style)
def get_assistant_mdstream(self):
mdargs = dict(style=self.assistant_output_color, code_theme=self.code_theme)
mdStream = MarkdownStream(mdargs=mdargs)
return mdStream
def assistant_output(self, message, pretty=None):
show_resp = message
# Coder will force pretty off if fence is not triple-backticks
if pretty is None:
pretty = self.pretty
if pretty:
show_resp = Markdown(
message, style=self.assistant_output_color, code_theme=self.code_theme
)
else:
show_resp = Text(message or "<no response>")
self.console.print(show_resp)
def print(self, message=""):
print(message)
def append_chat_history(self, text, linebreak=False, blockquote=False, strip=True):
if blockquote:
@@ -556,7 +687,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(

View File

@@ -35,7 +35,10 @@ class Linter:
def get_rel_fname(self, fname):
if self.root:
return os.path.relpath(fname, self.root)
try:
return os.path.relpath(fname, self.root)
except ValueError:
return fname
else:
return fname
@@ -43,14 +46,18 @@ class Linter:
cmd += " " + rel_fname
cmd = cmd.split()
process = subprocess.Popen(
cmd,
cwd=self.root,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
encoding=self.encoding,
errors="replace",
)
try:
process = subprocess.Popen(
cmd,
cwd=self.root,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
encoding=self.encoding,
errors="replace",
)
except OSError as err:
print(f"Unable to execute lint command: {err}")
return
stdout, _ = process.communicate()
errors = stdout
if process.returncode == 0:
@@ -76,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()
@@ -198,7 +209,16 @@ def basic_lint(fname, code):
if not lang:
return
parser = get_parser(lang)
# Tree-sitter linter is not capable of working with typescript #1132
if lang == "typescript":
return
try:
parser = get_parser(lang)
except Exception as err:
print(f"Unable to load parser: {err}")
return
tree = parser.parse(bytes(code, "utf-8"))
errors = traverse_tree(tree.root_node)

View File

@@ -1,15 +1,17 @@
import configparser
import json
import os
import re
import sys
import threading
import traceback
from pathlib import Path
import git
from dotenv import load_dotenv
from prompt_toolkit.enums import EditingMode
from aider import __version__, models, utils
from aider import __version__, models, urls, utils
from aider.args import get_parser
from aider.coders import Coder
from aider.commands import Commands, SwitchCoder
@@ -17,19 +19,36 @@ from aider.format_settings import format_settings, scrub_sensitive_info
from aider.history import ChatSummary
from aider.io import InputOutput
from aider.llm import litellm # noqa: F401; properly init litellm on launch
from aider.repo import ANY_GIT_ERROR, GitRepo, UnableToCountRepoFiles
from aider.repo import ANY_GIT_ERROR, GitRepo
from aider.report import report_uncaught_exceptions
from aider.versioncheck import check_version, install_from_main_branch, install_upgrade
from .dump import dump # noqa: F401
def check_config_files_for_yes(config_files):
found = False
for config_file in config_files:
if Path(config_file).exists():
try:
with open(config_file, "r") as f:
for line in f:
if line.strip().startswith("yes:"):
print("Configuration error detected.")
print(f"The file {config_file} contains a line starting with 'yes:'")
print("Please replace 'yes:' with 'yes-always:' in this file.")
found = True
except Exception:
pass
return found
def get_git_root():
"""Try and guess the git repo, since the conf.yml can be at the repo root"""
try:
repo = git.Repo(search_parent_directories=True)
return repo.working_tree_dir
except git.InvalidGitRepositoryError:
except (git.InvalidGitRepositoryError, FileNotFoundError):
return None
@@ -58,7 +77,7 @@ def make_new_repo(git_root, io):
check_gitignore(git_root, io, False)
except ANY_GIT_ERROR as err: # issue #1233
io.tool_error(f"Unable to create git repo in {git_root}")
io.tool_error(str(err))
io.tool_output(str(err))
return
io.tool_output(f"Git repository created in {git_root}")
@@ -71,7 +90,7 @@ def setup_git(git_root, io):
if git_root:
repo = git.Repo(git_root)
elif Path.cwd() == Path.home():
io.tool_error("You should probably run aider in a directory, not your home dir.")
io.tool_warning("You should probably run aider in a directory, not your home dir.")
return
elif io.confirm_ask("No git repo found, create one to track aider's changes (recommended)?"):
git_root = str(Path.cwd().resolve())
@@ -89,7 +108,7 @@ def setup_git(git_root, io):
pass
try:
user_email = config.get_value("user", "email", None)
except configparser.NoSectionError:
except (configparser.NoSectionError, configparser.NoOptionError):
pass
if user_name and user_email:
@@ -98,10 +117,10 @@ def setup_git(git_root, io):
with repo.config_writer() as git_config:
if not user_name:
git_config.set_value("user", "name", "Your Name")
io.tool_error('Update git name with: git config user.name "Your Name"')
io.tool_warning('Update git name with: git config user.name "Your Name"')
if not user_email:
git_config.set_value("user", "email", "you@example.com")
io.tool_error('Update git email with: git config user.email "you@example.com"')
io.tool_warning('Update git email with: git config user.email "you@example.com"')
return repo.working_tree_dir
@@ -207,8 +226,8 @@ def parse_lint_cmds(lint_cmds, io):
res[lang] = cmd
else:
io.tool_error(f'Unable to parse --lint-cmd "{lint_cmd}"')
io.tool_error('The arg should be "language: cmd --args ..."')
io.tool_error('For example: --lint-cmd "python: flake8 --select=E9"')
io.tool_output('The arg should be "language: cmd --args ..."')
io.tool_output('For example: --lint-cmd "python: flake8 --select=E9"')
err = True
if err:
return
@@ -264,7 +283,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="utf-8"):
dotenv_files = generate_search_path_list(
".env",
git_root,
@@ -272,9 +291,14 @@ 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:
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}")
return loaded
@@ -298,25 +322,34 @@ def sanity_check_repo(repo, io):
if not repo:
return True
if not repo.repo.working_tree_dir:
io.tool_error("The git repo does not seem to have a working tree?")
return False
bad_ver = False
try:
repo.get_tracked_files()
return True
except UnableToCountRepoFiles as exc:
if not repo.git_repo_error:
return True
error_msg = str(repo.git_repo_error)
except ANY_GIT_ERROR as exc:
error_msg = str(exc)
bad_ver = "version in (1, 2)" in error_msg
except AssertionError as exc:
error_msg = str(exc)
bad_ver = True
if "version in (1, 2)" in error_msg:
io.tool_error("Aider only works with git repos with version number 1 or 2.")
io.tool_error(
"You may be able to convert your repo: git update-index --index-version=2"
)
io.tool_error("Or run aider --no-git to proceed without using git.")
io.tool_error("https://github.com/paul-gauthier/aider/issues/211")
return False
io.tool_error("Unable to read git repository, it may be corrupt?")
io.tool_error(error_msg)
if bad_ver:
io.tool_error("Aider only works with git repos with version number 1 or 2.")
io.tool_output("You may be able to convert your repo: git update-index --index-version=2")
io.tool_output("Or run aider --no-git to proceed without using git.")
io.tool_output(urls.git_index_version)
return False
io.tool_error("Unable to read git repository, it may be corrupt?")
io.tool_output(error_msg)
return False
def main(argv=None, input=None, output=None, force_git_root=None, return_coder=False):
report_uncaught_exceptions()
@@ -331,7 +364,12 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
conf_fname = Path(".aider.conf.yml")
default_config_files = [conf_fname.resolve()] # CWD
default_config_files = []
try:
default_config_files += [conf_fname.resolve()] # CWD
except OSError:
pass
if git_root:
git_conf = Path(git_root) / conf_fname # git root
if git_conf not in default_config_files:
@@ -340,7 +378,13 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
default_config_files = list(map(str, default_config_files))
parser = get_parser(default_config_files, git_root)
args, unknown = parser.parse_known_args(argv)
try:
args, unknown = parser.parse_known_args(argv)
except AttributeError as e:
if all(word in str(e) for word in ["bool", "object", "has", "no", "attribute", "strip"]):
if check_config_files_for_yes(default_config_files):
return 1
raise e
if args.verbose:
print("Config files search order, if no --config:")
@@ -351,10 +395,11 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
default_config_files.reverse()
parser = get_parser(default_config_files, git_root)
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)
@@ -362,41 +407,62 @@ 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"
args.tool_error_color = "#FF3333"
args.tool_warning_color = "#FFFF00"
args.assistant_output_color = "#00FFFF"
args.code_theme = "monokai"
if args.light_mode:
args.user_input_color = "green"
args.tool_error_color = "red"
args.tool_warning_color = "#FFA500"
args.assistant_output_color = "blue"
args.code_theme = "default"
if return_coder and args.yes is None:
args.yes = True
if return_coder and args.yes_always is None:
args.yes_always = True
editing_mode = EditingMode.VI if args.vim else EditingMode.EMACS
io = InputOutput(
args.pretty,
args.yes,
args.input_history_file,
args.chat_history_file,
input=input,
output=output,
user_input_color=args.user_input_color,
tool_output_color=args.tool_output_color,
tool_error_color=args.tool_error_color,
dry_run=args.dry_run,
encoding=args.encoding,
llm_history_file=args.llm_history_file,
editingmode=editing_mode,
)
def get_io(pretty):
return InputOutput(
pretty,
args.yes_always,
args.input_history_file,
args.chat_history_file,
input=input,
output=output,
user_input_color=args.user_input_color,
tool_output_color=args.tool_output_color,
tool_warning_color=args.tool_warning_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,
encoding=args.encoding,
llm_history_file=args.llm_history_file,
editingmode=editing_mode,
)
io = get_io(args.pretty)
try:
io.rule()
except UnicodeEncodeError as err:
if not io.pretty:
raise err
io = get_io(False)
io.tool_warning("Terminal does not support pretty output (UnicodeDecodeError)")
if args.gui and not return_coder:
if not check_streamlit_install(io):
@@ -418,7 +484,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
io.tool_error(f"{fname} is a directory, not provided alone.")
good = False
if not good:
io.tool_error(
io.tool_output(
"Provide either a single directory of a git repo, or a list of one or more files."
)
return 1
@@ -456,8 +522,8 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
if args.check_update:
check_version(io, verbose=args.verbose)
if args.models:
models.print_matching_models(io, args.models)
if args.list_models:
models.print_matching_models(io, args.list_models)
return 0
if args.git:
@@ -473,6 +539,8 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
cmd_line = scrub_sensitive_info(args, cmd_line)
io.tool_output(cmd_line, log_only=True)
check_and_load_imports(io, verbose=args.verbose)
if args.anthropic_api_key:
os.environ["ANTHROPIC_API_KEY"] = args.anthropic_api_key
@@ -495,12 +563,16 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
if os.environ.get("ANTHROPIC_API_KEY"):
args.model = "claude-3-5-sonnet-20240620"
main_model = models.Model(args.model, weak_model=args.weak_model)
main_model = models.Model(
args.model,
weak_model=args.weak_model,
editor_model=args.editor_model,
editor_edit_format=args.editor_edit_format,
)
if args.verbose:
io.tool_output("Model info:")
for key, value in main_model.info.items():
io.tool_output(f" {key}: {value}")
io.tool_output(json.dumps(main_model.info, indent=4))
lint_cmds = parse_lint_cmds(args.lint_cmd, io)
if lint_cmds is None:
@@ -509,7 +581,8 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
if args.show_model_warnings:
problem = models.sanity_check_models(io, main_model)
if problem:
io.tool_output("You can skip this sanity check with --no-show-model-warnings")
io.tool_output("You can skip this check with --no-show-model-warnings")
io.tool_output()
try:
if not io.confirm_ask("Proceed anyway?"):
return 1
@@ -535,8 +608,9 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
except FileNotFoundError:
pass
if not sanity_check_repo(repo, io):
return 1
if not args.skip_sanity_check_repo:
if not sanity_check_repo(repo, io):
return 1
commands = Commands(
io, None, verify_ssl=args.verify_ssl, args=args, parser=parser, verbose=args.verbose
@@ -550,6 +624,13 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
if args.cache_prompts and args.map_refresh == "auto":
args.map_refresh = "files"
if not main_model.streaming:
if args.stream:
io.tool_warning(
f"Warning: Streaming is not supported by {main_model.name}. Disabling streaming."
)
args.stream = False
try:
coder = Coder.create(
main_model=main_model,
@@ -564,8 +645,6 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
dry_run=args.dry_run,
map_tokens=args.map_tokens,
verbose=args.verbose,
assistant_output_color=args.assistant_output_color,
code_theme=args.code_theme,
stream=args.stream,
use_git=args.git,
restore_chat_history=args.restore_chat_history,
@@ -580,6 +659,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
map_mul_no_files=args.map_multiplier_no_files,
num_cache_warming_pings=args.cache_keepalive_pings,
suggest_shell_commands=args.suggest_shell_commands,
chat_language=args.chat_language,
)
except ValueError as err:
io.tool_error(str(err))
@@ -588,7 +668,6 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
if return_coder:
return coder
io.tool_output()
coder.show_announcements()
if args.show_prompts:
@@ -640,13 +719,13 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
io.tool_output('Use /help <question> for help, run "aider --help" to see cmd line args')
if git_root and Path.cwd().resolve() != Path(git_root).resolve():
io.tool_error(
io.tool_warning(
"Note: in-chat filenames are always relative to the git working dir, not the current"
" working dir."
)
io.tool_error(f"Cur working dir: {Path.cwd()}")
io.tool_error(f"Git working dir: {git_root}")
io.tool_output(f"Cur working dir: {Path.cwd()}")
io.tool_output(f"Git working dir: {git_root}")
if args.message:
io.add_to_input_history(args.message)
@@ -673,10 +752,6 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
if args.exit:
return
thread = threading.Thread(target=load_slow_imports)
thread.daemon = True
thread.start()
while True:
try:
coder.run()
@@ -693,19 +768,72 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
coder.show_announcements()
def load_slow_imports():
def check_and_load_imports(io, verbose=False):
installs_file = Path.home() / ".aider" / "installs.json"
key = (__version__, sys.executable)
if verbose:
io.tool_output(
f"Checking imports for version {__version__} and executable {sys.executable}"
)
io.tool_output(f"Installs file: {installs_file}")
try:
if installs_file.exists():
with open(installs_file, "r") as f:
installs = json.load(f)
if verbose:
io.tool_output("Installs file exists and loaded")
else:
installs = {}
if verbose:
io.tool_output("Installs file does not exist, creating new dictionary")
if str(key) not in installs:
if verbose:
io.tool_output(
"First run for this version and executable, loading imports synchronously"
)
try:
load_slow_imports(swallow=False)
except Exception as err:
io.tool_error(str(err))
io.tool_output("Error loading required imports. Did you install aider properly?")
io.tool_output("https://aider.chat/docs/install/install.html")
sys.exit(1)
installs[str(key)] = True
installs_file.parent.mkdir(parents=True, exist_ok=True)
with open(installs_file, "w") as f:
json.dump(installs, f, indent=4)
if verbose:
io.tool_output("Imports loaded and installs file updated")
else:
if verbose:
io.tool_output("Not first run, loading imports in background thread")
thread = threading.Thread(target=load_slow_imports)
thread.daemon = True
thread.start()
except Exception as e:
io.tool_warning(f"Error in checking imports: {e}")
if verbose:
io.tool_output(f"Full exception details: {traceback.format_exc()}")
def load_slow_imports(swallow=True):
# These imports are deferred in various ways to
# improve startup time.
# This func is called in a thread to load them in the background
# while we wait for the user to type their first message.
# This func is called either synchronously or in a thread
# depending on whether it's been run before for this version and executable.
try:
import httpx # noqa: F401
import litellm # noqa: F401
import networkx # noqa: F401
import numpy # noqa: F401
except Exception:
pass
except Exception as e:
if not swallow:
raise e
if __name__ == "__main__":

View File

@@ -18,7 +18,7 @@ from aider.dump import dump # noqa: F401
from aider.llm import litellm
DEFAULT_MODEL_NAME = "gpt-4o"
ANTHROPIC_BETA_HEADER = "max-tokens-3-5-sonnet-2024-07-15,prompt-caching-2024-07-31"
ANTHROPIC_BETA_HEADER = "prompt-caching-2024-07-31"
OPENAI_MODELS = """
gpt-4
@@ -73,10 +73,14 @@ class ModelSettings:
lazy: bool = False
reminder: str = "user"
examples_as_sys_msg: bool = False
extra_headers: Optional[dict] = None
max_tokens: Optional[int] = None
extra_params: Optional[dict] = None
cache_control: bool = False
caches_by_default: bool = False
use_system_prompt: bool = True
use_temperature: bool = True
streaming: bool = True
editor_model_name: Optional[str] = None
editor_edit_format: Optional[str] = None
# https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
@@ -142,6 +146,7 @@ MODEL_SETTINGS = [
accepts_images=True,
lazy=True,
reminder="sys",
editor_edit_format="editor-diff",
),
ModelSettings(
"openai/gpt-4o-2024-08-06",
@@ -169,6 +174,7 @@ MODEL_SETTINGS = [
accepts_images=True,
lazy=True,
reminder="sys",
editor_edit_format="editor-diff",
),
ModelSettings(
"gpt-4o-mini",
@@ -255,12 +261,16 @@ MODEL_SETTINGS = [
"claude-3-5-sonnet-20240620",
"diff",
weak_model_name="claude-3-haiku-20240307",
editor_model_name="claude-3-5-sonnet-20240620",
editor_edit_format="editor-diff",
use_repo_map=True,
examples_as_sys_msg=True,
accepts_images=True,
max_tokens=8192,
extra_headers={
"anthropic-beta": ANTHROPIC_BETA_HEADER,
extra_params={
"extra_headers": {
"anthropic-beta": ANTHROPIC_BETA_HEADER,
},
"max_tokens": 8192,
},
cache_control=True,
reminder="user",
@@ -269,11 +279,15 @@ MODEL_SETTINGS = [
"anthropic/claude-3-5-sonnet-20240620",
"diff",
weak_model_name="claude-3-haiku-20240307",
editor_model_name="anthropic/claude-3-5-sonnet-20240620",
editor_edit_format="editor-diff",
use_repo_map=True,
examples_as_sys_msg=True,
max_tokens=8192,
extra_headers={
"anthropic-beta": ANTHROPIC_BETA_HEADER,
extra_params={
"extra_headers": {
"anthropic-beta": ANTHROPIC_BETA_HEADER,
},
"max_tokens": 8192,
},
cache_control=True,
reminder="user",
@@ -283,8 +297,10 @@ MODEL_SETTINGS = [
"whole",
weak_model_name="anthropic/claude-3-haiku-20240307",
examples_as_sys_msg=True,
extra_headers={
"anthropic-beta": ANTHROPIC_BETA_HEADER,
extra_params={
"extra_headers": {
"anthropic-beta": ANTHROPIC_BETA_HEADER,
},
},
cache_control=True,
),
@@ -293,8 +309,10 @@ MODEL_SETTINGS = [
"whole",
weak_model_name="claude-3-haiku-20240307",
examples_as_sys_msg=True,
extra_headers={
"anthropic-beta": ANTHROPIC_BETA_HEADER,
extra_params={
"extra_headers": {
"anthropic-beta": ANTHROPIC_BETA_HEADER,
},
},
cache_control=True,
),
@@ -302,14 +320,31 @@ MODEL_SETTINGS = [
"openrouter/anthropic/claude-3.5-sonnet",
"diff",
weak_model_name="openrouter/anthropic/claude-3-haiku-20240307",
editor_model_name="openrouter/anthropic/claude-3.5-sonnet",
editor_edit_format="editor-diff",
use_repo_map=True,
examples_as_sys_msg=True,
accepts_images=True,
max_tokens=8192,
extra_headers={
"anthropic-beta": "max-tokens-3-5-sonnet-2024-07-15",
extra_params={
"max_tokens": 8192,
},
reminder="user",
cache_control=True,
),
ModelSettings(
"openrouter/anthropic/claude-3.5-sonnet:beta",
"diff",
weak_model_name="openrouter/anthropic/claude-3-haiku-20240307",
editor_model_name="openrouter/anthropic/claude-3.5-sonnet:beta",
editor_edit_format="editor-diff",
use_repo_map=True,
examples_as_sys_msg=True,
accepts_images=True,
extra_params={
"max_tokens": 8192,
},
reminder="user",
cache_control=True,
),
# Vertex AI Claude models
# Does not yet support 8k token
@@ -317,9 +352,14 @@ MODEL_SETTINGS = [
"vertex_ai/claude-3-5-sonnet@20240620",
"diff",
weak_model_name="vertex_ai/claude-3-haiku@20240307",
editor_model_name="vertex_ai/claude-3-5-sonnet@20240620",
editor_edit_format="editor-diff",
use_repo_map=True,
examples_as_sys_msg=True,
accepts_images=True,
extra_params={
"max_tokens": 8192,
},
reminder="user",
),
ModelSettings(
@@ -340,6 +380,19 @@ MODEL_SETTINGS = [
weak_model_name="command-r-plus",
use_repo_map=True,
),
# New Cohere models
ModelSettings(
"command-r-08-2024",
"whole",
weak_model_name="command-r-08-2024",
use_repo_map=True,
),
ModelSettings(
"command-r-plus-08-2024",
"whole",
weak_model_name="command-r-plus-08-2024",
use_repo_map=True,
),
# Groq llama3
ModelSettings(
"groq/llama3-70b-8192",
@@ -359,6 +412,15 @@ MODEL_SETTINGS = [
examples_as_sys_msg=True,
),
# Gemini
ModelSettings(
"gemini/gemini-1.5-pro-002",
"diff",
use_repo_map=True,
),
ModelSettings(
"gemini/gemini-1.5-flash-002",
"whole",
),
ModelSettings(
"gemini/gemini-1.5-pro",
"diff-fenced",
@@ -386,6 +448,9 @@ MODEL_SETTINGS = [
use_repo_map=True,
examples_as_sys_msg=True,
reminder="sys",
extra_params={
"max_tokens": 8192,
},
),
ModelSettings(
"deepseek/deepseek-coder",
@@ -394,6 +459,30 @@ MODEL_SETTINGS = [
examples_as_sys_msg=True,
reminder="sys",
caches_by_default=True,
extra_params={
"max_tokens": 8192,
},
),
ModelSettings(
"deepseek-chat",
"diff",
use_repo_map=True,
examples_as_sys_msg=True,
reminder="sys",
extra_params={
"max_tokens": 8192,
},
),
ModelSettings(
"deepseek-coder",
"diff",
use_repo_map=True,
examples_as_sys_msg=True,
reminder="sys",
caches_by_default=True,
extra_params={
"max_tokens": 8192,
},
),
ModelSettings(
"openrouter/deepseek/deepseek-coder",
@@ -410,6 +499,79 @@ MODEL_SETTINGS = [
accepts_images=True,
lazy=True,
reminder="sys",
editor_edit_format="editor-diff",
),
ModelSettings(
"openai/o1-mini",
"whole",
weak_model_name="openai/gpt-4o-mini",
editor_model_name="openai/gpt-4o",
editor_edit_format="editor-diff",
use_repo_map=True,
reminder="user",
use_system_prompt=False,
use_temperature=False,
streaming=False,
),
ModelSettings(
"o1-mini",
"whole",
weak_model_name="gpt-4o-mini",
editor_model_name="gpt-4o",
editor_edit_format="editor-diff",
use_repo_map=True,
reminder="user",
use_system_prompt=False,
use_temperature=False,
streaming=False,
),
ModelSettings(
"openai/o1-preview",
"diff",
weak_model_name="openai/gpt-4o-mini",
editor_model_name="openai/gpt-4o",
editor_edit_format="editor-diff",
use_repo_map=True,
reminder="user",
use_system_prompt=False,
use_temperature=False,
streaming=False,
),
ModelSettings(
"o1-preview",
"architect",
weak_model_name="gpt-4o-mini",
editor_model_name="gpt-4o",
editor_edit_format="editor-diff",
use_repo_map=True,
reminder="user",
use_system_prompt=False,
use_temperature=False,
streaming=False,
),
ModelSettings(
"openrouter/openai/o1-mini",
"whole",
weak_model_name="openrouter/openai/gpt-4o-mini",
editor_model_name="openrouter/openai/gpt-4o",
editor_edit_format="editor-diff",
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",
editor_model_name="openrouter/openai/gpt-4o",
editor_edit_format="editor-diff",
use_repo_map=True,
reminder="user",
use_system_prompt=False,
use_temperature=False,
streaming=False,
),
]
@@ -437,21 +599,28 @@ def get_model_info(model):
if not litellm._lazy_module:
cache_dir = Path.home() / ".aider" / "caches"
cache_file = cache_dir / "model_prices_and_context_window.json"
cache_dir.mkdir(parents=True, exist_ok=True)
current_time = time.time()
cache_age = (
current_time - cache_file.stat().st_mtime if cache_file.exists() else float("inf")
)
try:
cache_dir.mkdir(parents=True, exist_ok=True)
use_cache = True
except OSError:
# If we can't create the cache directory, we'll skip using the cache
use_cache = False
if cache_age < 60 * 60 * 24:
try:
content = json.loads(cache_file.read_text())
res = get_model_flexible(model, content)
if res:
return res
except Exception as ex:
print(str(ex))
if use_cache:
current_time = time.time()
cache_age = (
current_time - cache_file.stat().st_mtime if cache_file.exists() else float("inf")
)
if cache_age < 60 * 60 * 24:
try:
content = json.loads(cache_file.read_text())
res = get_model_flexible(model, content)
if res:
return res
except Exception as ex:
print(str(ex))
import requests
@@ -459,7 +628,12 @@ def get_model_info(model):
response = requests.get(model_info_url, timeout=5)
if response.status_code == 200:
content = response.json()
cache_file.write_text(json.dumps(content, indent=4))
if use_cache:
try:
cache_file.write_text(json.dumps(content, indent=4))
except OSError:
# If we can't write to the cache file, we'll just skip caching
pass
res = get_model_flexible(model, content)
if res:
return res
@@ -475,10 +649,11 @@ def get_model_info(model):
class Model(ModelSettings):
def __init__(self, model, weak_model=None):
def __init__(self, model, weak_model=None, editor_model=None, editor_edit_format=None):
self.name = model
self.max_chat_history_tokens = 1024
self.weak_model = None
self.editor_model = None
self.info = self.get_model_info(model)
@@ -499,6 +674,11 @@ class Model(ModelSettings):
else:
self.get_weak_model(weak_model)
if editor_model is False:
self.editor_model_name = None
else:
self.get_editor_model(editor_model, editor_edit_format)
def get_model_info(self, model):
return get_model_info(model)
@@ -570,6 +750,26 @@ class Model(ModelSettings):
def commit_message_models(self):
return [self.weak_model, self]
def get_editor_model(self, provided_editor_model_name, editor_edit_format):
# If editor_model_name is provided, override the model settings
if provided_editor_model_name:
self.editor_model_name = provided_editor_model_name
if editor_edit_format:
self.editor_edit_format = editor_edit_format
if not self.editor_model_name or self.editor_model_name == self.name:
self.editor_model = self
else:
self.editor_model = Model(
self.editor_model_name,
editor_model=False,
)
if not self.editor_edit_format:
self.editor_edit_format = self.editor_model.edit_format
return self.editor_model
def tokenizer(self, text):
return litellm.encode(model=self.name, text=text)
@@ -730,11 +930,21 @@ def validate_variables(vars):
def sanity_check_models(io, main_model):
problem_main = sanity_check_model(io, main_model)
problem_weak = None
problem_strong = sanity_check_model(io, main_model)
if main_model.weak_model and main_model.weak_model is not main_model:
problem_weak = sanity_check_model(io, main_model.weak_model)
return problem_strong or problem_weak
problem_editor = None
if (
main_model.editor_model
and main_model.editor_model is not main_model
and main_model.editor_model is not main_model.weak_model
):
problem_editor = sanity_check_model(io, main_model.editor_model)
return problem_main or problem_weak or problem_editor
def sanity_check_model(io, model):
@@ -742,11 +952,11 @@ def sanity_check_model(io, model):
if model.missing_keys:
show = True
io.tool_error(f"Model {model}: Environment variables status:")
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"
io.tool_error(f"- {key}: {status}")
status = "Set" if value else "Not set"
io.tool_output(f"- {key}: {status}")
if platform.system() == "Windows" or True:
io.tool_output(
@@ -756,12 +966,12 @@ def sanity_check_model(io, model):
elif not model.keys_in_environment:
show = True
io.tool_output(f"Model {model}: Unknown which environment variables are required.")
io.tool_warning(f"Warning for {model}: Unknown which environment variables are required.")
if not model.info:
show = True
io.tool_output(
f"Model {model}: Unknown context window size and costs, using sane defaults."
io.tool_warning(
f"Warning for {model}: Unknown context window size and costs, using sane defaults."
)
possible_matches = fuzzy_match_models(model.name)
@@ -771,7 +981,7 @@ def sanity_check_model(io, model):
io.tool_output(f"- {match}")
if show:
io.tool_output(f"For more info, see: {urls.model_warnings}\n")
io.tool_output(f"For more info, see: {urls.model_warnings}")
return show
@@ -825,20 +1035,37 @@ 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 <model_name>")
if len(sys.argv) < 2:
print("Usage: python models.py <model_name> 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":
yaml_string = get_model_settings_as_yaml()
print(yaml_string)
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}'.")
if __name__ == "__main__":

View File

@@ -5,15 +5,21 @@
# Conventional Commits text adapted from:
# https://www.conventionalcommits.org/en/v1.0.0/#summary
commit_system = """You are an expert software engineer.
commit_system = """You are an expert software engineer that generates concise, \
one-line Git commit messages based on the provided diffs.
Review the provided context and diffs which are about to be committed to a git repo.
Review the diffs carefully.
Generate a commit message for those changes.
The commit message MUST use the imperative tense.
Generate a one-line commit message for those changes.
The commit message should be structured as follows: <type>: <description>
Use these for <type>: fix, feat, build, chore, ci, docs, style, refactor, perf, test
Reply with JUST the commit message, without quotes, comments, questions, etc!
Reply with one line only!
Ensure the commit message:
- Starts with the appropriate prefix.
- Is in the imperative mood (e.g., \"Add feature\" not \"Added feature\" or \"Adding feature\").
- Does not exceed 72 characters.
Reply only with the one-line commit message, without any additional text, explanations, \
or line breaks.
"""
# COMMANDS

View File

@@ -10,12 +10,15 @@ from aider.sendchat import simple_send_with_retries
from .dump import dump # noqa: F401
class UnableToCountRepoFiles(Exception):
pass
ANY_GIT_ERROR = (git.exc.ODBError, git.exc.GitError)
ANY_GIT_ERROR = (
git.exc.ODBError,
git.exc.GitError,
OSError,
IndexError,
BufferError,
TypeError,
ValueError,
)
class GitRepo:
@@ -26,6 +29,7 @@ class GitRepo:
aider_ignore_last_check = 0
subtree_only = False
ignore_file_cache = {}
git_repo_error = None
def __init__(
self,
@@ -121,7 +125,10 @@ class GitRepo:
if fnames:
fnames = [str(self.abs_root_path(fn)) for fn in fnames]
for fname in fnames:
self.repo.git.add(fname)
try:
self.repo.git.add(fname)
except ANY_GIT_ERROR as err:
self.io.tool_error(f"Unable to add {fname}: {err}")
cmd += ["--"] + fnames
else:
cmd += ["-a"]
@@ -137,25 +144,27 @@ class GitRepo:
original_auther_name_env = os.environ.get("GIT_AUTHOR_NAME")
os.environ["GIT_AUTHOR_NAME"] = committer_name
self.repo.git.commit(cmd)
commit_hash = self.get_head_commit_sha(short=True)
self.io.tool_output(f"Commit {commit_hash} {commit_message}", bold=True)
try:
self.repo.git.commit(cmd)
commit_hash = self.get_head_commit_sha(short=True)
self.io.tool_output(f"Commit {commit_hash} {commit_message}", bold=True)
return commit_hash, commit_message
except ANY_GIT_ERROR as err:
self.io.tool_error(f"Unable to commit: {err}")
finally:
# Restore the env
# Restore the env
if self.attribute_committer:
if original_committer_name_env is not None:
os.environ["GIT_COMMITTER_NAME"] = original_committer_name_env
else:
del os.environ["GIT_COMMITTER_NAME"]
if self.attribute_committer:
if original_committer_name_env is not None:
os.environ["GIT_COMMITTER_NAME"] = original_committer_name_env
else:
del os.environ["GIT_COMMITTER_NAME"]
if aider_edits and self.attribute_author:
if original_auther_name_env is not None:
os.environ["GIT_AUTHOR_NAME"] = original_auther_name_env
else:
del os.environ["GIT_AUTHOR_NAME"]
return commit_hash, commit_message
if aider_edits and self.attribute_author:
if original_auther_name_env is not None:
os.environ["GIT_AUTHOR_NAME"] = original_auther_name_env
else:
del os.environ["GIT_AUTHOR_NAME"]
def get_rel_repo_dir(self):
try:
@@ -184,7 +193,7 @@ class GitRepo:
if max_tokens and num_tokens > max_tokens:
continue
commit_message = simple_send_with_retries(
model.name, messages, extra_headers=model.extra_headers
model.name, messages, extra_params=model.extra_params
)
if commit_message:
break
@@ -210,7 +219,7 @@ class GitRepo:
current_branch_has_commits = any(commits)
except ANY_GIT_ERROR:
pass
except TypeError:
except (TypeError,) + ANY_GIT_ERROR:
pass
if not fnames:
@@ -221,18 +230,21 @@ class GitRepo:
if not self.path_in_repo(fname):
diffs += f"Added {fname}\n"
if current_branch_has_commits:
args = ["HEAD", "--"] + list(fnames)
diffs += self.repo.git.diff(*args)
try:
if current_branch_has_commits:
args = ["HEAD", "--"] + list(fnames)
diffs += self.repo.git.diff(*args)
return diffs
wd_args = ["--"] + list(fnames)
index_args = ["--cached"] + wd_args
diffs += self.repo.git.diff(*index_args)
diffs += self.repo.git.diff(*wd_args)
return diffs
wd_args = ["--"] + list(fnames)
index_args = ["--cached"] + wd_args
diffs += self.repo.git.diff(*index_args)
diffs += self.repo.git.diff(*wd_args)
return diffs
except ANY_GIT_ERROR as err:
self.io.tool_error(f"Unable to diff: {err}")
def diff_commits(self, pretty, from_commit, to_commit):
args = []
@@ -251,32 +263,40 @@ class GitRepo:
return []
try:
try:
commit = self.repo.head.commit
except ValueError:
commit = None
commit = self.repo.head.commit
except ValueError:
commit = None
except ANY_GIT_ERROR as err:
self.git_repo_error = err
self.io.tool_error(f"Unable to list files in git repo: {err}")
self.io.tool_output("Is your git repo corrupted?")
return []
files = set()
if commit:
if commit in self.tree_files:
files = self.tree_files[commit]
else:
files = set()
if commit:
if commit in self.tree_files:
files = self.tree_files[commit]
else:
try:
for blob in commit.tree.traverse():
if blob.type == "blob": # blob is a file
files.add(blob.path)
files = set(self.normalize_path(path) for path in files)
self.tree_files[commit] = set(files)
except ANY_GIT_ERROR as err:
self.git_repo_error = err
self.io.tool_error(f"Unable to list files in git repo: {err}")
self.io.tool_output("Is your git repo corrupted?")
return []
files = set(self.normalize_path(path) for path in files)
self.tree_files[commit] = set(files)
# Add staged files
index = self.repo.index
staged_files = [path for path, _ in index.entries.keys()]
files.update(self.normalize_path(path) for path in staged_files)
# Add staged files
index = self.repo.index
staged_files = [path for path, _ in index.entries.keys()]
files.update(self.normalize_path(path) for path in staged_files)
res = [fname for fname in files if not self.ignored_file(fname)]
res = [fname for fname in files if not self.ignored_file(fname)]
return res
except Exception as e:
raise UnableToCountRepoFiles(f"Error getting tracked files: {str(e)}")
return res
def normalize_path(self, path):
orig_path = path
@@ -324,7 +344,14 @@ 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
@@ -342,6 +369,8 @@ class GitRepo:
def path_in_repo(self, path):
if not self.repo:
return
if not path:
return
tracked_files = set(self.get_tracked_files())
return self.normalize_path(path) in tracked_files

View File

@@ -27,6 +27,9 @@ from tree_sitter_languages import get_language, get_parser # noqa: E402
Tag = namedtuple("Tag", "rel_fname fname line name kind".split())
SQLITE_ERRORS = (sqlite3.OperationalError, sqlite3.DatabaseError)
class RepoMap:
CACHE_VERSION = 3
TAGS_CACHE_DIR = f".aider.tags.cache.v{CACHE_VERSION}"
@@ -156,18 +159,19 @@ class RepoMap:
return repo_content
def get_rel_fname(self, fname):
return os.path.relpath(fname, self.root)
def split_path(self, path):
path = os.path.relpath(path, self.root)
return [path + ":"]
try:
return os.path.relpath(fname, self.root)
except ValueError:
# Issue #1288: ValueError: path is on mount 'C:', start on mount 'D:'
# Just return the full fname.
return fname
def load_tags_cache(self):
path = Path(self.root) / self.TAGS_CACHE_DIR
try:
self.TAGS_CACHE = Cache(path)
except sqlite3.OperationalError:
self.io.tool_error(f"Unable to use tags cache, delete {path} to resolve.")
except SQLITE_ERRORS:
self.io.tool_warning(f"Unable to use tags cache, delete {path} to resolve.")
self.TAGS_CACHE = dict()
def save_tags_cache(self):
@@ -177,7 +181,7 @@ class RepoMap:
try:
return os.path.getmtime(fname)
except FileNotFoundError:
self.io.tool_error(f"File not found error: {fname}")
self.io.tool_warning(f"File not found error: {fname}")
def get_tags(self, fname, rel_fname):
# Check if the file is in the cache and if the modification time has not changed
@@ -186,15 +190,20 @@ class RepoMap:
return []
cache_key = fname
if cache_key in self.TAGS_CACHE and self.TAGS_CACHE[cache_key]["mtime"] == file_mtime:
val = self.TAGS_CACHE.get(cache_key) # Issue #1308
if val is not None and val.get("mtime") == file_mtime:
return self.TAGS_CACHE[cache_key]["data"]
# miss!
data = list(self.get_tags_raw(fname, rel_fname))
# Update the cache
self.TAGS_CACHE[cache_key] = {"mtime": file_mtime, "data": data}
self.save_tags_cache()
try:
self.TAGS_CACHE[cache_key] = {"mtime": file_mtime, "data": data}
self.save_tags_cache()
except SQLITE_ERRORS:
pass
return data
def get_tags_raw(self, fname, rel_fname):
@@ -306,16 +315,18 @@ class RepoMap:
if progress and not showing_bar:
progress()
if not Path(fname).is_file():
if fname not in self.warned_files:
if Path(fname).exists():
self.io.tool_error(
f"Repo-map can't include {fname}, it is not a normal file"
)
else:
self.io.tool_error(f"Repo-map can't include {fname}, it no longer exists")
try:
file_ok = Path(fname).is_file()
except OSError:
file_ok = False
self.warned_files.add(fname)
if not file_ok:
if fname not in self.warned_files:
self.io.tool_warning(f"Repo-map can't include {fname}")
self.io.tool_output(
"Has it been deleted from the file system but not from git?"
)
self.warned_files.add(fname)
continue
# dump(fname)
@@ -387,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)
@@ -404,7 +419,9 @@ class RepoMap:
ranked_definitions[(dst, ident)] += data["rank"]
ranked_tags = []
ranked_definitions = sorted(ranked_definitions.items(), reverse=True, key=lambda x: x[1])
ranked_definitions = sorted(
ranked_definitions.items(), reverse=True, key=lambda x: (x[1], x[0])
)
# dump(ranked_definitions)
@@ -440,12 +457,20 @@ class RepoMap:
force_refresh=False,
):
# Create a cache key
cache_key = (
cache_key = [
tuple(sorted(chat_fnames)) if chat_fnames else None,
tuple(sorted(other_fnames)) if other_fnames else None,
max_map_tokens,
)
]
if self.refresh == "auto":
cache_key += [
tuple(sorted(mentioned_fnames)) if mentioned_fnames else None,
tuple(sorted(mentioned_idents)) if mentioned_idents else None,
]
cache_key = tuple(cache_key)
use_cache = False
if not force_refresh:
if self.refresh == "manual" and self.last_map:
return self.last_map
@@ -504,6 +529,8 @@ class RepoMap:
other_rel_fnames = sorted(set(self.get_rel_fname(fname) for fname in other_fnames))
special_fnames = filter_important_files(other_rel_fnames)
ranked_tags_fnames = set(tag[0] for tag in ranked_tags)
special_fnames = [fn for fn in special_fnames if fn not in ranked_tags_fnames]
special_fnames = [(fn,) for fn in special_fnames]
ranked_tags = special_fnames + ranked_tags

View File

@@ -34,13 +34,14 @@ def get_git_info():
return "Git information unavailable"
def report_github_issue(issue_text, title=None):
def report_github_issue(issue_text, title=None, confirm=True):
"""
Compose a URL to open a new GitHub issue with the given text prefilled,
and attempt to launch it in the default web browser.
:param issue_text: The text of the issue to file
:param title: The title of the issue (optional)
:param confirm: Whether to ask for confirmation before opening the browser (default: True)
:return: None
"""
version_info = f"Aider version: {__version__}\n"
@@ -61,16 +62,17 @@ def report_github_issue(issue_text, title=None):
params["title"] = title
issue_url = f"{github_issues}?{urllib.parse.urlencode(params)}"
print(f"\n# {title}\n")
print(issue_text.strip())
print()
print("Please consider reporting this bug to help improve aider!")
prompt = "Open a GitHub Issue pre-filled with the above error in your browser? (Y/n) "
confirmation = input(prompt).strip().lower()
if confirm:
print(f"\n# {title}\n")
print(issue_text.strip())
print()
print("Please consider reporting this bug to help improve aider!")
prompt = "Open a GitHub Issue pre-filled with the above error in your browser? (Y/n) "
confirmation = input(prompt).strip().lower()
yes = not confirmation or confirmation.startswith("y")
if not yes:
return
yes = not confirmation or confirmation.startswith("y")
if not yes:
return
print("Attempting to open the issue URL in your default web browser...")
try:
@@ -79,13 +81,14 @@ def report_github_issue(issue_text, title=None):
except Exception:
pass
print()
print()
print("You can also use this URL to file the GitHub Issue:")
print()
print(issue_url)
print()
print()
if confirm:
print()
print()
print("You can also use this URL to file the GitHub Issue:")
print()
print(issue_url)
print()
print()
def exception_handler(exc_type, exc_value, exc_traceback):

View File

@@ -5,21 +5,60 @@ import sys
from io import BytesIO
import pexpect
import psutil
def run_cmd(command, verbose=False):
import sys
def run_cmd(command, verbose=False, error_print=None):
try:
if sys.stdin.isatty() and hasattr(pexpect, "spawn") and platform.system() != "Windows":
return run_cmd_pexpect(command, verbose)
if sys.stdin.isatty() and hasattr(pexpect, "spawn") and platform.system() != "Windows":
return run_cmd_pexpect(command, verbose)
return run_cmd_subprocess(command, verbose)
except OSError as e:
error_message = f"Error occurred while running command '{command}': {str(e)}"
if error_print is None:
print(error_message)
else:
error_print(error_message)
return 1, error_message
return run_cmd_subprocess(command, verbose)
def get_windows_parent_process_name():
try:
current_process = psutil.Process()
while True:
parent = current_process.parent()
if parent is None:
break
parent_name = parent.name().lower()
if parent_name in ["powershell.exe", "cmd.exe"]:
return parent_name
current_process = parent
return None
except Exception:
return None
def run_cmd_subprocess(command, verbose=False):
if verbose:
print("Using run_cmd_subprocess:", command)
try:
shell = os.environ.get("SHELL", "/bin/sh")
parent_process = None
# Determine the appropriate shell
if platform.system() == "Windows":
parent_process = get_windows_parent_process_name()
if parent_process == "powershell.exe":
command = f"powershell -Command {command}"
if verbose:
print("Running command:", command)
print("SHELL:", shell)
if platform.system() == "Windows":
print("Parent process:", parent_process)
process = subprocess.Popen(
command,
stdout=subprocess.PIPE,
@@ -28,14 +67,17 @@ def run_cmd_subprocess(command, verbose=False):
shell=True,
encoding=sys.stdout.encoding,
errors="replace",
bufsize=1,
bufsize=0, # Set bufsize to 0 for unbuffered output
universal_newlines=True,
)
output = []
for line in process.stdout:
print(line, end="") # Print the line in real-time
output.append(line) # Store the line for later use
while True:
chunk = process.stdout.read(1)
if not chunk:
break
print(chunk, end="", flush=True) # Print the chunk in real-time
output.append(chunk) # Store the chunk for later use
process.wait()
return process.returncode, "".join(output)
@@ -84,6 +126,6 @@ def run_cmd_pexpect(command, verbose=False):
child.close()
return child.exitstatus, output.getvalue().decode("utf-8", errors="replace")
except pexpect.ExceptionPexpect as e:
error_msg = f"Error running command: {e}"
except (pexpect.ExceptionPexpect, TypeError, ValueError) as e:
error_msg = f"Error running command {command}: {e}"
return 1, error_msg

View File

@@ -131,7 +131,9 @@ class Scraper:
# Internals...
def scrape_with_playwright(self, url):
import playwright
import playwright # noqa: F401
from playwright.sync_api import Error as PlaywrightError
from playwright.sync_api import TimeoutError as PlaywrightTimeoutError
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
@@ -156,9 +158,9 @@ class Scraper:
response = None
try:
response = page.goto(url, wait_until="networkidle", timeout=5000)
except playwright._impl._errors.TimeoutError:
except PlaywrightTimeoutError:
self.print_error(f"Timeout while loading {url}")
except playwright._impl._errors.Error as e:
except PlaywrightError as e:
self.print_error(f"Error navigating to {url}: {str(e)}")
return None, None
@@ -169,7 +171,7 @@ class Scraper:
content_type = response.header_value("content-type")
if content_type:
mime_type = content_type.split(";")[0]
except playwright._impl._errors.Error as e:
except PlaywrightError as e:
self.print_error(f"Error retrieving page content: {str(e)}")
content = None
mime_type = None
@@ -183,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) 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]
@@ -222,7 +226,10 @@ class Scraper:
if not self.pandoc_available:
return page_source
md = pypandoc.convert_text(page_source, "markdown", format="html")
try:
md = pypandoc.convert_text(page_source, "markdown", format="html")
except OSError:
return page_source
md = re.sub(r"</div>", " ", md)
md = re.sub(r"<div>", " ", md)

View File

@@ -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,
)
@@ -52,26 +52,25 @@ def send_completion(
functions,
stream,
temperature=0,
extra_headers=None,
max_tokens=None,
extra_params=None,
):
from aider.llm import litellm
kwargs = dict(
model=model_name,
messages=messages,
temperature=temperature,
stream=stream,
)
if temperature is not None:
kwargs["temperature"] = temperature
if functions is not None:
function = functions[0]
kwargs["tools"] = [dict(type="function", function=function)]
kwargs["tool_choice"] = {"type": "function", "function": {"name": function["name"]}}
if extra_headers is not None:
kwargs["extra_headers"] = extra_headers
if max_tokens is not None:
kwargs["max_tokens"] = max_tokens
if extra_params is not None:
kwargs.update(extra_params)
key = json.dumps(kwargs, sort_keys=True).encode()
@@ -81,8 +80,6 @@ def send_completion(
if not stream and CACHE is not None and key in CACHE:
return hash_object, CACHE[key]
# del kwargs['stream']
res = litellm.completion(**kwargs)
if not stream and CACHE is not None:
@@ -92,16 +89,15 @@ 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_params=None):
try:
kwargs = {
"model_name": model_name,
"messages": messages,
"functions": None,
"stream": False,
"extra_params": extra_params,
}
if extra_headers is not None:
kwargs["extra_headers"] = extra_headers
_hash, response = send_completion(**kwargs)
return response.choices[0].message.content

View File

@@ -8,4 +8,5 @@ model_warnings = "https://aider.chat/docs/llms/warnings.html"
token_limits = "https://aider.chat/docs/troubleshooting/token-limits.html"
llms = "https://aider.chat/docs/llms.html"
large_repos = "https://aider.chat/docs/faq.html#can-i-use-aider-in-a-large-mono-repo"
github_issues = "https://github.com/paul-gauthier/aider/issues/new"
github_issues = "https://github.com/Aider-AI/aider/issues/new"
git_index_version = "https://github.com/Aider-AI/aider/issues/211"

View File

@@ -2,6 +2,7 @@ import itertools
import os
import platform
import shlex
import shutil
import subprocess
import sys
import tempfile
@@ -11,7 +12,6 @@ from pathlib import Path
import git
from aider.dump import dump # noqa: F401
from aider.run_cmd import run_cmd
IMAGE_EXTENSIONS = {".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".webp"}
@@ -194,12 +194,31 @@ def split_chat_history_markdown(text, include_tool=False):
return messages
# Copied from pip, MIT license
# https://github.com/pypa/pip/blob/b989e6ef04810bbd4033a3683020bd4ddcbdb627/src/pip/_internal/utils/entrypoints.py#L73
def get_best_invocation_for_this_python() -> str:
"""Try to figure out the best way to invoke the current Python."""
exe = sys.executable
exe_name = os.path.basename(exe)
# Try to use the basename, if it's the first executable.
found_executable = shutil.which(exe_name)
if found_executable and os.path.samefile(found_executable, exe):
return exe_name
# Use the full executable name, because we couldn't find something simpler.
return exe
def get_pip_install(args):
cmd = [
sys.executable,
get_best_invocation_for_this_python(),
"-m",
"pip",
"install",
"--upgrade",
"--upgrade-strategy",
"only-if-needed",
]
cmd += args
return cmd
@@ -218,6 +237,8 @@ def run_install(cmd):
text=True,
bufsize=1,
universal_newlines=True,
encoding=sys.stdout.encoding,
errors="replace",
)
spinner = Spinner("Installing...")
@@ -303,7 +324,7 @@ def touch_file(fname):
return False
def check_pip_install_extra(io, module, prompt, pip_install_cmd):
def check_pip_install_extra(io, module, prompt, pip_install_cmd, self_update=False):
if module:
try:
__import__(module)
@@ -314,7 +335,13 @@ def check_pip_install_extra(io, module, prompt, pip_install_cmd):
cmd = get_pip_install(pip_install_cmd)
if prompt:
io.tool_error(prompt)
io.tool_warning(prompt)
if self_update and platform.system() == "Windows":
io.tool_output("Run this command to update:")
print()
print(printable_shell_command(cmd)) # plain print so it doesn't line-wrap
return
if not io.confirm_ask("Run pip install?", default="y", subject=printable_shell_command(cmd)):
return
@@ -322,7 +349,7 @@ def check_pip_install_extra(io, module, prompt, pip_install_cmd):
success, output = run_install(cmd)
if success:
if not module:
return
return True
try:
__import__(module)
return True
@@ -351,14 +378,3 @@ def printable_shell_command(cmd_list):
return subprocess.list2cmdline(cmd_list)
else:
return shlex.join(cmd_list)
if __name__ == "__main__":
if len(sys.argv) > 1:
command = " ".join(sys.argv[1:])
exit_status, output = run_cmd(command)
dump(exit_status)
dump(output)
else:
print("Usage: python -m aider.utils <command>")
sys.exit(1)

View File

@@ -21,21 +21,45 @@ def install_from_main_branch(io):
io,
None,
"Install the development version of aider from the main branch?",
["--upgrade", "git+https://github.com/paul-gauthier/aider.git"],
["git+https://github.com/Aider-AI/aider.git"],
self_update=True,
)
def install_upgrade(io):
def install_upgrade(io, latest_version=None):
"""
Install the latest version of aider from PyPI.
"""
return utils.check_pip_install_extra(
if latest_version:
new_ver_text = f"Newer aider version v{latest_version} is available."
else:
new_ver_text = "Install latest version of aider?"
docker_image = os.environ.get("AIDER_DOCKER_IMAGE")
if docker_image:
text = f"""
{new_ver_text} To upgrade, run:
docker pull {docker_image}
"""
io.tool_warning(text)
return True
success = utils.check_pip_install_extra(
io,
None,
"Install the latest version of aider from PyPI?",
["--upgrade", "aider-chat"],
new_ver_text,
["aider-chat"],
self_update=True,
)
if success:
io.tool_output("Re-run aider to use new version.")
sys.exit()
return
def check_version(io, just_check=False, verbose=False):
if not just_check and VERSION_CHECK_FNAME.exists():
@@ -85,25 +109,5 @@ def check_version(io, just_check=False, verbose=False):
if not is_update_available:
return False
docker_image = os.environ.get("AIDER_DOCKER_IMAGE")
if docker_image:
text = f"""
Newer aider version v{latest_version} is available. To upgrade, run:
docker pull {docker_image}
"""
io.tool_error(text)
return True
success = utils.check_pip_install_extra(
io,
None,
f"Newer aider version v{latest_version} is available.",
["--upgrade", "aider-chat"],
)
if success:
io.tool_output("Re-run aider to use new version.")
sys.exit()
install_upgrade(io, latest_version)
return True

View File

@@ -3,18 +3,25 @@ import os
import queue
import tempfile
import time
import warnings
from prompt_toolkit.shortcuts import prompt
from aider.llm import litellm
from .dump import dump # noqa: F401
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):
sf = None
from prompt_toolkit.shortcuts import prompt
from .dump import dump # noqa: F401
class SoundDeviceError(Exception):
pass
@@ -27,7 +34,7 @@ class Voice:
threshold = 0.15
def __init__(self):
def __init__(self, audio_format="wav"):
if sf is None:
raise SoundDeviceError
try:
@@ -37,6 +44,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 +90,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,14 +109,29 @@ 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:
transcript = litellm.transcription(
model="whisper-1", file=fh, prompt=history, language=language
)
try:
transcript = litellm.transcription(
model="whisper-1", file=fh, prompt=history, language=language
)
except Exception as err:
print(f"Unable to transcribe {filename}: {err}")
return
if self.audio_format != "wav":
os.remove(filename)
text = transcript.text
return text

View File

@@ -6,15 +6,130 @@ highlight_image: /assets/blame.jpg
description: Release notes and stats on aider writing its own code.
---
# Release history
{% include blame.md %}
<!--[[[cog
# This page is a copy of HISTORY.md, adding the front matter above.
text = open("HISTORY.md").read()
text = text.replace("# Release history", "")
cog.out(text)
]]]-->
# Release history
### v0.59.0
- Improvements to `/read-only`:
- Now supports shell-style auto-complete of the full file system.
- Still auto-completes the full paths of the repo files like `/add`.
- Now supports globs like `src/**/*.py`
- Renamed `--yes` to `--yes-always`.
- Now uses `AIDER_YES_ALWAYS` env var and `yes-always:` yaml key.
- Existing YAML and .env files will need to be updated.
- Can still abbreviate to `--yes` on the command line.
- Config file now uses standard YAML list syntax with ` - list entries`, one per line.
- `/settings` now includes the same announcement lines that would print at launch.
- Sanity checks the `--editor-model` on launch now, same as main and weak models.
- Added `--skip-sanity-check-repo` switch to speedup launch in large repos.
- Bugfix so architect mode handles Control-C properly.
- Repo-map is deterministic now, with improved caching logic.
- Improved commit message prompt.
- Aider wrote 77% of the code in this release.
### Aider v0.58.1
- Fixed bug where cache warming pings caused subsequent user messages to trigger a tight loop of LLM requests.
### Aider v0.58.0
- [Use a pair of Architect/Editor models for improved coding](https://aider.chat/2024/09/26/architect.html)
- Use a strong reasoning model like o1-preview as your Architect.
- Use a cheaper, faster model like gpt-4o as your Editor.
- New `--o1-preview` and `--o1-mini` shortcuts.
- Support for new Gemini 002 models.
- Better support for Qwen 2.5 models.
- Many confirmation questions can be skipped for the rest of the session with "(D)on't ask again" response.
- Autocomplete for `/read-only` supports the entire filesystem.
- New settings for completion menu colors.
- New `/copy` command to copy the last LLM response to the clipboard.
- Renamed `/clipboard` to `/paste`.
- Will now follow HTTP redirects when scraping urls.
- New `--voice-format` switch to send voice audio as wav/mp3/webm, by @mbailey.
- ModelSettings takes `extra_params` dict to specify any extras to pass to `litellm.completion()`.
- Support for cursor shapes when in vim mode.
- Numerous bug fixes.
- Aider wrote 53% of the code in this release.
### Aider v0.57.1
- Fixed dependency conflict between aider-chat[help] and [playwright].
### Aider v0.57.0
- Support for OpenAI o1 models:
- 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`.
- 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.
- 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
- Enables prompt caching for Sonnet via OpenRouter by @fry69
- Enables 8k output tokens for Sonnet via VertexAI and DeepSeek V2.5.
- New `/report` command to open your browser with a pre-populated GitHub Issue.
- New `--chat-language` switch to set the spoken language.
- Now `--[no-]suggest-shell-commands` controls both prompting for and offering to execute shell commands.
- Check key imports on launch, provide helpful error message if dependencies aren't available.
- Renamed `--models` to `--list-models` by @fry69.
- Numerous bug fixes for corner case crashes.
- Aider wrote 56% of the code in this release.
### Aider v0.55.0
- Only print the pip command when self updating on Windows, without running it.
- Converted many error messages to warning messages.
- Added `--tool-warning-color` setting.
- Blanket catch and handle git errors in any `/command`.
- Catch and handle glob errors in `/add`, errors writing files.
- Disabled built in linter for typescript.
- Catch and handle terminals which don't support pretty output.
- Catch and handle playwright and pandoc errors.
- Catch `/voice` transcription exceptions, show the WAV file so the user can recover it.
- Aider wrote 53% of the code in this release.
### Aider v0.54.12
- Switched to `vX.Y.Z.dev` version naming.
### Aider v0.54.11
- Improved printed pip command output on Windows.
### Aider v0.54.10
- Bugfix to test command in platform info.
### Aider v0.54.9
- Include important devops files in the repomap.
- Print quoted pip install commands to the user.
- Adopt setuptools_scm to provide dev versions with git hashes.
- Share active test and lint commands with the LLM.
- Catch and handle most errors creating new files, reading existing files.
- Catch and handle most git errors.
- Added --verbose debug output for shell commands.
### Aider v0.54.8
@@ -25,7 +140,6 @@ cog.out(text)
- Do not fuzzy match filenames when LLM is creating a new file, by @ozapinq
- Numerous corner case bug fixes submitted via new crash report -> GitHub Issue feature.
- Crash reports now include python version, OS, etc.
- Aider wrote 56% of the code in this release.
### Aider v0.54.7
@@ -612,7 +726,7 @@ cog.out(text)
### Aider v0.14.0
- [Support for Claude2 and other LLMs via OpenRouter](https://aider.chat/docs/faq.html#accessing-other-llms-with-openrouter) by @joshuavial
- Documentation for [running the aider benchmarking suite](https://github.com/paul-gauthier/aider/tree/main/benchmark)
- Documentation for [running the aider benchmarking suite](https://github.com/Aider-AI/aider/tree/main/benchmark)
- Aider now requires Python >= 3.9
@@ -657,7 +771,7 @@ cog.out(text)
- Added `/git` command to run git from inside aider chats.
- Use Meta-ENTER (Esc+ENTER in some environments) to enter multiline chat messages.
- Create a `.gitignore` with `.aider*` to prevent users from accidentaly adding aider files to git.
- Create a `.gitignore` with `.aider*` to prevent users from accidentally adding aider files to git.
- Check pypi for newer versions and notify user.
- Updated keyboard interrupt logic so that 2 ^C in 2 seconds always forces aider to exit.
- Provide GPT with detailed error if it makes a bad edit block, ask for a retry.

View File

@@ -24,7 +24,7 @@ exclude:
aux_links:
"GitHub":
- "https://github.com/paul-gauthier/aider"
- "https://github.com/Aider-AI/aider"
"Discord":
- "https://discord.gg/Tv2uQnR88V"
"Blog":
@@ -32,13 +32,17 @@ aux_links:
nav_external_links:
- title: "GitHub"
url: "https://github.com/paul-gauthier/aider"
url: "https://github.com/Aider-AI/aider"
- title: "Discord"
url: "https://discord.gg/Tv2uQnR88V"
repository: paul-gauthier/aider
repository: Aider-AI/aider
callouts:
tip:
title: Tip
color: green
color: green
note:
title: Note
color: yellow

View File

@@ -0,0 +1,492 @@
- dirname: 2024-09-25-21-17-19--architect-sonnet-sonnet-diff
test_cases: 133
model: claude-3.5-sonnet
editor_model: claude-3.5-sonnet
editor_edit_format: diff
edit_format: architect
commit_hash: c18d6a8-dirty
pass_rate_1: 62.4
pass_rate_2: 80.5
percent_cases_well_formed: 100.0
error_outputs: 3
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 183
lazy_comments: 6
syntax_errors: 9
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model openrouter/anthropic/claude-3.5-sonnet
date: 2024-09-25
versions: 0.57.2.dev
seconds_per_case: 25.1
total_cost: 4.9502
- dirname: 2024-07-04-14-32-08--claude-3.5-sonnet-diff-continue
test_cases: 133
model: claude-3.5-sonnet
edit_format: diff
commit_hash: 35f21b5
pass_rate_1: 57.1
pass_rate_2: 77.4
percent_cases_well_formed: 99.2
error_outputs: 23
released: 2024-06-20
num_malformed_responses: 4
num_with_malformed_responses: 1
user_asks: 2
lazy_comments: 0
syntax_errors: 1
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --sonnet
date: 2024-07-04
versions: 0.42.1-dev
seconds_per_case: 17.6
total_cost: 3.6346
- dirname: 2024-09-25-21-25-01--architect-o1mini-4o-jr-diff
test_cases: 133
model: o1-mini
editor_model: gpt-4o
editor_edit_format: diff
edit_format: architect
commit_hash: 3f682ed-dirty, 25e833b
pass_rate_1: 51.1
pass_rate_2: 70.7
percent_cases_well_formed: 100.0
error_outputs: 12
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 214
lazy_comments: 6
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model o1-mini
date: 2024-09-25
versions: 0.57.2.dev
seconds_per_case: 23.7
total_cost: 9.3158
- dirname: 2024-09-26-15-05-58--architect-o1mini-deep-jr-whole
test_cases: 133
model: o1-mini
edit_format: architect
commit_hash: 1676653-dirty
editor_model: deepseek
editor_edit_format: whole
pass_rate_1: 51.9
pass_rate_2: 71.4
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 199
lazy_comments: 11
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model o1-mini
date: 2024-09-26
versions: 0.57.2.dev
seconds_per_case: 48.2
total_cost: 5.6069
- dirname: 2024-09-25-21-33-40--architect-4o-4o-jr-diff
test_cases: 133
model: gpt-4o
editor_model: gpt-4o
editor_edit_format: diff
edit_format: architect
commit_hash: 9f3cd92
pass_rate_1: 56.4
pass_rate_2: 75.2
percent_cases_well_formed: 100.0
error_outputs: 13
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 207
lazy_comments: 8
syntax_errors: 1
indentation_errors: 1
exhausted_context_windows: 0
test_timeouts: 3
command: aider --model gpt-4o
date: 2024-09-25
versions: 0.57.2.dev
seconds_per_case: 18.2
total_cost: 6.0918
- dirname: 2024-09-21-16-45-11--o1-preview-flex-sr-markers
test_cases: 133
model: o1-preview
edit_format: diff
commit_hash: 5493654-dirty
pass_rate_1: 57.9
pass_rate_2: 79.7
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: 10
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model o1-preview
date: 2024-09-21
versions: 0.56.1.dev
seconds_per_case: 80.9
total_cost: 63.9190
- dirname: 2024-09-25-21-39-05--architect-o1preview-4o-jr-diff
test_cases: 133
model: o1-preview
editor_model: gpt-4o
editor_edit_format: diff
edit_format: architect
commit_hash: 9f3cd92
pass_rate_1: 63.2
pass_rate_2: 80.5
percent_cases_well_formed: 100.0
error_outputs: 23
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 191
lazy_comments: 2
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 4
command: aider --model o1-preview
date: 2024-09-25
versions: 0.57.2.dev
seconds_per_case: 42.3
total_cost: 39.3766
- dirname: 2024-09-25-21-52-42--architect-o1preview-sonnet-jr-diff
test_cases: 133
model: o1-preview
editor_model: claude-3.5-sonnet
editor_edit_format: diff
edit_format: architect
commit_hash: 9f3cd92
editor_model: claude-3-5-sonnet
pass_rate_1: 60.9
pass_rate_2: 82.7
percent_cases_well_formed: 100.0
error_outputs: 1
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 180
lazy_comments: 3
syntax_errors: 9
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 3
command: aider --model o1-preview
date: 2024-09-25
versions: 0.57.2.dev
seconds_per_case: 44.9
total_cost: 37.6192
- dirname: 2024-09-21-16-40-56--o1-mini-flex-sr-markers
test_cases: 36
model: o1-mini
edit_format: diff
commit_hash: 5493654
pass_rate_1: 50.0
pass_rate_2: 61.1
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 3
lazy_comments: 0
syntax_errors: 0
indentation_errors: 1
exhausted_context_windows: 0
test_timeouts: 0
command: aider --model o1-mini
date: 2024-09-21
versions: 0.56.1.dev
seconds_per_case: 26.7
total_cost: 2.4226
- dirname: 2024-09-25-23-12-14--architect-o1mini-deep-jr-diff
test_cases: 133
model: o1-mini
edit_format: architect
commit_hash: 9f3cd92-dirty
editor_model: deepseek
editor_edit_format: diff
pass_rate_1: 48.9
pass_rate_2: 69.2
percent_cases_well_formed: 100.0
error_outputs: 1
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 202
lazy_comments: 12
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model o1-mini
date: 2024-09-25
versions: 0.57.2.dev
seconds_per_case: 52.2
total_cost: 5.7927
- dirname: 2024-09-25-23-18-16--architect-o1preview-deep-jr-diff
test_cases: 133
model: o1-preview
edit_format: architect
commit_hash: 9f3cd92-dirty
editor_model: deepseek
editor_edit_format: diff
pass_rate_1: 64.7
pass_rate_2: 80.5
percent_cases_well_formed: 100.0
error_outputs: 5
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 180
lazy_comments: 2
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model o1-preview
date: 2024-09-25
versions: 0.57.2.dev
seconds_per_case: 73.2
total_cost: 35.7887
- dirname: 2024-09-25-23-30-36--architect-o1preview-deep-jr-whole
test_cases: 133
model: o1-preview
edit_format: architect
commit_hash: 9f3cd92-dirty
editor_model: deepseek
editor_edit_format: whole
pass_rate_1: 63.9
pass_rate_2: 85.0
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 181
lazy_comments: 12
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model o1-preview
date: 2024-09-25
versions: 0.57.2.dev
seconds_per_case: 67.4
total_cost: 35.3152
- dirname: 2024-09-26-15-15-17--architect-sonnet-deep-jr-whole
test_cases: 133
model: claude-3.5-sonnet
edit_format: architect
commit_hash: bc1559f-dirty
editor_model: deepseek
editor_edit_format: whole
pass_rate_1: 61.7
pass_rate_2: 78.9
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 184
lazy_comments: 5
syntax_errors: 9
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 3
command: aider --model openrouter/anthropic/claude-3.5-sonnet
date: 2024-09-26
versions: 0.57.2.dev
seconds_per_case: 37.2
total_cost: 2.1510
- dirname: 2024-09-26-15-33-28--costs-gpt4o-diff
test_cases: 133
model: gpt-4o
edit_format: diff
commit_hash: 89aa385-dirty
pass_rate_1: 55.6
pass_rate_2: 71.4
percent_cases_well_formed: 97.7
error_outputs: 5
num_malformed_responses: 5
num_with_malformed_responses: 3
user_asks: 10
lazy_comments: 0
syntax_errors: 0
indentation_errors: 1
exhausted_context_windows: 0
test_timeouts: 0
command: aider --model gpt-4o
date: 2024-09-26
versions: 0.57.2.dev
seconds_per_case: 9.7
total_cost: 3.8088
- dirname: 2024-09-26-15-41-08--architect-4o-deep-jr-whole
test_cases: 133
model: gpt-4o
edit_format: architect
commit_hash: 89aa385-dirty
editor_model: deepseek
editor_edit_format: whole
pass_rate_1: 60.9
pass_rate_2: 73.7
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 187
lazy_comments: 12
syntax_errors: 5
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model gpt-4o
date: 2024-09-26
versions: 0.57.2.dev
seconds_per_case: 38.0
total_cost: 2.4737
- dirname: 2024-09-26-15-54-08--architect-4o-deep-jr-diff
test_cases: 133
model: gpt-4o
edit_format: architect
commit_hash: 89aa385-dirty
editor_model: deepseek
editor_edit_format: diff
pass_rate_1: 57.1
pass_rate_2: 74.4
percent_cases_well_formed: 100.0
error_outputs: 4
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 192
lazy_comments: 6
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model gpt-4o
date: 2024-09-26
versions: 0.57.2.dev
seconds_per_case: 44.0
total_cost: 2.5498
- dirname: 2024-09-26-16-06-39--architect-sonnet-deep-jr-diff
test_cases: 133
model: claude-3.5-sonnet
edit_format: architect
commit_hash: 89aa385-dirty
editor_model: deepseek
editor_edit_format: diff
pass_rate_1: 61.7
pass_rate_2: 78.9
percent_cases_well_formed: 100.0
error_outputs: 2
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 184
lazy_comments: 2
syntax_errors: 9
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model openrouter/anthropic/claude-3.5-sonnet
date: 2024-09-26
versions: 0.57.2.dev
seconds_per_case: 43.2
total_cost: 2.1488
- dirname: 2024-09-27-18-15-32--architect-4omini-4omini
test_cases: 133
model: gpt-4o-mini
edit_format: architect
commit_hash: 0bd8058-dirty
editor_model: gpt-4o-mini
editor_edit_format: whole
pass_rate_1: 43.6
pass_rate_2: 60.2
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 208
lazy_comments: 2
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 3
command: aider --model gpt-4o-mini
date: 2024-09-27
versions: 0.57.2.dev
seconds_per_case: 21.0
total_cost: 0.1527
- dirname: 2024-07-18-18-57-46--gpt-4o-mini-whole
test_cases: 133
model: gpt-4o-mini
edit_format: whole
commit_hash: d31eef3-dirty
pass_rate_1: 40.6
pass_rate_2: 55.6
released: 2024-07-18
percent_cases_well_formed: 100.0
error_outputs: 1
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 1
lazy_comments: 0
syntax_errors: 1
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model gpt-4o-mini
date: 2024-07-18
versions: 0.44.1-dev
seconds_per_case: 7.8
total_cost: 0.0916
- dirname: 2024-09-29-22-35-36--architect-o1preview-o1mini-whole
test_cases: 133
model: o1-preview
edit_format: architect
commit_hash: 53ca83b
editor_model: o1-mini
editor_edit_format: whole
pass_rate_1: 65.4
pass_rate_2: 85.0
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 179
lazy_comments: 4
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model o1-preview
date: 2024-09-29
versions: 0.58.1.dev
seconds_per_case: 39.7
total_cost: 36.2078

View File

@@ -2380,3 +2380,389 @@
Paul Gauthier (aider): 204
start_tag: v0.53.0
total_lines: 319
- aider_percentage: 52.9
aider_total: 811
end_date: '2024-09-04'
end_tag: v0.55.0
file_counts:
aider/__init__.py:
Paul Gauthier: 4
Paul Gauthier (aider): 2
aider/args.py:
Paul Gauthier (aider): 7
aider/coders/base_coder.py:
Paul Gauthier: 63
Paul Gauthier (aider): 42
aider/coders/editblock_coder.py:
Nikolay Sedelnikov: 8
aider/coders/editblock_func_coder.py:
Antti Kaihola: 2
aider/coders/search_replace.py:
Paul Gauthier: 2
aider/coders/wholefile_coder.py:
Paul Gauthier: 16
aider/commands.py:
Antti Kaihola: 7
Paul Gauthier: 85
Paul Gauthier (aider): 27
aider/format_settings.py:
Paul Gauthier (aider): 26
aider/gui.py:
Paul Gauthier: 4
aider/io.py:
Paul Gauthier: 63
Paul Gauthier (aider): 13
aider/linter.py:
Paul Gauthier: 5
aider/llm.py:
Paul Gauthier: 2
aider/main.py:
Paul Gauthier: 86
Paul Gauthier (aider): 22
aider/models.py:
Paul Gauthier: 24
Paul Gauthier (aider): 2
aider/repo.py:
Paul Gauthier: 85
aider/repomap.py:
Paul Gauthier: 32
Paul Gauthier (aider): 4
aider/report.py:
Paul Gauthier: 77
Paul Gauthier (aider): 120
aider/run_cmd.py:
Paul Gauthier: 17
Paul Gauthier (aider): 24
aider/scrape.py:
Paul Gauthier: 7
Paul Gauthier (aider): 8
aider/special.py:
Paul Gauthier: 5
Paul Gauthier (aider): 197
aider/urls.py:
Paul Gauthier (aider): 1
aider/utils.py:
Paul Gauthier: 31
Paul Gauthier (aider): 29
aider/versioncheck.py:
Paul Gauthier: 32
Paul Gauthier (aider): 6
aider/voice.py:
Paul Gauthier: 7
Paul Gauthier (aider): 9
scripts/versionbump.py:
Paul Gauthier: 9
tests/basic/test_coder.py:
Paul Gauthier: 3
Paul Gauthier (aider): 105
tests/basic/test_editblock.py:
Antti Kaihola: 3
Nikolay Sedelnikov: 37
tests/basic/test_io.py:
Paul Gauthier: 2
Paul Gauthier (aider): 15
tests/basic/test_main.py:
Paul Gauthier: 2
Paul Gauthier (aider): 10
tests/basic/test_models.py:
Paul Gauthier (aider): 4
tests/basic/test_repomap.py:
Paul Gauthier (aider): 42
tests/basic/test_run_cmd.py:
Paul Gauthier (aider): 11
tests/basic/test_special.py:
Paul Gauthier: 2
Paul Gauthier (aider): 74
tests/scrape/test_scrape.py:
Paul Gauthier (aider): 11
grand_total:
Antti Kaihola: 12
Nikolay Sedelnikov: 45
Paul Gauthier: 665
Paul Gauthier (aider): 811
start_tag: v0.54.0
total_lines: 1533
- aider_percentage: 55.6
aider_total: 154
end_date: '2024-09-09'
end_tag: v0.56.0
file_counts:
aider/__init__.py:
Paul Gauthier: 1
aider/args.py:
Paul Gauthier: 2
Paul Gauthier (aider): 6
aider/coders/base_coder.py:
Paul Gauthier: 14
Paul Gauthier (aider): 10
aider/commands.py:
Paul Gauthier: 8
Paul Gauthier (aider): 6
aider/io.py:
Paul Gauthier: 5
aider/linter.py:
Paul Gauthier: 6
Paul Gauthier (aider): 4
fry69: 12
aider/main.py:
Paul Gauthier: 35
Paul Gauthier (aider): 48
aider/models.py:
Paul Gauthier: 2
fry69: 3
aider/repo.py:
Paul Gauthier: 16
aider/repomap.py:
Paul Gauthier: 13
aider/report.py:
Paul Gauthier: 2
Paul Gauthier (aider): 20
benchmark/benchmark.py:
Paul Gauthier: 1
tests/basic/test_linter.py:
Paul Gauthier: 1
Paul Gauthier (aider): 51
tests/basic/test_main.py:
Paul Gauthier: 2
Paul Gauthier (aider): 9
grand_total:
Paul Gauthier: 108
Paul Gauthier (aider): 154
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
- aider_percentage: 53.45
aider_total: 712
end_date: '2024-09-29'
end_tag: v0.58.0
file_counts:
.github/workflows/docker-build-test.yml:
Paul Gauthier: 1
Paul Gauthier (aider): 11
aider/__init__.py:
Paul Gauthier: 1
aider/args.py:
Paul Gauthier: 8
Paul Gauthier (aider): 109
Stein Martin Hustad: 17
fry69: 2
aider/coders/__init__.py:
Paul Gauthier: 6
Paul Gauthier (aider): 2
aider/coders/architect_coder.py:
Paul Gauthier: 40
Paul Gauthier (aider): 3
aider/coders/base_coder.py:
Jonathan Ellis: 1
Paul Gauthier: 32
Paul Gauthier (aider): 8
aider/coders/editor_editblock_coder.py:
Paul Gauthier: 6
Paul Gauthier (aider): 1
aider/coders/editor_whole_coder.py:
Paul Gauthier: 7
aider/coders/wholefile_coder.py:
Paul Gauthier: 2
aider/commands.py:
Jonathan Ellis: 1
Mike Bailey: 1
Paul Gauthier: 20
Paul Gauthier (aider): 78
fry69: 2
aider/help.py:
Paul Gauthier: 27
Paul Gauthier (aider): 7
aider/history.py:
Paul Gauthier: 1
aider/io.py:
Paul Gauthier: 39
Paul Gauthier (aider): 62
Stein Martin Hustad: 5
fry69: 10
aider/linter.py:
Paul Gauthier: 6
aider/main.py:
Paul Gauthier: 13
Paul Gauthier (aider): 6
Stein Martin Hustad: 4
fry69: 1
rti: 1
aider/models.py:
Paul Gauthier: 58
Paul Gauthier (aider): 85
aider/repo.py:
Paul Gauthier: 16
Paul Gauthier (aider): 2
aider/repomap.py:
Paul Gauthier: 5
aider/scrape.py:
Paul Gauthier (aider): 3
aider/sendchat.py:
Paul Gauthier: 1
Paul Gauthier (aider): 5
aider/utils.py:
Paul Gauthier: 4
aider/versioncheck.py:
Paul Gauthier: 2
aider/voice.py:
Mike Bailey: 17
Paul Gauthier: 2
Paul Gauthier (aider): 10
benchmark/benchmark.py:
Paul Gauthier: 25
Paul Gauthier (aider): 29
fry69: 3
scripts/issues.py:
Paul Gauthier: 5
Paul Gauthier (aider): 45
scripts/update-docs.sh:
Paul Gauthier: 1
scripts/yank-old-versions.py:
Paul Gauthier (aider): 51
tests/basic/test_commands.py:
Paul Gauthier: 2
Paul Gauthier (aider): 98
tests/basic/test_io.py:
Paul Gauthier: 2
Paul Gauthier (aider): 97
tests/basic/test_main.py:
Paul Gauthier: 2
tests/basic/test_models.py:
Paul Gauthier: 4
tests/basic/test_sanity_check_repo.py:
fry69: 179
tests/basic/test_wholefile.py:
Paul Gauthier: 38
grand_total:
Jonathan Ellis: 2
Mike Bailey: 18
Paul Gauthier: 376
Paul Gauthier (aider): 712
Stein Martin Hustad: 26
fry69: 197
rti: 1
start_tag: v0.57.0
total_lines: 1332
- aider_percentage: 76.79
aider_total: 172
end_date: '2024-10-04'
end_tag: v0.59.0
file_counts:
aider/__init__.py:
Paul Gauthier: 1
aider/args.py:
Paul Gauthier: 2
Paul Gauthier (aider): 6
aider/args_formatter.py:
Paul Gauthier: 4
aider/coders/architect_coder.py:
Paul Gauthier: 1
aider/coders/base_coder.py:
Paul Gauthier: 6
aider/coders/editblock_coder.py:
Paul Gauthier: 1
aider/commands.py:
Paul Gauthier: 3
Paul Gauthier (aider): 49
aider/gui.py:
Paul Gauthier: 2
aider/main.py:
Paul Gauthier: 10
Paul Gauthier (aider): 4
aider/models.py:
Paul Gauthier (aider): 12
aider/repomap.py:
Paul Gauthier: 9
Paul Gauthier (aider): 3
aider/urls.py:
Paul Gauthier: 2
aider/versioncheck.py:
Paul Gauthier: 1
scripts/issues.py:
Paul Gauthier: 1
scripts/update-docs.sh:
Paul Gauthier: 2
tests/basic/test_commands.py:
Paul Gauthier: 4
Paul Gauthier (aider): 80
tests/basic/test_models.py:
Paul Gauthier: 1
Paul Gauthier (aider): 18
tests/basic/test_sanity_check_repo.py:
Paul Gauthier: 1
tests/help/test_help.py:
Paul Gauthier: 1
grand_total:
Paul Gauthier: 52
Paul Gauthier (aider): 172
start_tag: v0.58.0
total_lines: 224

View File

@@ -317,29 +317,6 @@
seconds_per_case: 22.9
total_cost: 2.7494
- dirname: 2024-05-09-18-57-52--deepseek-chat-v2-diff-reverted-and-helpful-assistant2
test_cases: 133
model: DeepSeek Chat V2 (original)
released: 2024-05-06
edit_format: diff
commit_hash: 80a3f6d
pass_rate_1: 44.4
pass_rate_2: 60.9
percent_cases_well_formed: 97.0
error_outputs: 14
num_malformed_responses: 4
user_asks: 2
lazy_comments: 0
syntax_errors: 13
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 3
command: aider --model deepseek/deepseek-chat
date: 2024-05-09
versions: 0.33.1-dev
seconds_per_case: 86.8
total_cost: 0.0941
- dirname: 2024-05-07-20-32-37--qwen1.5-110b-chat-whole
test_cases: 133
model: qwen1.5-110b-chat
@@ -407,7 +384,7 @@
versions: 0.34.1-dev
seconds_per_case: 6.0
total_cost: 0.0000
- dirname: 2024-04-12-22-18-20--gpt-4-turbo-2024-04-09-plain-diff
test_cases: 33
model: gpt-4-turbo-2024-04-09 (diff)
@@ -665,7 +642,7 @@
- dirname: 2024-07-19-08-57-13--openrouter-deepseek-chat-v2-0628
test_cases: 133
model: DeepSeek Chat V2 0628
model: DeepSeek Chat V2 0628 (deprecated)
edit_format: diff
commit_hash: 96ff06e-dirty
pass_rate_1: 60.9
@@ -737,7 +714,7 @@
- dirname: 2024-07-24-07-10-58--deepseek-coder2-0724-diff-direct
test_cases: 133
model: DeepSeek Coder V2 0724
model: DeepSeek Coder V2 0724 (deprecated)
edit_format: diff
commit_hash: 89965bf
pass_rate_1: 57.9
@@ -855,30 +832,6 @@
seconds_per_case: 6.5
total_cost: 0.0000
- dirname: 2024-08-14-13-07-12--chatgpt-4o-latest-diff
test_cases: 133
model: chatgpt-4o-latest
edit_format: diff
commit_hash: b1c3769
pass_rate_1: 53.4
pass_rate_2: 69.2
percent_cases_well_formed: 97.7
error_outputs: 27
num_malformed_responses: 5
num_with_malformed_responses: 3
user_asks: 7
lazy_comments: 0
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 0
command: aider --model openai/chatgpt-4o-latest
date: 2024-08-14
released: 2024-08-08
versions: 0.50.2-dev
seconds_per_case: 26.3
total_cost: 3.6113
- dirname: 2024-08-28-07-10-50--gemini-1.5-pro-exp-0827-diff-fenced
test_cases: 133
model: gemini-1.5-pro-exp-0827
@@ -969,4 +922,577 @@
date: 2024-08-30
versions: 0.54.8-dev
seconds_per_case: 38.3
total_cost: 0.0000
total_cost: 0.0000
- dirname: 2024-09-04-16-08-09--yi-coder-9b-whole
test_cases: 133
model: Yi Coder 9B Chat
edit_format: whole
commit_hash: c4e4967
pass_rate_1: 46.6
pass_rate_2: 54.1
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 9
lazy_comments: 0
syntax_errors: 14
indentation_errors: 2
exhausted_context_windows: 0
test_timeouts: 4
command: aider --model openai/hf:01-ai/Yi-Coder-9B-Chat --openai-api-base https://glhf.chat/api/openai/v1
date: 2024-09-04
versions: 0.54.13.dev
seconds_per_case: 8.3
total_cost: 0.0000
released: 2024-09-04
- dirname: 2024-09-04-16-17-33--yi-coder-9b-chat-q4_0-whole
test_cases: 133
model: yi-coder:9b-chat-q4_0
edit_format: whole
commit_hash: c4e4967
pass_rate_1: 41.4
pass_rate_2: 45.1
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 48
lazy_comments: 1
syntax_errors: 1
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 0
command: aider --model ollama/yi-coder:9b-chat-q4_0
date: 2024-09-04
versions: 0.54.13.dev
seconds_per_case: 125.3
total_cost: 0.0000
- dirname: 2024-09-05-14-50-11--deepseek-sep5-no-shell
test_cases: 133
model: DeepSeek V2.5
edit_format: diff
commit_hash: 1279c86
pass_rate_1: 54.9
pass_rate_2: 72.2
percent_cases_well_formed: 96.2
error_outputs: 5
num_malformed_responses: 5
num_with_malformed_responses: 5
user_asks: 4
lazy_comments: 0
syntax_errors: 1
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --deepseek
date: 2024-09-05
versions: 0.55.1.dev
seconds_per_case: 49.6
total_cost: 0.0998
- dirname: 2024-09-06-19-55-17--reflection-hyperbolic-whole-output2
test_cases: 133
model: Reflection-70B
edit_format: whole
commit_hash: 74631ee-dirty, 2aef59e-dirty
pass_rate_1: 33.1
pass_rate_2: 42.1
percent_cases_well_formed: 100.0
error_outputs: 2
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 10
lazy_comments: 26
syntax_errors: 1
indentation_errors: 3
exhausted_context_windows: 0
test_timeouts: 3
command: (not currently supported)
date: 2024-09-06
versions: 0.55.1.dev
seconds_per_case: 61.6
total_cost: 0.0000
- dirname: 2024-09-11-15-42-17--command-r-plus-08-2024-whole
test_cases: 133
model: Command R+ (08-24)
edit_format: whole
commit_hash: b43ed20
pass_rate_1: 27.1
pass_rate_2: 38.3
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 7
lazy_comments: 10
syntax_errors: 0
indentation_errors: 3
exhausted_context_windows: 0
test_timeouts: 4
command: aider --model command-r-plus-08-2024
date: 2024-09-11
versions: 0.56.1.dev
seconds_per_case: 20.3
total_cost: 0.0000
- dirname: 2024-09-11-15-47-02--command-r-08-2024-whole
test_cases: 133
model: Command R (08-24)
edit_format: whole
commit_hash: b43ed20-dirty
pass_rate_1: 30.1
pass_rate_2: 38.3
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 4
lazy_comments: 0
syntax_errors: 1
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model command-r-08-2024
date: 2024-09-11
versions: 0.56.1.dev
seconds_per_case: 7.6
total_cost: 0.0000
- dirname: 2024-09-12-19-57-35--o1-mini-whole
test_cases: 133
model: o1-mini (whole)
edit_format: whole
commit_hash: 36fa773-dirty, 291b456
pass_rate_1: 49.6
pass_rate_2: 70.7
percent_cases_well_formed: 90.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 17
lazy_comments: 0
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model o1-mini
date: 2024-09-12
versions: 0.56.1.dev
seconds_per_case: 103.0
total_cost: 5.3725
- dirname: 2024-09-21-16-40-56--o1-mini-flex-sr-markers
test_cases: 36
model: o1-mini
edit_format: diff
commit_hash: 5493654
pass_rate_1: 50.0
pass_rate_2: 61.1
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 3
lazy_comments: 0
syntax_errors: 0
indentation_errors: 1
exhausted_context_windows: 0
test_timeouts: 0
command: aider --model o1-mini
date: 2024-09-21
versions: 0.56.1.dev
seconds_per_case: 26.7
total_cost: 2.4226
- dirname: 2024-09-21-16-45-11--o1-preview-flex-sr-markers
test_cases: 133
model: o1-preview
edit_format: diff
commit_hash: 5493654-dirty
pass_rate_1: 57.9
pass_rate_2: 79.7
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: 10
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model o1-preview
date: 2024-09-21
versions: 0.56.1.dev
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
edit_format: whole
commit_hash: 6f2b064-dirty
pass_rate_1: 45.1
pass_rate_2: 51.9
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 4
lazy_comments: 0
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model ollama/qwen2.5-coder:7b-instruct-q8_0
date: 2024-09-19
versions: 0.56.0
seconds_per_case: 9.3
total_cost: 0.0000
- 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: 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: 2
indentation_errors: 1
exhausted_context_windows: 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: 39.8
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
- dirname: 2024-09-24-16-26-45--gemini-1.5-pro-002-diff-fenced
test_cases: 133
model: gemini-1.5-pro-002
edit_format: diff-fenced
commit_hash: 6b5fe9b, 3edcd71
pass_rate_1: 49.6
pass_rate_2: 65.4
percent_cases_well_formed: 96.2
error_outputs: 17
num_malformed_responses: 17
num_with_malformed_responses: 5
user_asks: 3
lazy_comments: 0
syntax_errors: 2
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 4
command: aider --model gemini/gemini-1.5-pro-002
date: 2024-09-24
versions: 0.57.2.dev
seconds_per_case: 11.6
total_cost: 2.8166
- dirname: 2024-09-24-16-33-23--gemini-1.5-flash-002-whole
test_cases: 133
model: gemini-1.5-flash-002
edit_format: whole
commit_hash: 3edcd71
pass_rate_1: 37.6
pass_rate_2: 51.1
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 3
lazy_comments: 0
syntax_errors: 1
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model gemini/gemini-1.5-flash-002
date: 2024-09-24
versions: 0.57.2.dev
seconds_per_case: 5.1
total_cost: 0.0515
- dirname: 2024-09-24-15-18-59--gemini-1.5-flash-8b-exp-0924-whole
test_cases: 133
model: gemini-1.5-flash-8b-exp-0924
edit_format: whole
commit_hash: 86faaa6
pass_rate_1: 33.1
pass_rate_2: 38.3
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 9
lazy_comments: 6
syntax_errors: 8
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model gemini/gemini-1.5-flash-8b-exp-0924
date: 2024-09-24
versions: 0.57.2.dev
seconds_per_case: 6.6
total_cost: 0.0000
- dirname: 2024-09-28-18-30-20--codestral-whole
test_cases: 133
model: ollama/codestral
edit_format: whole
commit_hash: 1971285-dirty
pass_rate_1: 33.8
pass_rate_2: 45.9
percent_cases_well_formed: 98.5
error_outputs: 8
num_malformed_responses: 8
num_with_malformed_responses: 2
user_asks: 12
lazy_comments: 6
syntax_errors: 5
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 4
command: aider --model ollama/codestral
date: 2024-09-28
versions: 0.57.2.dev
seconds_per_case: 67.2
total_cost: 0.0000
- dirname: 2024-09-29-17-51-11--codegeex4-whole-2
test_cases: 133
model: ollama/codegeex4
edit_format: whole
commit_hash: 228ae24
pass_rate_1: 28.6
pass_rate_2: 32.3
percent_cases_well_formed: 97.0
error_outputs: 20
num_malformed_responses: 20
num_with_malformed_responses: 4
user_asks: 56
lazy_comments: 5
syntax_errors: 5
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 4
command: aider --model ollama/codegeex4
date: 2024-09-29
versions: 0.57.2.dev
seconds_per_case: 128.1
total_cost: 0.0000
- dirname: 2024-09-30-00-09-00--wojtek-opencodeinterpreter-6.7b-whole-2
test_cases: 133
model: ollama/wojtek/opencodeinterpreter:6.7b
edit_format: whole
commit_hash: 6d586fd
pass_rate_1: 26.3
pass_rate_2: 30.1
percent_cases_well_formed: 91.0
error_outputs: 18
num_malformed_responses: 18
num_with_malformed_responses: 12
user_asks: 79
lazy_comments: 7
syntax_errors: 0
indentation_errors: 1
exhausted_context_windows: 0
test_timeouts: 6
command: aider --model ollama/wojtek/opencodeinterpreter:6.7b
date: 2024-09-30
versions: 0.58.1.dev
seconds_per_case: 59.3
total_cost: 0.0000
- dirname: 2024-09-30-03-49-01--mistral-nemo-12b-instruct-2407-q4_K_M-whole-1
test_cases: 133
model: ollama/mistral-nemo:12b-instruct-2407-q4_K_M
edit_format: whole
commit_hash: ba4dec8
pass_rate_1: 22.6
pass_rate_2: 33.1
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 53
lazy_comments: 37
syntax_errors: 2
indentation_errors: 2
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model ollama/mistral-nemo:12b-instruct-2407-q4_K_M
date: 2024-09-30
versions: 0.58.1.dev
seconds_per_case: 34.7
total_cost: 0.0000
- dirname: 2024-09-30-14-09-43--qwen2.5-32b-whole-2
test_cases: 133
model: ollama/qwen2.5:32b
edit_format: whole
commit_hash: 765c4cb
pass_rate_1: 44.4
pass_rate_2: 54.1
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 9
lazy_comments: 0
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 3
command: aider --model ollama/qwen2.5:32b
date: 2024-09-30
versions: 0.58.1.dev
seconds_per_case: 134.9
total_cost: 0.0000
- dirname: 2024-09-30-19-35-40--llama3.2-3b-instruct-fp16-whole-1
test_cases: 133
model: ollama/llama3.2:3b-instruct-fp16
edit_format: whole
commit_hash: 3f12290
pass_rate_1: 20.3
pass_rate_2: 26.3
percent_cases_well_formed: 97.0
error_outputs: 21
num_malformed_responses: 21
num_with_malformed_responses: 4
user_asks: 73
lazy_comments: 11
syntax_errors: 1
indentation_errors: 3
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model ollama/llama3.2:3b-instruct-fp16
date: 2024-09-30
versions: 0.58.1.dev
seconds_per_case: 66.6
total_cost: 0.0000
- dirname: 2024-09-30-23-01-24--hermes3-8b-llama3.1-fp16-whole-2
test_cases: 133
model: ollama/hermes3:8b-llama3.1-fp16
edit_format: whole
commit_hash: c5ba4f7
pass_rate_1: 24.1
pass_rate_2: 30.1
percent_cases_well_formed: 98.5
syntax_errors: 0
exhausted_context_windows: 0
command: aider --model ollama/hermes3:8b-llama3.1-fp16
date: 2024-09-30
versions: 0.58.1.dev
seconds_per_case: 64.7
total_cost: 0.0000
- dirname: 2024-10-01-02-33-11--mistral-small-whole-1
test_cases: 133
model: ollama/mistral-small
edit_format: whole
commit_hash: 8a908fa
pass_rate_1: 30.1
pass_rate_2: 38.3
percent_cases_well_formed: 99.2
lazy_comments: 0
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
command: aider --model ollama/mistral-small
date: 2024-10-01
versions: 0.58.1.dev
seconds_per_case: 84.6
total_cost: 0.0000
- dirname: 2024-10-01-07-05-40--yi-coder-9b-chat-fp16-whole-1
test_cases: 133
model: ollama/yi-coder:9b-chat-fp16
edit_format: whole
commit_hash: 52c6632-dirty
pass_rate_1: 39.8
pass_rate_2: 43.6
percent_cases_well_formed: 99.2
lazy_comments: 0
indentation_errors: 0
exhausted_context_windows: 0
command: aider --model ollama/yi-coder:9b-chat-fp16
date: 2024-10-01
versions: 0.58.1.dev
seconds_per_case: 63.7
total_cost: 0.0000
- dirname: 2024-10-01-16-50-09--hermes3-whole-4
test_cases: 133
model: ollama/hermes3
edit_format: whole
commit_hash: 415e898
pass_rate_1: 21.1
pass_rate_2: 22.6
percent_cases_well_formed: 98.5
exhausted_context_windows: 0
command: aider --model ollama/hermes3
date: 2024-10-01
versions: 0.58.1.dev
seconds_per_case: 24.8
total_cost: 0.0000
- dirname: 2024-10-04-16-30-08--chatgpt-4o-latest-diff-oct4
test_cases: 133
model: openai/chatgpt-4o-latest
edit_format: diff
commit_hash: af10953
pass_rate_1: 56.4
pass_rate_2: 72.2
percent_cases_well_formed: 97.0
error_outputs: 4
num_malformed_responses: 4
num_with_malformed_responses: 4
user_asks: 21
lazy_comments: 0
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model openai/chatgpt-4o-latest
date: 2024-10-04
versions: 0.58.2.dev
seconds_per_case: 23.7
total_cost: 4.0641

View File

@@ -0,0 +1,186 @@
- dirname: 2024-07-18-18-57-46--gpt-4o-mini-whole
test_cases: 133
model: gpt-4o-mini (whole)
edit_format: whole
commit_hash: d31eef3-dirty
pass_rate_1: 40.6
pass_rate_2: 55.6
released: 2024-07-18
percent_cases_well_formed: 100.0
error_outputs: 1
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 1
lazy_comments: 0
syntax_errors: 1
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --model gpt-4o-mini
date: 2024-07-18
versions: 0.44.1-dev
seconds_per_case: 7.8
total_cost: 0.0916
- dirname: 2024-07-04-14-32-08--claude-3.5-sonnet-diff-continue
test_cases: 133
model: claude-3.5-sonnet (diff)
edit_format: diff
commit_hash: 35f21b5
pass_rate_1: 57.1
pass_rate_2: 77.4
percent_cases_well_formed: 99.2
error_outputs: 23
released: 2024-06-20
num_malformed_responses: 4
num_with_malformed_responses: 1
user_asks: 2
lazy_comments: 0
syntax_errors: 1
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --sonnet
date: 2024-07-04
versions: 0.42.1-dev
seconds_per_case: 17.6
total_cost: 3.6346
- dirname: 2024-08-06-18-28-39--gpt-4o-2024-08-06-diff-again
test_cases: 133
model: gpt-4o-2024-08-06 (diff)
edit_format: diff
commit_hash: ed9ed89
pass_rate_1: 57.1
pass_rate_2: 71.4
percent_cases_well_formed: 98.5
error_outputs: 18
num_malformed_responses: 2
num_with_malformed_responses: 2
user_asks: 10
lazy_comments: 0
syntax_errors: 6
indentation_errors: 2
exhausted_context_windows: 0
test_timeouts: 5
released: 2024-08-06
command: aider --model openai/gpt-4o-2024-08-06
date: 2024-08-06
versions: 0.48.1-dev
seconds_per_case: 6.5
total_cost: 0.0000
- dirname: 2024-09-12-19-57-35--o1-mini-whole
test_cases: 133
model: o1-mini (whole)
edit_format: whole
commit_hash: 36fa773-dirty, 291b456
pass_rate_1: 49.6
pass_rate_2: 70.7
percent_cases_well_formed: 90.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 17
lazy_comments: 0
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model o1-mini
date: 2024-09-12
versions: 0.56.1.dev
seconds_per_case: 103.0
total_cost: 5.3725
- dirname: 2024-09-12-20-56-22--o1-mini-diff
test_cases: 133
model: o1-mini (diff)
edit_format: diff
commit_hash: 4598a37-dirty, 291b456, 752e823-dirty
pass_rate_1: 45.1
pass_rate_2: 62.4
percent_cases_well_formed: 85.7
error_outputs: 26
num_malformed_responses: 26
num_with_malformed_responses: 19
user_asks: 2
lazy_comments: 0
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 1
command: aider --model o1-mini --edit-format diff
date: 2024-09-12
versions: 0.56.1.dev
seconds_per_case: 177.7
total_cost: 11.1071
- 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

View File

@@ -167,7 +167,7 @@
- dirname: 2024-07-24-07-49-39--refac-deepseek-coder-v2-0724
test_cases: 89
model: DeepSeek Coder V2 0724
model: DeepSeek Coder V2 0724 (deprecated)
edit_format: diff
commit_hash: bb6e597
pass_rate_1: 32.6
@@ -208,4 +208,25 @@
versions: 0.48.1-dev
seconds_per_case: 16.9
total_cost: 4.0873
- dirname: 2024-09-05-15-19-05--refac-deepseek-v2.5-no-shell
test_cases: 89
model: DeepSeek Chat V2.5
edit_format: diff
commit_hash: 1279c86, 1279c86-dirty
pass_rate_1: 31.5
percent_cases_well_formed: 67.4
error_outputs: 90
num_malformed_responses: 88
num_with_malformed_responses: 29
user_asks: 8
lazy_comments: 7
syntax_errors: 0
indentation_errors: 6
exhausted_context_windows: 2
test_timeouts: 0
command: aider --deepseek
date: 2024-09-05
versions: 0.55.1.dev
seconds_per_case: 225.4
total_cost: 1.0338

View File

@@ -1,5 +1,5 @@
<canvas id="blameChart" width="800" height="360" style="margin-top: 20px"></canvas>
<canvas id="linesChart" width="800" height="360" style="margin-top: 20px"></canvas>
<canvas id="blameChart" width="800" height="360" style="margin-top: 20px"></canvas>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-moment"></script>

View File

@@ -2,7 +2,7 @@
You can get started quickly like this:
```
python -m pip install aider-chat
python -m pip install -U aider-chat
# Change directory into a git repo
cd /to/your/git/repo

View File

@@ -1,5 +1,5 @@
If you need more help, please check our
[GitHub issues](https://github.com/paul-gauthier/aider/issues)
[GitHub issues](https://github.com/Aider-AI/aider/issues)
and file a new issue if your problem isn't discussed.
Or drop into our
[Discord](https://discord.gg/Tv2uQnR88V)

View File

@@ -0,0 +1,170 @@
<canvas id="{{ include.chart_id }}" width="800" height="450" style="margin-top: 20px"></canvas>
<script>
document.addEventListener('DOMContentLoaded', function () {
var ctx = document.getElementById('{{ include.chart_id }}').getContext('2d');
var leaderboardData = {
labels: [],
datasets: [{
label: 'Percent completed correctly',
data: [],
backgroundColor: [],
borderColor: [],
borderWidth: 1
}]
};
var allData = [];
{% for row in include.data %}
allData.push({
model: '{{ row.model }}',
pass_rate: {{ row[include.pass_rate_key] }},
percent_cases_well_formed: {{ row.percent_cases_well_formed }},
edit_format: '{{ row.edit_format }}'
});
{% endfor %}
function updateChart() {
var selectedRows = document.querySelectorAll('tr.selected');
var showAll = selectedRows.length === 0;
leaderboardData.labels = [];
leaderboardData.datasets[0].data = [];
leaderboardData.datasets[0].backgroundColor = [];
leaderboardData.datasets[0].borderColor = [];
allData.forEach(function(row, index) {
var rowElement = document.getElementById('{{ include.row_prefix }}-' + index);
if (showAll) {
rowElement.classList.remove('selected');
}
if (showAll || rowElement.classList.contains('selected')) {
leaderboardData.labels.push(row.model);
leaderboardData.datasets[0].data.push(row.pass_rate);
switch (row.edit_format) {
case 'whole':
leaderboardData.datasets[0].backgroundColor.push('rgba(255, 99, 132, 0.2)');
leaderboardData.datasets[0].borderColor.push('rgba(255, 99, 132, 1)');
break;
case 'diff':
leaderboardData.datasets[0].backgroundColor.push('rgba(54, 162, 235, 0.2)');
leaderboardData.datasets[0].borderColor.push('rgba(54, 162, 235, 1)');
break;
case 'udiff':
leaderboardData.datasets[0].backgroundColor.push('rgba(75, 192, 192, 0.2)');
leaderboardData.datasets[0].borderColor.push('rgba(75, 192, 192, 1)');
break;
case 'diff-fenced':
leaderboardData.datasets[0].backgroundColor.push('rgba(153, 102, 255, 0.2)');
leaderboardData.datasets[0].borderColor.push('rgba(153, 102, 255, 1)');
break;
default:
leaderboardData.datasets[0].backgroundColor.push('rgba(201, 203, 207, 0.2)');
leaderboardData.datasets[0].borderColor.push('rgba(201, 203, 207, 1)');
}
}
});
// Apply legend filtering
var meta = leaderboardChart.getDatasetMeta(0);
meta.data.forEach(function(bar, index) {
if (leaderboardData.labels.includes(allData[index].model)) {
bar.hidden = (allData[index].edit_format === 'whole' && meta.data[0].hidden) ||
(allData[index].edit_format !== 'whole' && meta.data[1].hidden);
} else {
bar.hidden = true;
}
});
leaderboardChart.update();
}
var tableBody = document.querySelector('table tbody');
allData.forEach(function(row, index) {
var tr = tableBody.children[index];
tr.id = '{{ include.row_prefix }}-' + index;
tr.style.cursor = 'pointer';
tr.onclick = function() {
this.classList.toggle('selected');
updateChart();
};
});
var leaderboardChart = new Chart(ctx, {
type: 'bar',
data: leaderboardData,
options: {
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Correct Exercises (%)'
}
},
x: {
ticks: {
autoSkip: false,
maxRotation: 90,
minRotation: 0
}
}
},
plugins: {
legend: {
display: true,
position: 'top',
labels: {
generateLabels: function(chart) {
var uniqueFormats = [...new Set(allData.map(item => item.edit_format))];
return uniqueFormats.map(format => {
var color;
switch (format) {
case 'whole':
color = { fill: 'rgba(255, 99, 132, 0.2)', stroke: 'rgba(255, 99, 132, 1)' };
break;
case 'diff':
color = { fill: 'rgba(54, 162, 235, 0.2)', stroke: 'rgba(54, 162, 235, 1)' };
break;
case 'udiff':
color = { fill: 'rgba(75, 192, 192, 0.2)', stroke: 'rgba(75, 192, 192, 1)' };
break;
case 'diff-fenced':
color = { fill: 'rgba(153, 102, 255, 0.2)', stroke: 'rgba(153, 102, 255, 1)' };
break;
default:
color = { fill: 'rgba(201, 203, 207, 0.2)', stroke: 'rgba(201, 203, 207, 1)' };
}
return {
text: format,
fillStyle: color.fill,
strokeStyle: color.stroke,
lineWidth: 1,
hidden: false
};
});
}
},
onClick: function(e, legendItem, legend) {
var ci = legend.chart;
var clickedFormat = legendItem.text;
legendItem.hidden = !legendItem.hidden;
ci.data.datasets[0].data.forEach(function(dataPoint, i) {
var meta = ci.getDatasetMeta(0);
if (allData[i].edit_format === clickedFormat) {
meta.data[i].hidden = legendItem.hidden;
}
});
ci.update();
}
}
}
}
});
updateChart();
});
</script>

View File

@@ -1,7 +1,7 @@
<footer class="site-footer">
Aider is AI pair programming in your terminal.
Aider is on
<a href="https://github.com/paul-gauthier/aider">GitHub</a>
<a href="https://github.com/Aider-AI/aider">GitHub</a>
and
<a href="https://discord.gg/Tv2uQnR88V">Discord</a>.
</footer>

View File

@@ -0,0 +1,9 @@
To use aider with pipx on replit, you can run these commands in the replit shell:
```
pip install pipx
pipx run aider-chat ...normal aider args...
```
If you install aider with pipx on replit and try and run it as just `aider` it will crash with a missing `libstdc++.so.6` library.

View File

@@ -110,9 +110,9 @@ source code, by including the critical lines of code for each definition.
Here's a
sample of the map of the aider repo, just showing the maps of
[base_coder.py](https://github.com/paul-gauthier/aider/blob/main/aider/coders/base_coder.py)
[base_coder.py](https://github.com/Aider-AI/aider/blob/main/aider/coders/base_coder.py)
and
[commands.py](https://github.com/paul-gauthier/aider/blob/main/aider/commands.py)
[commands.py](https://github.com/Aider-AI/aider/blob/main/aider/commands.py)
:
```
@@ -188,7 +188,7 @@ It specifically uses the
[py-tree-sitter-languages](https://github.com/grantjenks/py-tree-sitter-languages)
python module,
which provides simple, pip-installable binary wheels for
[most popular programming languages](https://github.com/paul-gauthier/grep-ast/blob/main/grep_ast/parsers.py).
[most popular programming languages](https://github.com/Aider-AI/grep-ast/blob/main/grep_ast/parsers.py).
Tree-sitter parses source code into an Abstract Syntax Tree (AST) based
on the syntax of the programming language.
@@ -209,7 +209,7 @@ that aider originally used.
Switching from ctags to tree-sitter provides a bunch of benefits:
- The map is richer, showing full function call signatures and other details straight from the source files.
- Thanks to `py-tree-sitter-languages`, we get full support for many programming languages via a python package that's automatically installed as part of the normal `python -m pip install aider-chat`.
- Thanks to `py-tree-sitter-languages`, we get full support for many programming languages via a python package that's automatically installed as part of the normal `python -m pip install -U aider-chat`.
- We remove the requirement for users to manually install `universal-ctags` via some external tool or package manager (brew, apt, choco, etc).
- Tree-sitter integration is a key enabler for future work and capabilities for aider.
@@ -245,7 +245,7 @@ just install [aider](https://aider.chat/docs/install.html).
## Credits
Aider uses
[modified versions of the tags.scm files](https://github.com/paul-gauthier/aider/tree/main/aider/queries)
[modified versions of the tags.scm files](https://github.com/Aider-AI/aider/tree/main/aider/queries)
from these
open source tree-sitter language implementations:

View File

@@ -23,14 +23,14 @@ making it the best available model for pair programming with AI.
To use Claude 3 Opus with aider:
```
python -m pip install aider-chat
python -m pip install -U aider-chat
export ANTHROPIC_API_KEY=sk-...
aider --opus
```
## Aider's code editing benchmark
[Aider](https://github.com/paul-gauthier/aider)
[Aider](https://github.com/Aider-AI/aider)
is an open source command line chat tool that lets you
pair program with AI on code in your local git repo.

View File

@@ -52,7 +52,7 @@ def some_complex_method(foo, bar):
# ... implement method here ...
```
Aider uses a ["laziness" benchmark suite](https://github.com/paul-gauthier/refactor-benchmark)
Aider uses a ["laziness" benchmark suite](https://github.com/Aider-AI/refactor-benchmark)
which is designed to both provoke and quantify lazy coding.
It consists of
89 python refactoring tasks

View File

@@ -46,7 +46,7 @@ It also supports [connecting to almost any LLM](https://aider.chat/docs/llms.htm
Use the `--browser` switch to launch the browser version of aider:
```
python -m pip install aider-chat
python -m pip install -U aider-chat
export OPENAI_API_KEY=<key> # Mac/Linux
setx OPENAI_API_KEY <key> # Windows, restart shell after setx

View File

@@ -15,7 +15,7 @@ nav_exclude: true
I recently wanted to draw a graph showing how LLM code editing skill has been
changing over time as new models have been released by OpenAI, Anthropic and others.
I have all the
[data in a yaml file](https://github.com/paul-gauthier/aider/blob/main/website/_data/edit_leaderboard.yml) that is used to render
[data in a yaml file](https://github.com/Aider-AI/aider/blob/main/website/_data/edit_leaderboard.yml) that is used to render
[aider's LLM leaderboards](https://aider.chat/docs/leaderboards/).
Below is the aider chat transcript, which shows:

View File

@@ -25,7 +25,7 @@ This increases the ability of the LLM to understand the problem and
make the correct changes to resolve it.
Aider ships with basic linters built with tree-sitter that support
[most popular programming languages](https://github.com/paul-gauthier/grep-ast/blob/main/grep_ast/parsers.py).
[most popular programming languages](https://github.com/Aider-AI/grep-ast/blob/main/grep_ast/parsers.py).
These built in linters will detect syntax errors and other fatal problems with the code.
You can also configure aider to use your preferred linters.

View File

@@ -76,7 +76,7 @@ The held out "acceptance tests" were *only* used
after benchmarking to compute statistics on which problems aider
correctly resolved.
The [full harness to run aider on SWE Bench Lite is available on GitHub](https://github.com/paul-gauthier/aider-swe-bench).
The [full harness to run aider on SWE Bench Lite is available on GitHub](https://github.com/Aider-AI/aider-swe-bench).
The benchmarking process was similar to how a developer might use aider to
resolve a GitHub issue:

View File

@@ -13,7 +13,7 @@ nav_exclude: true
[![self assembly](/assets/self-assembly.jpg)](https://aider.chat/assets/self-assembly.jpg)
The
[aider git repo](https://github.com/paul-gauthier/aider)
[aider git repo](https://github.com/Aider-AI/aider)
currently contains about 4K commits and 14K lines of code.
Aider made 15% of the commits, inserting 4.8K and deleting 1.5K lines of code.

View File

@@ -64,7 +64,7 @@ with the problem statement
submitted as the opening chat message from "the user".
- After that aider ran as normal, except all of aider's
suggestions were always accepted without user approval.
- A [simple harness](https://github.com/paul-gauthier/aider-swe-bench#the-aider-agent) was used to retry the SWE Bench problem if aider produced code that wasn't *plausibly correct*.
- A [simple harness](https://github.com/Aider-AI/aider-swe-bench#the-aider-agent) was used to retry the SWE Bench problem if aider produced code that wasn't *plausibly correct*.
Plausibly correct means that aider reported that it had successfully edited the repo
without causing syntax errors or breaking any *pre-existing* tests.
- If the solution from aider with GPT-4o wasn't plausible, the harness launched aider to try again from scratch using Claude 3 Opus.
@@ -90,7 +90,7 @@ For a detailed discussion of the benchmark
methodology, see the
[article about aider's SWE Bench Lite results](https://aider.chat/2024/05/22/swe-bench-lite.html).
Also, the
[aider SWE Bench repository on GitHub](https://github.com/paul-gauthier/aider-swe-bench)
[aider SWE Bench repository on GitHub](https://github.com/Aider-AI/aider-swe-bench)
contains the harness and statistics code used for the benchmarks.
The benchmarking process was similar to how a developer might use aider to

View File

@@ -37,8 +37,8 @@ Users who tested Sonnet with a preview of
[aider's latest release](https://aider.chat/HISTORY.html#aider-v0410)
were thrilled:
- *Works like a charm. It is a monster. It refactors files of any size like it is nothing. The continue trick with Sonnet is truly the holy grail. Aider beats [other tools] hands down. I'm going to cancel both subscriptions.* -- [Emasoft](https://github.com/paul-gauthier/aider/issues/705#issuecomment-2200338971)
- *Thanks heaps for this feature - it's a real game changer. I can be more ambitious when asking Claude for larger features.* -- [cngarrison](https://github.com/paul-gauthier/aider/issues/705#issuecomment-2196026656)
- *Works like a charm. It is a monster. It refactors files of any size like it is nothing. The continue trick with Sonnet is truly the holy grail. Aider beats [other tools] hands down. I'm going to cancel both subscriptions.* -- [Emasoft](https://github.com/Aider-AI/aider/issues/705#issuecomment-2200338971)
- *Thanks heaps for this feature - it's a real game changer. I can be more ambitious when asking Claude for larger features.* -- [cngarrison](https://github.com/Aider-AI/aider/issues/705#issuecomment-2196026656)
- *Fantastic...! It's such an improvement not being constrained by output token length issues. [I refactored] a single JavaScript file into seven smaller files using a single Aider request.* -- [John Galt](https://discord.com/channels/1131200896827654144/1253492379336441907/1256250487934554143)
## Hitting the 4k token output limit
@@ -116,7 +116,7 @@ for more details, but
you can get started quickly with aider and Sonnet like this:
```
$ python -m pip install aider-chat
$ python -m pip install -U aider-chat
$ export ANTHROPIC_API_KEY=<key> # Mac/Linux
$ setx ANTHROPIC_API_KEY <key> # Windows, restart shell after setx

View File

@@ -30,7 +30,7 @@ included for scale.
You can code with all of these models using aider like this:
```
$ python -m pip install aider-chat
$ python -m pip install -U aider-chat
# Change directory into a git repo to work on
$ cd /to/your/git/repo

View File

@@ -0,0 +1,116 @@
---
title: o1-preview is SOTA on the aider leaderboard
excerpt: Preliminary benchmark results for the new OpenAI o1 models.
nav_exclude: true
---
{% if page.date %}
<p class="post-date">{{ page.date | date: "%B %d, %Y" }}</p>
{% endif %}
# OpenAI o1-preview is SOTA on the aider leaderboard
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
{% assign edit_sorted = site.data.o1_results | sort: 'pass_rate_2' | reverse %}
{% include leaderboard_graph.html
chart_id="editChart"
data=edit_sorted
row_prefix="edit-row"
pass_rate_key="pass_rate_2"
%}
## 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.
## 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 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
OpenAI's new o1 models are supported in v0.57.0 of aider:
```
aider --model o1-mini
aider --model o1-preview
```
{: .note }
> 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.
<table style="width: 100%; max-width: 800px; margin: auto; border-collapse: collapse; box-shadow: 0 2px 4px rgba(0,0,0,0.1); font-size: 14px;">
<thead style="background-color: #f2f2f2;">
<tr>
<th style="padding: 8px; text-align: left;">Model</th>
<th style="padding: 8px; text-align: center;">Percent completed correctly</th>
<th style="padding: 8px; text-align: center;">Percent using correct edit format</th>
<th style="padding: 8px; text-align: left;">Command</th>
<th style="padding: 8px; text-align: center;">Edit format</th>
</tr>
</thead>
<tbody>
{% for row in edit_sorted %}
<tr style="border-bottom: 1px solid #ddd;">
<td style="padding: 8px;">{{ row.model }}</td>
<td style="padding: 8px; text-align: center;">{{ row.pass_rate_2 }}%</td>
<td style="padding: 8px; text-align: center;">{{ row.percent_cases_well_formed }}%</td>
<td style="padding: 8px;"><code>{{ row.command }}</code></td>
<td style="padding: 8px; text-align: center;">{{ row.edit_format }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<style>
tr.selected {
color: #0056b3;
}
table {
table-layout: fixed;
}
td, th {
word-wrap: break-word;
overflow-wrap: break-word;
}
td:nth-child(3), td:nth-child(4) {
font-size: 12px;
}
</style>

View File

@@ -0,0 +1,418 @@
---
title: Separating code reasoning and editing
excerpt: An Architect model describes how to solve the coding problem, and an Editor model translates that into file edits. This Architect/Editor approach produces SOTA benchmark results.
highlight_image: /assets/architect.jpg
draft: false
nav_exclude: true
---
{% if page.date %}
<p class="post-date">{{ page.date | date: "%B %d, %Y" }}</p>
{% endif %}
# Separating code reasoning and editing
Aider now has experimental support for using two models to complete each coding task:
- An Architect model is asked to describe how to solve the coding problem.
- An Editor model is given the Architect's solution and asked to produce specific code editing instructions to apply those changes to existing source files.
Splitting up "code reasoning" and "code editing" in this manner
has produced SOTA results on
[aider's code editing benchmark](/docs/benchmarks.html#the-benchmark).
Using o1-preview as the Architect with either DeepSeek or o1-mini as the
Editor produced the SOTA score of 85%.
Using the Architect/Editor approach
also significantly improved the benchmark scores of many
models, compared to their previous "solo" baseline scores (striped bars).
<style>
.shaded td {
background-color: #f2f2f2;
border-top: 1px solid #ccc;
}
.table-container {
max-width: 100%;
overflow-x: auto;
}
.responsive-table {
border-collapse: separate;
border-spacing: 0;
width: 100%;
font-size: 16px;
border: 1px solid #ddd;
}
.responsive-table th, .responsive-table td {
padding: 8px;
text-align: left;
border-bottom: 1px solid #ddd;
word-break: break-word;
}
.responsive-table th {
background-color: #e2e2e2;
}
.responsive-table th:first-child,
.responsive-table td:first-child {
border-left: 1px solid #ddd;
}
.responsive-table th:last-child,
.responsive-table td:last-child {
border-right: 1px solid #ddd;
}
@media screen and (max-width: 600px) {
.responsive-table {
font-size: 12px;
}
.responsive-table th, .responsive-table td {
padding: 4px;
}
}
</style>
<style>
#passRateChart {
max-width: 100%;
height: auto !important;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-annotation@1.0.2"></script>
{% assign sorted_data = site.data.architect | sort: "pass_rate_2" | reverse %}
<canvas id="passRateChart" width="400" height="250"></canvas>
<script>
document.addEventListener("DOMContentLoaded", function() {
var ctx = document.getElementById('passRateChart').getContext('2d');
// Function to determine aspect ratio and base font size based on screen width
function getChartSettings() {
if (window.innerWidth < 600) {
return { aspectRatio: 1, baseFontSize: 8 }; // Slightly taller for small screens
} else if (window.innerWidth < 800) {
return { aspectRatio: 1.2, baseFontSize: 10 }; // Slightly taller for small screens
} else {
return { aspectRatio: 1.4, baseFontSize: 12 }; // Slightly taller for larger screens
}
}
var chartSettings = getChartSettings();
var baseFontSize = chartSettings.baseFontSize;
var labels = [];
var data = [];
var colorMapping = {
"claude-3.5-sonnet": "rgba(75, 192, 192, 0.2)",
"gpt-4o": "rgba(255, 99, 132, 0.2)",
"o1-preview": "rgba(54, 162, 235, 0.2)",
"o1-mini": "rgba(255, 206, 86, 0.2)",
"gpt-4o-mini": "rgba(153, 102, 255, 0.2)"
};
var borderColorMapping = {
"claude-3.5-sonnet": "rgba(75, 192, 192, 1)",
"gpt-4o": "rgba(255, 99, 132, 1)",
"o1-preview": "rgba(54, 162, 235, 1)",
"o1-mini": "rgba(255, 206, 86, 1)",
"gpt-4o-mini": "rgba(153, 102, 255, 1)"
};
var backgroundColors = [];
var borderColors = [];
var patterns = {};
for (var key in colorMapping) {
patterns[key] = ctx.createPattern(createStripePattern(colorMapping[key]), 'repeat');
}
{% assign grouped_data = sorted_data | group_by: "model" %}
{% for group in grouped_data %}
{% for item in group.items %}
if ("{{ item.editor_model }}" == "") {
labels.push("Baseline");
} else {
labels.push("{{ item.editor_model }}/{{ item.editor_edit_format | default: item.edit_format }}");
}
data.push({{ item.pass_rate_2 }});
if ("{{ item.editor_model }}" == "") {
backgroundColors.push(patterns["{{ item.model }}"]);
} else {
backgroundColors.push(colorMapping["{{ item.model }}"]);
}
borderColors.push(borderColorMapping["{{ item.model }}"]);
{% endfor %}
{% endfor %}
labels.reverse();
data.reverse();
backgroundColors.reverse();
borderColors.reverse();
var chart = new Chart(ctx, {
type: 'bar',
data: {
labels: labels,
datasets: [{
label: 'Pass Rate',
data: data,
backgroundColor: backgroundColors,
borderColor: borderColors,
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: true,
aspectRatio: chartSettings.aspectRatio,
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Pass Rate (%)',
font: {
size: baseFontSize + 6
}
},
ticks: {
font: {
size: baseFontSize
}
}
},
x: {
title: {
display: true,
text: 'Editor model and edit format',
font: {
size: baseFontSize + 6
}
},
ticks: {
font: {
size: baseFontSize + 4
},
maxRotation: 90, // Allow full rotation if needed
minRotation: 45 // Start rotating at 45 degrees to fit more labels
}
}
},
plugins: {
annotation: {
annotations: {
line1: {
type: 'line',
yMin: 79.7,
yMax: 79.7,
borderColor: 'rgba(255, 99, 132, 0.8)',
borderWidth: 2,
borderDash: [6, 6],
label: {
content: 'Previous SOTA',
enabled: true,
position: 'start',
xAdjust: 10,
font: {
size: baseFontSize
}
}
}
}
},
legend: {
display: true,
title: {
display: true,
text: 'Architect model',
font: {
size: baseFontSize + 2,
weight: 'bold'
}
},
labels: {
font: {
size: baseFontSize + 4
},
generateLabels: function(chart) {
var colorMapping = {
"o1-preview": "rgba(54, 162, 235, 0.2)",
"claude-3.5-sonnet": "rgba(75, 192, 192, 0.2)",
"gpt-4o": "rgba(255, 99, 132, 0.2)",
"o1-mini": "rgba(255, 206, 86, 0.2)",
"gpt-4o-mini": "rgba(153, 102, 255, 0.2)"
};
return Object.keys(colorMapping).reverse().map(function(key) {
return {
text: key,
fillStyle: colorMapping[key],
strokeStyle: colorMapping[key].replace('0.2', '1'),
lineWidth: 1
};
});
}
}
}
}
}
});
// Update aspect ratio and font sizes on window resize
window.addEventListener('resize', function() {
var newSettings = getChartSettings();
chart.options.aspectRatio = newSettings.aspectRatio;
baseFontSize = newSettings.baseFontSize;
// Update font sizes
chart.options.scales.y.title.font.size = baseFontSize + 6;
chart.options.scales.y.ticks.font.size = baseFontSize;
chart.options.scales.x.title.font.size = baseFontSize + 6;
chart.options.scales.x.ticks.font.size = baseFontSize + 4;
chart.options.plugins.annotation.annotations.line1.label.font.size = baseFontSize;
chart.options.plugins.legend.title.font.size = baseFontSize + 4;
chart.options.plugins.legend.labels.font.size = baseFontSize + 4;
chart.update();
});
});
function createStripePattern(baseColor) {
var canvas = document.createElement('canvas');
canvas.width = 10;
canvas.height = 10;
var ctx = canvas.getContext('2d');
ctx.fillStyle = baseColor;
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.strokeStyle = 'rgba(0, 0, 0, 0.1)';
ctx.lineWidth = 2;
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(10, 10);
ctx.stroke();
return canvas;
}
</script>
## Motivation
This approach was motivated by the release of OpenAI's o1 models.
They are strong at reasoning, but often fail to output properly formatted
code editing instructions.
It helps to instead let them describe the solution
however they prefer and then pass that output to a more traditional LLM.
This second Editor LLM can then interpret the solution description and
produce the code editing instructions needed to update
the existing source code.
This approach has recently become attractive for aider due to
rapid improvements in the speed and costs of frontier models.
In particular, chaining older LLMs would have been quite slow and
incompatible with aider's goal of providing an interactive,
pair programming AI coding experience.
## Code reasoning and code editing
Normally aider asks the model to solve a coding problem in one prompt,
asking the LLM to explain the solution and return
a well formatted series of file edits.
All of [aider's editing formats](/docs/more/edit-formats.html)
require the LLM to return source code edits in a specific text
format, so that aider can process the edits and apply them to the local source files.
Because this all happens in a single prompt/response round trip to the LLM,
the model has to split its attention between
solving the coding problem and conforming to the edit format.
The Architect/Editor approach splits this into two inference steps, possibly
using two different LLMs:
1. Solve the coding problem (Architect).
2. Turn the proposed solution into a series of well formed code edits (Editor).
The Architect/Editor approach allows the Architect to focus on solving the coding problem
and *describe the solution however comes naturally to it*.
Similarly, the Editor can focus all of its attention on properly formatting the edits
without needing to reason much about how to solve the coding problem.
We can assign the Architect and Editor roles to LLMs which are well suited to their needs.
Strong reasoning model like o1-preview make excellent Architects, while
the Editor role can be assigned to an appropriate model based on cost, speed
and code editing skill.
## Results
The graph above and the table below show the
[aider's code editing benchmark](/docs/benchmarks.html#the-benchmark)
score for various combinations of Architect and Editor models.
Some noteworthy observations:
- Pairing o1-preview as Architect with either Deepseek or o1-mini as Editor sets a SOTA significantly above the previous best score. This result is obtained with the "whole" editing format, requiring the Editor to output a full update copy of each edited source file. Both of these steps are therefore quite slow, so probably not practical for interactive use with aider.
- Pairing OpenAI's o1-preview with Anthropic's Sonnet as the Editor produces the second best result. This is an entirely practical configuration for users able to work with both providers.
- Pairing many models with themselves in the Architect/Editor configuration can provide
significant benefits.
Sonnet, GPT-4o and GPT-4o-mini all scored higher when used as an Architect/Editor pair.
- Deepseek is surprisingly effective as an Editor model. It seems remarkably capable at turning proposed coding solutions into new, updated versions of the source files. Using the efficient "diff" editing format, Deepseek helps all the Architect models except for Sonnet.
## Try it!
The development version of aider
has built in defaults to support Architect/Editor coding with
o1-preview, o1-mini, GPT-4o and Claude 3.5 Sonnet.
Run aider with `--architect` or get started quickly like this:
```
pip install -U aider-chat
# Change directory into a git repo
cd /to/your/git/repo
# Work with Claude 3.5 Sonnet as the Architect and Editor
export ANTHROPIC_API_KEY=your-key-goes-here
aider --sonnet --architect
# Work with OpenAI models, using gpt-4o as the Editor
export OPENAI_API_KEY=your-key-goes-here
aider --4o --architect
aider --o1-mini --architect
aider --o1-preview --architect
```
## More info
Aider has a number of "chat modes", and "architect" is available as a new chat mode.
The `--architect` switch is a shortcut for `--chat-mode architect`.
For more details, see documentation on
[aider's chat modes](/docs/usage/modes.html).
## Full results
Below are the benchmark results using various models as the Architect, paired with
various models as the Editor.
Each section includes a "baseline" result,
where the model works
by itself in aider's normal "code" editing mode
(not as part of an Architect/Editor configuration).
This "solo" baseline represents the performance previously available when using
this model with aider.
<div class="table-container">
<table class="responsive-table">
<thead>
<tr>
<th>Architect</th>
<th>Editor</th>
<th>Edit Format</th>
<th>Pass Rate</th>
</tr>
</thead>
<tbody>
{% for group in grouped_data %}
{% assign group_class = forloop.index | modulo: 2 | plus: 1 %}
{% for item in group.items %}
<tr class="{% if group_class == 1 %}shaded{% endif %}">
<td>{{ item.model }}</td>
<td>{% if item.editor_model %}{{ item.editor_model }}{% else %}<b>Baseline</b>{% endif %}</td>
<td style="text-align: center;">{{ item.editor_edit_format | default: item.edit_format }}</td>
<td style="text-align: right;">{{ item.pass_rate_2 }}%</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 KiB

View File

@@ -12,19 +12,19 @@
# options:
## show this help message and exit
#help:
#help: xxx
#######
# Main:
## Specify the OpenAI API key
#openai-api-key:
#openai-api-key: xxx
## Specify the Anthropic API key
#anthropic-api-key:
#anthropic-api-key: xxx
## Specify the model to use for the main chat
#model:
#model: xxx
## Use claude-3-opus-20240229 model for the main chat
#opus: false
@@ -50,26 +50,32 @@
## Use deepseek/deepseek-coder model for the main chat
#deepseek: false
## Use o1-mini model for the main chat
#o1-mini: false
## Use o1-preview model for the main chat
#o1-preview: false
#################
# Model Settings:
## List known models which match the (partial) MODEL name
#models:
#list-models: xxx
## Specify the api base url
#openai-api-base:
#openai-api-base: xxx
## Specify the api_type
#openai-api-type:
#openai-api-type: xxx
## Specify the api_version
#openai-api-version:
#openai-api-version: xxx
## Specify the deployment_id
#openai-api-deployment-id:
#openai-api-deployment-id: xxx
## Specify the OpenAI organization ID
#openai-organization-id:
#openai-organization-id: xxx
## Specify a file with aider model settings for unknown models
#model-settings-file: .aider.model.settings.yml
@@ -81,19 +87,31 @@
#verify-ssl: true
## Specify what edit format the LLM should use (default depends on model)
#edit-format:
#edit-format: xxx
## Use architect edit format for the main chat
#architect: false
## Specify the model to use for commit messages and chat history summarization (default depends on --model)
#weak-model:
#weak-model: xxx
## Specify the model to use for editor tasks (default depends on --model)
#editor-model: xxx
## Specify the edit format for the editor model (default: depends on editor model)
#editor-edit-format: xxx
## 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:
## 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 (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 +119,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:
## Specify the .env file to load (default: .env in git root)
#env-file: .env
################
# History Files:
@@ -123,7 +144,7 @@
#restore-chat-history: false
## Log the conversation with the LLM to this file (for example, .aider.llm.history)
#llm-history-file:
#llm-history-file: xxx
##################
# Output Settings:
@@ -144,14 +165,29 @@
#user-input-color: #00cc00
## Set the color for tool output (default: None)
#tool-output-color:
#tool-output-color: xxx
## Set the color for tool error messages (default: red)
## Set the color for tool error messages (default: #FF2222)
#tool-error-color: #FF2222
## Set the color for tool warning messages (default: #FFA500)
#tool-warning-color: #FFA500
## Set the color for assistant output (default: #0088ff)
#assistant-output-color: #0088ff
## Set the color for the completion menu (default: terminal's default text color)
#completion-menu-color: xxx
## Set the background color for the completion menu (default: terminal's default background color)
#completion-menu-bg-color: xxx
## Set the color for the current item in the completion menu (default: terminal's default background color)
#completion-menu-current-color: xxx
## Set the background color for the current item in the completion menu (default: terminal's default text color)
#completion-menu-current-bg-color: xxx
## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light)
#code-theme: default
@@ -195,11 +231,14 @@
#commit: false
## Specify a custom prompt for generating commit messages
#commit-prompt:
#commit-prompt: xxx
## Perform a dry run without modifying files (default: False)
#dry-run: false
## Skip the sanity check for the git repository (default: False)
#skip-sanity-check-repo: false
########################
# Fixing and committing:
@@ -207,13 +246,18 @@
#lint: false
## Specify lint commands to run for different languages, eg: "python: flake8 --select=..." (can be used multiple times)
#lint-cmd: xxx
## Specify multiple values like this:
#lint-cmd:
# - xxx
# - yyy
# - zzz
## Enable/disable automatic linting after changes (default: True)
#auto-lint: true
## Specify command to run tests
#test-cmd:
#test-cmd: xxx
## Enable/disable automatic testing after changes (default: False)
#auto-test: false
@@ -225,19 +269,29 @@
# Other Settings:
## specify a file to edit (can be used multiple times)
#file: xxx
## Specify multiple values like this:
#file:
# - xxx
# - yyy
# - zzz
## specify a read-only file (can be used multiple times)
#read: xxx
## Specify multiple values like this:
#read:
# - xxx
# - yyy
# - zzz
## Use VI editing mode in the terminal (default: False)
#vim: false
## 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
## Show the version number and exit
#version:
#version: xxx
## Check for updates and return status in the exit code
#just-check-update: false
@@ -252,10 +306,10 @@
#upgrade: false
## Apply the changes from the given file instead of running the chat (debug)
#apply:
#apply: xxx
## Always say yes to every confirmation
#yes: false
#yes-always: false
## Enable verbose output
#verbose: false
@@ -270,19 +324,28 @@
#exit: false
## Specify a single message to send the LLM, process reply then exit (disables chat mode)
#message:
#message: xxx
## Specify a file containing the message to send the LLM, process reply, then exit (disables chat mode)
#message-file:
#message-file: xxx
## Specify the encoding for input and output (default: utf-8)
#encoding: utf-8
## Specify the config file (default: search for .aider.conf.yml in git root, cwd or home directory)
#config:
#config: xxx
## Run aider in your browser
#gui: false
## 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

View File

@@ -54,11 +54,17 @@
## Use deepseek/deepseek-coder model for the main chat
#AIDER_DEEPSEEK=
## Use o1-mini model for the main chat
#AIDER_O1_MINI=
## Use o1-preview model for the main chat
#AIDER_O1_PREVIEW=
#################
# Model Settings:
## List known models which match the (partial) MODEL name
#AIDER_MODELS=
#AIDER_LIST_MODELS=
## Specify the api base url
#OPENAI_API_BASE=
@@ -87,17 +93,29 @@
## Specify what edit format the LLM should use (default depends on model)
#AIDER_EDIT_FORMAT=
## Use architect edit format for the main chat
#AIDER_ARCHITECT=
## Specify the model to use for commit messages and chat history summarization (default depends on --model)
#AIDER_WEAK_MODEL=
## Specify the model to use for editor tasks (default depends on --model)
#AIDER_EDITOR_MODEL=
## Specify the edit format for the editor model (default: depends on editor model)
#AIDER_EDITOR_EDIT_FORMAT=
## 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 (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 +123,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:
@@ -150,12 +171,27 @@
## Set the color for tool output (default: None)
#AIDER_TOOL_OUTPUT_COLOR=
## Set the color for tool error messages (default: red)
## Set the color for tool error messages (default: #FF2222)
#AIDER_TOOL_ERROR_COLOR=#FF2222
## Set the color for tool warning messages (default: #FFA500)
#AIDER_TOOL_WARNING_COLOR=#FFA500
## Set the color for assistant output (default: #0088ff)
#AIDER_ASSISTANT_OUTPUT_COLOR=#0088ff
## Set the color for the completion menu (default: terminal's default text color)
#AIDER_COMPLETION_MENU_COLOR=
## Set the background color for the completion menu (default: terminal's default background color)
#AIDER_COMPLETION_MENU_BG_COLOR=
## Set the color for the current item in the completion menu (default: terminal's default background color)
#AIDER_COMPLETION_MENU_CURRENT_COLOR=
## Set the background color for the current item in the completion menu (default: terminal's default text color)
#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR=
## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light)
#AIDER_CODE_THEME=default
@@ -204,6 +240,9 @@
## Perform a dry run without modifying files (default: False)
#AIDER_DRY_RUN=false
## Skip the sanity check for the git repository (default: False)
#AIDER_SKIP_SANITY_CHECK_REPO=false
########################
# Fixing and committing:
@@ -237,8 +276,8 @@
## Use VI editing mode in the terminal (default: False)
#AIDER_VIM=false
## 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=
## Check for updates and return status in the exit code
#AIDER_JUST_CHECK_UPDATE=false
@@ -256,7 +295,7 @@
#AIDER_APPLY=
## Always say yes to every confirmation
#AIDER_YES=
#AIDER_YES_ALWAYS=
## Enable verbose output
#AIDER_VERBOSE=false
@@ -284,3 +323,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

View File

@@ -19,7 +19,7 @@ and there's a lot
of interest about their ability to code compared to the previous versions.
With that in mind, I've been benchmarking the new models.
[Aider](https://github.com/paul-gauthier/aider)
[Aider](https://github.com/Aider-AI/aider)
is an open source command line chat tool that lets you work with GPT to edit
code in your local git repo.
To do this, aider needs to be able to reliably recognize when GPT wants to edit

View File

@@ -20,7 +20,7 @@ and there's a lot
of interest about their capabilities and performance.
With that in mind, I've been benchmarking the new models.
[Aider](https://github.com/paul-gauthier/aider)
[Aider](https://github.com/Aider-AI/aider)
is an open source command line chat tool that lets you work with GPT to edit
code in your local git repo.
Aider relies on a

View File

@@ -55,7 +55,7 @@ about prompting GPT for complex tasks like coding. It's beneficial to
minimize the "cognitive overhead" of formatting the response, allowing
GPT to concentrate on the coding task at hand.
As a thought experiment, imagine a slack conversation with a junior developer where
As a thought experiment, imagine a slack conversation with a editor developer where
you ask them to write the code to add some new feature to your app.
They're going to type the response back to you by hand in the chat.
Should they type out the
@@ -168,7 +168,7 @@ requests:
### whole
The
[whole](https://github.com/paul-gauthier/aider/blob/main/aider/coders/wholefile_prompts.py)
[whole](https://github.com/Aider-AI/aider/blob/main/aider/coders/wholefile_prompts.py)
format asks GPT to return an updated copy of the entire file, including any changes.
The file should be
formatted with normal markdown triple-backtick fences, inlined with the rest of its response text.
@@ -187,7 +187,7 @@ def main():
### diff
The [diff](https://github.com/paul-gauthier/aider/blob/main/aider/coders/editblock_prompts.py)
The [diff](https://github.com/Aider-AI/aider/blob/main/aider/coders/editblock_prompts.py)
format also asks GPT to return edits as part of the normal response text,
in a simple diff format.
Each edit is a fenced code block that
@@ -209,7 +209,7 @@ demo.py
### whole-func
The [whole-func](https://github.com/paul-gauthier/aider/blob/main/aider/coders/wholefile_func_coder.py)
The [whole-func](https://github.com/Aider-AI/aider/blob/main/aider/coders/wholefile_func_coder.py)
format requests updated copies of whole files to be returned using the function call API.
@@ -227,7 +227,7 @@ format requests updated copies of whole files to be returned using the function
### diff-func
The
[diff-func](https://github.com/paul-gauthier/aider/blob/main/aider/coders/editblock_func_coder.py)
[diff-func](https://github.com/Aider-AI/aider/blob/main/aider/coders/editblock_func_coder.py)
format requests a list of
original/updated style edits to be returned using the function call API.

View File

@@ -66,26 +66,957 @@ 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
You can also look at the `ModelSettings` class in
[models.py](https://github.com/Aider-AI/aider/blob/main/aider/models.py)
file for more details about all of the model setting that aider supports.
<!--[[[cog
from aider.models import get_model_settings_as_yaml
cog.out("```yaml\n")
cog.out(get_model_settings_as_yaml())
cog.out("```\n")
]]]-->
```yaml
- accepts_images: false
cache_control: false
caches_by_default: false
edit_format: whole
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
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
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: true
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: true
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
editor_edit_format: editor-diff
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: true
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: true
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: true
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
editor_edit_format: editor-diff
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: true
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: true
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: true
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: true
extra_params: null
lazy: true
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: true
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: true
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: editor-diff
editor_model_name: claude-3-5-sonnet-20240620
examples_as_sys_msg: true
extra_params:
extra_headers:
anthropic-beta: prompt-caching-2024-07-31
max_tokens: 8192
lazy: false
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
editor_edit_format: editor-diff
editor_model_name: anthropic/claude-3-5-sonnet-20240620
examples_as_sys_msg: true
extra_params:
extra_headers:
anthropic-beta: prompt-caching-2024-07-31
max_tokens: 8192
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: true
extra_params:
extra_headers:
anthropic-beta: prompt-caching-2024-07-31
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: true
extra_params:
extra_headers:
anthropic-beta: prompt-caching-2024-07-31
lazy: false
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
editor_edit_format: editor-diff
editor_model_name: openrouter/anthropic/claude-3.5-sonnet
examples_as_sys_msg: true
extra_params:
max_tokens: 8192
lazy: false
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: true
caches_by_default: false
edit_format: diff
editor_edit_format: editor-diff
editor_model_name: openrouter/anthropic/claude-3.5-sonnet:beta
examples_as_sys_msg: true
extra_params:
max_tokens: 8192
lazy: false
name: openrouter/anthropic/claude-3.5-sonnet:beta
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
editor_edit_format: editor-diff
editor_model_name: vertex_ai/claude-3-5-sonnet@20240620
examples_as_sys_msg: true
extra_params:
max_tokens: 8192
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: true
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: true
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
name: gemini/gemini-1.5-pro-002
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
name: gemini/gemini-1.5-flash-002
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-fenced
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: true
extra_params:
max_tokens: 8192
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: true
extra_params:
max_tokens: 8192
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: true
extra_params:
max_tokens: 8192
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: true
extra_params:
max_tokens: 8192
lazy: false
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
editor_edit_format: null
editor_model_name: null
examples_as_sys_msg: true
extra_params: null
lazy: false
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
editor_edit_format: editor-diff
editor_model_name: null
examples_as_sys_msg: false
extra_params: null
lazy: true
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
editor_edit_format: editor-diff
editor_model_name: openai/gpt-4o
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: editor-diff
editor_model_name: gpt-4o
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: editor-diff
editor_model_name: openai/gpt-4o
examples_as_sys_msg: false
extra_params: null
lazy: false
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: architect
editor_edit_format: editor-diff
editor_model_name: gpt-4o
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: editor-diff
editor_model_name: openrouter/openai/gpt-4o
examples_as_sys_msg: false
extra_params: null
lazy: false
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
editor_edit_format: editor-diff
editor_model_name: openrouter/openai/gpt-4o
examples_as_sys_msg: false
extra_params: null
lazy: false
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
```
<!--[[[end]]]-->

View File

@@ -23,8 +23,16 @@ load whichever is found first.
## A note on lists
The syntax for specifying a list of values is not standard yaml.
Instead, use this format:
Lists of values can be specified either as a bulleted list:
```
read:
- CONVENTIONS.md
- anotherfile.txt
- thirdfile.py
```
Or lists can be specified using commas and square brackets:
```
read: [CONVENTIONS.md, anotherfile.txt, thirdfile.py]
@@ -34,7 +42,7 @@ read: [CONVENTIONS.md, anotherfile.txt, thirdfile.py]
Below is a sample of the YAML config file, which you
can also
[download from GitHub](https://github.com/paul-gauthier/aider/blob/main/aider/website/assets/sample.aider.conf.yml).
[download from GitHub](https://github.com/Aider-AI/aider/blob/main/aider/website/assets/sample.aider.conf.yml).
<!--[[[cog
from aider.args import get_sample_yaml
@@ -60,19 +68,19 @@ cog.outl("```")
# options:
## show this help message and exit
#help:
#help: xxx
#######
# Main:
## Specify the OpenAI API key
#openai-api-key:
#openai-api-key: xxx
## Specify the Anthropic API key
#anthropic-api-key:
#anthropic-api-key: xxx
## Specify the model to use for the main chat
#model:
#model: xxx
## Use claude-3-opus-20240229 model for the main chat
#opus: false
@@ -98,26 +106,32 @@ cog.outl("```")
## Use deepseek/deepseek-coder model for the main chat
#deepseek: false
## Use o1-mini model for the main chat
#o1-mini: false
## Use o1-preview model for the main chat
#o1-preview: false
#################
# Model Settings:
## List known models which match the (partial) MODEL name
#models:
#list-models: xxx
## Specify the api base url
#openai-api-base:
#openai-api-base: xxx
## Specify the api_type
#openai-api-type:
#openai-api-type: xxx
## Specify the api_version
#openai-api-version:
#openai-api-version: xxx
## Specify the deployment_id
#openai-api-deployment-id:
#openai-api-deployment-id: xxx
## Specify the OpenAI organization ID
#openai-organization-id:
#openai-organization-id: xxx
## Specify a file with aider model settings for unknown models
#model-settings-file: .aider.model.settings.yml
@@ -129,19 +143,31 @@ cog.outl("```")
#verify-ssl: true
## Specify what edit format the LLM should use (default depends on model)
#edit-format:
#edit-format: xxx
## Use architect edit format for the main chat
#architect: false
## Specify the model to use for commit messages and chat history summarization (default depends on --model)
#weak-model:
#weak-model: xxx
## Specify the model to use for editor tasks (default depends on --model)
#editor-model: xxx
## Specify the edit format for the editor model (default: depends on editor model)
#editor-edit-format: xxx
## 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:
## 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 (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 +175,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:
## Specify the .env file to load (default: .env in git root)
#env-file: .env
################
# History Files:
@@ -171,7 +200,7 @@ cog.outl("```")
#restore-chat-history: false
## Log the conversation with the LLM to this file (for example, .aider.llm.history)
#llm-history-file:
#llm-history-file: xxx
##################
# Output Settings:
@@ -192,14 +221,29 @@ cog.outl("```")
#user-input-color: #00cc00
## Set the color for tool output (default: None)
#tool-output-color:
#tool-output-color: xxx
## Set the color for tool error messages (default: red)
## Set the color for tool error messages (default: #FF2222)
#tool-error-color: #FF2222
## Set the color for tool warning messages (default: #FFA500)
#tool-warning-color: #FFA500
## Set the color for assistant output (default: #0088ff)
#assistant-output-color: #0088ff
## Set the color for the completion menu (default: terminal's default text color)
#completion-menu-color: xxx
## Set the background color for the completion menu (default: terminal's default background color)
#completion-menu-bg-color: xxx
## Set the color for the current item in the completion menu (default: terminal's default background color)
#completion-menu-current-color: xxx
## Set the background color for the current item in the completion menu (default: terminal's default text color)
#completion-menu-current-bg-color: xxx
## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light)
#code-theme: default
@@ -243,11 +287,14 @@ cog.outl("```")
#commit: false
## Specify a custom prompt for generating commit messages
#commit-prompt:
#commit-prompt: xxx
## Perform a dry run without modifying files (default: False)
#dry-run: false
## Skip the sanity check for the git repository (default: False)
#skip-sanity-check-repo: false
########################
# Fixing and committing:
@@ -255,13 +302,18 @@ cog.outl("```")
#lint: false
## Specify lint commands to run for different languages, eg: "python: flake8 --select=..." (can be used multiple times)
#lint-cmd: xxx
## Specify multiple values like this:
#lint-cmd:
# - xxx
# - yyy
# - zzz
## Enable/disable automatic linting after changes (default: True)
#auto-lint: true
## Specify command to run tests
#test-cmd:
#test-cmd: xxx
## Enable/disable automatic testing after changes (default: False)
#auto-test: false
@@ -273,19 +325,29 @@ cog.outl("```")
# Other Settings:
## specify a file to edit (can be used multiple times)
#file: xxx
## Specify multiple values like this:
#file:
# - xxx
# - yyy
# - zzz
## specify a read-only file (can be used multiple times)
#read: xxx
## Specify multiple values like this:
#read:
# - xxx
# - yyy
# - zzz
## Use VI editing mode in the terminal (default: False)
#vim: false
## 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
## Show the version number and exit
#version:
#version: xxx
## Check for updates and return status in the exit code
#just-check-update: false
@@ -300,10 +362,10 @@ cog.outl("```")
#upgrade: false
## Apply the changes from the given file instead of running the chat (debug)
#apply:
#apply: xxx
## Always say yes to every confirmation
#yes: false
#yes-always: false
## Enable verbose output
#verbose: false
@@ -318,21 +380,30 @@ cog.outl("```")
#exit: false
## Specify a single message to send the LLM, process reply then exit (disables chat mode)
#message:
#message: xxx
## Specify a file containing the message to send the LLM, process reply, then exit (disables chat mode)
#message-file:
#message-file: xxx
## Specify the encoding for input and output (default: utf-8)
#encoding: utf-8
## Specify the config file (default: search for .aider.conf.yml in git root, cwd or home directory)
#config:
#config: xxx
## Run aider in your browser
#gui: false
## 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
```
<!--[[[end]]]-->

View File

@@ -28,7 +28,7 @@ If the files above exist, they will be loaded in that order. Files loaded last w
Below is a sample `.env` file, which you
can also
[download from GitHub](https://github.com/paul-gauthier/aider/blob/main/aider/website/assets/sample.env).
[download from GitHub](https://github.com/Aider-AI/aider/blob/main/aider/website/assets/sample.env).
<!--[[[cog
from aider.args import get_sample_dotenv
@@ -96,11 +96,17 @@ cog.outl("```")
## Use deepseek/deepseek-coder model for the main chat
#AIDER_DEEPSEEK=
## Use o1-mini model for the main chat
#AIDER_O1_MINI=
## Use o1-preview model for the main chat
#AIDER_O1_PREVIEW=
#################
# Model Settings:
## List known models which match the (partial) MODEL name
#AIDER_MODELS=
#AIDER_LIST_MODELS=
## Specify the api base url
#OPENAI_API_BASE=
@@ -129,17 +135,29 @@ cog.outl("```")
## Specify what edit format the LLM should use (default depends on model)
#AIDER_EDIT_FORMAT=
## Use architect edit format for the main chat
#AIDER_ARCHITECT=
## Specify the model to use for commit messages and chat history summarization (default depends on --model)
#AIDER_WEAK_MODEL=
## Specify the model to use for editor tasks (default depends on --model)
#AIDER_EDITOR_MODEL=
## Specify the edit format for the editor model (default: depends on editor model)
#AIDER_EDITOR_EDIT_FORMAT=
## 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 (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 +165,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:
@@ -192,12 +213,27 @@ cog.outl("```")
## Set the color for tool output (default: None)
#AIDER_TOOL_OUTPUT_COLOR=
## Set the color for tool error messages (default: red)
## Set the color for tool error messages (default: #FF2222)
#AIDER_TOOL_ERROR_COLOR=#FF2222
## Set the color for tool warning messages (default: #FFA500)
#AIDER_TOOL_WARNING_COLOR=#FFA500
## Set the color for assistant output (default: #0088ff)
#AIDER_ASSISTANT_OUTPUT_COLOR=#0088ff
## Set the color for the completion menu (default: terminal's default text color)
#AIDER_COMPLETION_MENU_COLOR=
## Set the background color for the completion menu (default: terminal's default background color)
#AIDER_COMPLETION_MENU_BG_COLOR=
## Set the color for the current item in the completion menu (default: terminal's default background color)
#AIDER_COMPLETION_MENU_CURRENT_COLOR=
## Set the background color for the current item in the completion menu (default: terminal's default text color)
#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR=
## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light)
#AIDER_CODE_THEME=default
@@ -246,6 +282,9 @@ cog.outl("```")
## Perform a dry run without modifying files (default: False)
#AIDER_DRY_RUN=false
## Skip the sanity check for the git repository (default: False)
#AIDER_SKIP_SANITY_CHECK_REPO=false
########################
# Fixing and committing:
@@ -279,8 +318,8 @@ cog.outl("```")
## Use VI editing mode in the terminal (default: False)
#AIDER_VIM=false
## 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=
## Check for updates and return status in the exit code
#AIDER_JUST_CHECK_UPDATE=false
@@ -298,7 +337,7 @@ cog.outl("```")
#AIDER_APPLY=
## Always say yes to every confirmation
#AIDER_YES=
#AIDER_YES_ALWAYS=
## Enable verbose output
#AIDER_VERBOSE=false
@@ -326,6 +365,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
```
<!--[[[end]]]-->

View File

@@ -27,24 +27,30 @@ cog.out(get_md_help())
```
usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model]
[--opus] [--sonnet] [--4] [--4o] [--mini] [--4-turbo]
[--35turbo] [--deepseek] [--models] [--openai-api-base]
[--openai-api-type] [--openai-api-version]
[--openai-api-deployment-id] [--openai-organization-id]
[--model-settings-file] [--model-metadata-file]
[--35turbo] [--deepseek] [--o1-mini] [--o1-preview]
[--list-models] [--openai-api-base] [--openai-api-type]
[--openai-api-version] [--openai-api-deployment-id]
[--openai-organization-id] [--model-settings-file]
[--model-metadata-file]
[--verify-ssl | --no-verify-ssl] [--edit-format]
[--weak-model]
[--architect] [--weak-model] [--editor-model]
[--editor-edit-format]
[--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]
[--pretty | --no-pretty] [--stream | --no-stream]
[--user-input-color] [--tool-output-color]
[--tool-error-color] [--assistant-output-color]
[--code-theme] [--show-diffs] [--git | --no-git]
[--tool-error-color] [--tool-warning-color]
[--assistant-output-color] [--completion-menu-color]
[--completion-menu-bg-color]
[--completion-menu-current-color]
[--completion-menu-current-bg-color] [--code-theme]
[--show-diffs] [--git | --no-git]
[--gitignore | --no-gitignore] [--aiderignore]
[--subtree-only] [--auto-commits | --no-auto-commits]
[--dirty-commits | --no-dirty-commits]
@@ -53,15 +59,18 @@ usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model]
[--attribute-commit-message-author | --no-attribute-commit-message-author]
[--attribute-commit-message-committer | --no-attribute-commit-message-committer]
[--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]
[--version] [--just-check-update]
[--skip-sanity-check-repo] [--lint] [--lint-cmd]
[--auto-lint | --no-auto-lint] [--test-cmd]
[--auto-test | --no-auto-test] [--test] [--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]
[--install-main-branch] [--upgrade] [--apply]
[--yes-always] [-v] [--show-repo-map] [--show-prompts]
[--exit] [--message] [--message-file] [--encoding] [-c]
[--gui]
[--suggest-shell-commands | --no-suggest-shell-commands]
[--voice-format] [--voice-language]
```
@@ -127,11 +136,22 @@ Aliases:
Use deepseek/deepseek-coder model for the main chat
Environment variable: `AIDER_DEEPSEEK`
### `--o1-mini`
Use o1-mini model for the main chat
Environment variable: `AIDER_O1_MINI`
### `--o1-preview`
Use o1-preview model for the main chat
Environment variable: `AIDER_O1_PREVIEW`
## Model Settings:
### `--models MODEL`
### `--list-models MODEL`
List known models which match the (partial) MODEL name
Environment variable: `AIDER_MODELS`
Environment variable: `AIDER_LIST_MODELS`
Aliases:
- `--list-models MODEL`
- `--models MODEL`
### `--openai-api-base OPENAI_API_BASE`
Specify the api base url
@@ -178,10 +198,22 @@ Aliases:
- `--edit-format EDIT_FORMAT`
- `--chat-mode EDIT_FORMAT`
### `--architect`
Use architect edit format for the main chat
Environment variable: `AIDER_ARCHITECT`
### `--weak-model WEAK_MODEL`
Specify the model to use for commit messages and chat history summarization (default depends on --model)
Environment variable: `AIDER_WEAK_MODEL`
### `--editor-model EDITOR_MODEL`
Specify the model to use for editor tasks (default depends on --model)
Environment variable: `AIDER_EDITOR_MODEL`
### `--editor-edit-format EDITOR_EDIT_FORMAT`
Specify the edit format for the editor model (default: depends on editor model)
Environment variable: `AIDER_EDITOR_EDIT_FORMAT`
### `--show-model-warnings`
Only work with models that have meta-data available (default: True)
Default: True
@@ -190,14 +222,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 (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)
@@ -212,20 +246,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`
@@ -288,15 +324,36 @@ Set the color for tool output (default: None)
Environment variable: `AIDER_TOOL_OUTPUT_COLOR`
### `--tool-error-color VALUE`
Set the color for tool error messages (default: red)
Set the color for tool error messages (default: #FF2222)
Default: #FF2222
Environment variable: `AIDER_TOOL_ERROR_COLOR`
### `--tool-warning-color VALUE`
Set the color for tool warning messages (default: #FFA500)
Default: #FFA500
Environment variable: `AIDER_TOOL_WARNING_COLOR`
### `--assistant-output-color VALUE`
Set the color for assistant output (default: #0088ff)
Default: #0088ff
Environment variable: `AIDER_ASSISTANT_OUTPUT_COLOR`
### `--completion-menu-color COLOR`
Set the color for the completion menu (default: terminal's default text color)
Environment variable: `AIDER_COMPLETION_MENU_COLOR`
### `--completion-menu-bg-color COLOR`
Set the background color for the completion menu (default: terminal's default background color)
Environment variable: `AIDER_COMPLETION_MENU_BG_COLOR`
### `--completion-menu-current-color COLOR`
Set the color for the current item in the completion menu (default: terminal's default background color)
Environment variable: `AIDER_COMPLETION_MENU_CURRENT_COLOR`
### `--completion-menu-current-bg-color COLOR`
Set the background color for the current item in the completion menu (default: terminal's default text color)
Environment variable: `AIDER_COMPLETION_MENU_CURRENT_BG_COLOR`
### `--code-theme VALUE`
Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light)
Default: default
@@ -400,6 +457,11 @@ Aliases:
- `--dry-run`
- `--no-dry-run`
### `--skip-sanity-check-repo`
Skip the sanity check for the git repository (default: False)
Default: False
Environment variable: `AIDER_SKIP_SANITY_CHECK_REPO`
## Fixing and committing:
### `--lint`
@@ -453,10 +515,9 @@ Use VI editing mode in the terminal (default: False)
Default: False
Environment variable: `AIDER_VIM`
### `--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`
### `--version`
Show the version number and exit
@@ -491,9 +552,9 @@ Aliases:
Apply the changes from the given file instead of running the chat (debug)
Environment variable: `AIDER_APPLY`
### `--yes`
### `--yes-always`
Always say yes to every confirmation
Environment variable: `AIDER_YES`
Environment variable: `AIDER_YES_ALWAYS`
### `--verbose`
Enable verbose output
@@ -559,4 +620,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`
<!--[[[end]]]-->

View File

@@ -12,6 +12,7 @@ nav_exclude: true
![robot flowchat](/assets/robot-flowchart.png)
## Updated
Aider no longer uses ctags to build a repo map.
@@ -111,9 +112,9 @@ like functions and methods also include their signatures.
Here's a
sample of the map of the aider repo, just showing the maps of
[main.py](https://github.com/paul-gauthier/aider/blob/main/aider/main.py)
[main.py](https://github.com/Aider-AI/aider/blob/main/aider/main.py)
and
[io.py](https://github.com/paul-gauthier/aider/blob/main/aider/io.py)
[io.py](https://github.com/Aider-AI/aider/blob/main/aider/io.py)
:
```
@@ -228,7 +229,7 @@ Some possible approaches to reducing the amount of map data are:
- Distill the global map, to prioritize important symbols and discard "internal" or otherwise less globally relevant identifiers. Possibly enlist `gpt-3.5-turbo` to perform this distillation in a flexible and language agnostic way.
- Provide a mechanism for GPT to start with a distilled subset of the global map, and let it ask to see more detail about subtrees or keywords that it feels are relevant to the current coding task.
- Attempt to analyize the natural language coding task given by the user and predict which subset of the repo map is relevant. Possibly by analysis of prior coding chats within the specific repo. Work on certain files or types of features may require certain somewhat predictable context from elsewhere in the repo. Vector and keyword search against the chat history, repo map or codebase may help here.
- Attempt to analyze the natural language coding task given by the user and predict which subset of the repo map is relevant. Possibly by analysis of prior coding chats within the specific repo. Work on certain files or types of features may require certain somewhat predictable context from elsewhere in the repo. Vector and keyword search against the chat history, repo map or codebase may help here.
One key goal is to prefer solutions which are language agnostic or
which can be easily deployed against most popular code languages.

View File

@@ -37,7 +37,7 @@ If you still wish to add lots of files to the chat, you can:
- Use a wildcard when you launch aider: `aider src/*.py`
- Use a wildcard with the in-chat `/add` command: `/add src/*.py`
- Give the `/add` command a directory name and it will recurisvely add every file under that dir: `/add src`
- Give the `/add` command a directory name and it will recursively add every file under that dir: `/add src`
## Can I use aider in a large (mono) repo?
@@ -92,6 +92,40 @@ 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 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`.
## How do I include the git history in the context?
When starting a fresh aider session, you can include recent git history in the chat context. This can be useful for providing the LLM with information about recent changes. To do this:
1. Use the `/run` command with `git diff` to show recent changes:
```
/run git diff HEAD~1
```
This will include the diff of the last commit in the chat history.
2. To include diffs from multiple commits, increase the number after the tilde:
```
/run git diff HEAD~3
```
This will show changes from the last three commits.
Remember, the chat history already includes recent changes made during the current session, so this tip is most useful when starting a new aider session and you want to provide context about recent work.
{: .tip }
The `/git` command will not work for this purpose, as its output is not included in the chat.
## How can I run aider locally from source code?
@@ -99,7 +133,7 @@ To run the project locally, follow these steps:
```
# Clone the repository
git clone git@github.com:paul-gauthier/aider.git
git clone git@github.com:Aider-AI/aider.git
# Navigate to the project directory
cd aider
@@ -163,12 +197,18 @@ Yes, you can now share aider chat logs in a pretty way.
1. Copy the markdown logs you want to share from `.aider.chat.history.md` and make a github gist. Or publish the raw markdown logs on the web any way you'd like.
https://gist.github.com/paul-gauthier/2087ab8b64034a078c0a209440ac8be0
```
https://gist.github.com/Aider-AI/2087ab8b64034a078c0a209440ac8be0
```
2. Take the gist URL and append it to:
https://aider.chat/share/?mdurl=
```
https://aider.chat/share/?mdurl=
```
This will give you a URL like this, which shows the chat history like you'd see in a terminal:
https://aider.chat/share/?mdurl=https://gist.github.com/paul-gauthier/2087ab8b64034a078c0a209440ac8be0
```
https://aider.chat/share/?mdurl=https://gist.github.com/Aider-AI/2087ab8b64034a078c0a209440ac8be0
```

View File

@@ -40,7 +40,7 @@ By default, aider creates commit messages which follow
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
You can customize the
[commit prompt](https://github.com/paul-gauthier/aider/blob/main/aider/prompts.py#L5)
[commit prompt](https://github.com/Aider-AI/aider/blob/main/aider/prompts.py#L5)
with the `--commit-prompt` option.
You can place that on the command line, or
[configure it via a config file or environment variables](https://aider.chat/docs/config.html).

View File

@@ -31,7 +31,7 @@ To work with Anthropic's models like Claude 3.5 Sonnet you need a paid
```
# Install aider
python -m pip install aider-chat
python -m pip install -U --upgrade-strategy only-if-needed aider-chat
# To work with GPT-4o:
$ aider --4o --openai-api-key sk-xxx...
@@ -44,7 +44,7 @@ $ aider --sonnet --anthropic-api-key sk-xxx...
```
# Install aider
python -m pip install aider-chat
python -m pip install -U --upgrade-strategy only-if-needed aider-chat
# To work with GPT-4o:
$ aider --4o --openai-api-key sk-xxx...

View File

@@ -74,15 +74,11 @@ joshuavial also confirmed that aider works inside a VS Code terminal window.
Aider detects if it is running inside VSCode and turns off pretty/color output,
since the VSCode terminal doesn't seem to support it well.
[MattFlower](https://github.com/MattFlower) provided a VSCode plugin for aider:
[https://marketplace.visualstudio.com/items?itemName=MattFlower.aider](https://marketplace.visualstudio.com/items?itemName=MattFlower.aider)
### Other editors
If you are interested in creating an aider plugin for your favorite editor,
please let me know by opening a
[GitHub issue](https://github.com/paul-gauthier/aider/issues).
[GitHub issue](https://github.com/Aider-AI/aider/issues).
## Install the development version of aider
@@ -91,7 +87,7 @@ If you want the very latest development version of aider
you can install directly from GitHub:
```
python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git
python -m pip install --upgrade git+https://github.com/Aider-AI/aider.git
```
If you've git cloned the aider repository already, you can install "live" from your local copy. This is mostly useful if you are developing aider and want your current modifications to take effect immediately.

View File

@@ -25,3 +25,9 @@ Install [pipx](https://pipx.pypa.io/stable/) then just do:
```
pipx install aider-chat
```
## pipx on replit
{% include replit-pipx.md %}

View File

@@ -33,7 +33,7 @@ then it should be possible to add repo map support.
To build a repo map, aider needs the `tags.scm` file
from the given language's tree-sitter grammar.
If you can find and share that file in a
[GitHub issue](https://github.com/paul-gauthier/aider/issues),
[GitHub issue](https://github.com/Aider-AI/aider/issues),
then it may be possible to add repo map support.
If aider doesn't support linting, it will be complicated to

View File

@@ -150,7 +150,7 @@ The model also has to successfully apply all its changes to the source file with
## Code refactoring leaderboard
[Aider's refactoring benchmark](https://github.com/paul-gauthier/refactor-benchmark) asks the LLM to refactor 89 large methods from large python classes. This is a more challenging benchmark, which tests the model's ability to output long chunks of code without skipping sections or making mistakes. It was developed to provoke and measure [GPT-4 Turbo's "lazy coding" habit](/2023/12/21/unified-diffs.html).
[Aider's refactoring benchmark](https://github.com/Aider-AI/refactor-benchmark) asks the LLM to refactor 89 large methods from large python classes. This is a more challenging benchmark, which tests the model's ability to output long chunks of code without skipping sections or making mistakes. It was developed to provoke and measure [GPT-4 Turbo's "lazy coding" habit](/2023/12/21/unified-diffs.html).
The refactoring benchmark requires a large context window to
work with large source files.
@@ -291,10 +291,10 @@ since it is the easiest format for an LLM to use.
Contributions of benchmark results are welcome!
See the
[benchmark README](https://github.com/paul-gauthier/aider/blob/main/benchmark/README.md)
[benchmark README](https://github.com/Aider-AI/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/Aider-AI/aider/blob/main/aider/website/_data/).
<p class="post-date">
@@ -321,6 +321,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.')}")
]]]-->
August 30, 2024.
October 04, 2024.
<!--[[[end]]]-->
</p>

View File

@@ -14,7 +14,7 @@ Aider has some built in shortcuts for the most popular Anthropic models and
has been tested and benchmarked to work well with them:
```
python -m pip install aider-chat
python -m pip install -U aider-chat
export ANTHROPIC_API_KEY=<key> # Mac/Linux
setx ANTHROPIC_API_KEY <key> # Windows, restart shell after setx
@@ -26,7 +26,7 @@ aider
aider --opus
# List models available from Anthropic
aider --models anthropic/
aider --list-models anthropic/
```
{: .tip }

View File

@@ -8,7 +8,7 @@ nav_order: 500
Aider can connect to the OpenAI models on Azure.
```
python -m pip install aider-chat
python -m pip install -U aider-chat
# Mac/Linux:
export AZURE_API_KEY=<key>
@@ -24,7 +24,7 @@ setx AZURE_API_BASE https://myendpt.openai.azure.com
aider --model azure/<your_deployment_name>
# List models available from Azure
aider --models azure/
aider --list-models azure/
```
Note that aider will also use environment variables

View File

@@ -54,7 +54,7 @@ aider --model bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0
To see some models available via Bedrock, run:
```
aider --models bedrock/
aider --list-models bedrock/
```
Make sure you have access to these models in your AWS account before attempting to use them with Aider.

View File

@@ -13,13 +13,13 @@ You'll need a [Cohere API key](https://dashboard.cohere.com/welcome/login).
To use **Command-R+**:
```
python -m pip install aider-chat
python -m pip install -U aider-chat
export COHERE_API_KEY=<key> # Mac/Linux
setx COHERE_API_KEY <key> # Windows, restart shell after setx
aider --model command-r-plus
aider --model command-r-plus-08-2024
# List models available from Cohere
aider --models cohere_chat/
aider --list-models cohere_chat/
```

View File

@@ -9,7 +9,7 @@ Aider can connect to the DeepSeek.com API.
The DeepSeek Coder V2 model has a top score on aider's code editing benchmark.
```
python -m pip install aider-chat
python -m pip install -U aider-chat
export DEEPSEEK_API_KEY=<key> # Mac/Linux
setx DEEPSEEK_API_KEY <key> # Windows, restart shell after setx

View File

@@ -12,7 +12,7 @@ with code editing capability that's comparable to GPT-3.5.
You'll need a [Gemini API key](https://aistudio.google.com/app/u/2/apikey).
```
python -m pip install aider-chat
python -m pip install -U aider-chat
export GEMINI_API_KEY=<key> # Mac/Linux
setx GEMINI_API_KEY <key> # Windows, restart shell after setx
@@ -20,6 +20,6 @@ setx GEMINI_API_KEY <key> # Windows, restart shell after setx
aider --model gemini/gemini-1.5-pro-latest
# List models available from Gemini
aider --models gemini/
aider --list-models gemini/
```

View File

@@ -13,7 +13,7 @@ You'll need a [Groq API key](https://console.groq.com/keys).
To use **Llama3 70B**:
```
python -m pip install aider-chat
python -m pip install -U aider-chat
export GROQ_API_KEY=<key> # Mac/Linux
setx GROQ_API_KEY <key> # Windows, restart shell after setx
@@ -21,7 +21,7 @@ setx GROQ_API_KEY <key> # Windows, restart shell after setx
aider --model groq/llama3-70b-8192
# List models available from Groq
aider --models groq/
aider --list-models groq/
```

View File

@@ -15,7 +15,7 @@ ollama pull <model>
ollama serve
# In another terminal window...
python -m pip install aider-chat
python -m pip install -U aider-chat
export OLLAMA_API_BASE=http://127.0.0.1:11434 # Mac/Linux
setx OLLAMA_API_BASE http://127.0.0.1:11434 # Windows, restart shell after setx

View File

@@ -8,7 +8,7 @@ nav_order: 500
Aider can connect to any LLM which is accessible via an OpenAI compatible API endpoint.
```
python -m pip install aider-chat
python -m pip install -U aider-chat
# Mac/Linux:
export OPENAI_API_BASE=<endpoint>

View File

@@ -14,7 +14,7 @@ Aider has some built in shortcuts for the most popular OpenAI models and
has been tested and benchmarked to work well with them:
```
python -m pip install aider-chat
python -m pip install -U aider-chat
export OPENAI_API_KEY=<key> # Mac/Linux
setx OPENAI_API_KEY <key> # Windows, restart shell after setx
@@ -29,7 +29,7 @@ aider --4-turbo
aider --35-turbo
# List models available from OpenAI
aider --models openai/
aider --list-models openai/
```
You can use `aider --model <model-name>` to use any other OpenAI model.

View File

@@ -9,7 +9,7 @@ Aider can connect to [models provided by OpenRouter](https://openrouter.ai/model
You'll need an [OpenRouter API key](https://openrouter.ai/keys).
```
python -m pip install aider-chat
python -m pip install -U aider-chat
export OPENROUTER_API_KEY=<key> # Mac/Linux
setx OPENROUTER_API_KEY <key> # Windows, restart shell after setx
@@ -18,13 +18,13 @@ setx OPENROUTER_API_KEY <key> # Windows, restart shell after setx
aider --model openrouter/<provider>/<model>
# List models available from OpenRouter
aider --models openrouter/
aider --list-models openrouter/
```
In particular, many aider users access Sonnet via OpenRouter:
```
python -m pip install aider-chat
python -m pip install -U aider-chat
export OPENROUTER_API_KEY=<key> # Mac/Linux
setx OPENROUTER_API_KEY <key> # Windows, restart shell after setx

View File

@@ -9,14 +9,14 @@ Aider uses the [litellm](https://docs.litellm.ai/docs/providers) package
to connect to hundreds of other models.
You can use `aider --model <model-name>` to use any supported model.
To explore the list of supported models you can run `aider --models <model-name>`
To explore the list of supported models you can run `aider --list-models <model-name>`
with a partial model name.
If the supplied name is not an exact match for a known model, aider will
return a list of possible matching models.
For example:
```
$ aider --models turbo
$ aider --list-models turbo
Aider v0.29.3-dev
Models which match "turbo":
@@ -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

View File

@@ -0,0 +1,106 @@
---
parent: More info
nav_order: 960
description: Aider uses various "edit formats" to let LLMs edit source files.
---
# Edit formats
Aider uses various "edit formats" to let LLMs edit source files.
Different models work better or worse with different edit formats.
Aider is configured to use the optimal format for most popular, common models.
You can always force use of a specific edit format with
the `--edit-format` switch.
## whole
The "whole" edit format is the simplest possible editing format.
The LLM is instructed to return a full, updated
copy of each source file that needs changes.
While simple, it can be slow and costly because the LLM has to return
the *entire file* even if just a few lines are edited.
The format expects the file path just before the fenced file content:
````
show_greeting.py
```
import sys
def greeting(name):
print(f"Hey {{name}}")
if __name__ == '__main__':
greeting(sys.argv[1])
```
````
## diff
The "diff" edit format asks the LLM to specify file edits as a series of search/replace blocks.
This is an efficient format, because the model only needs to return parts of the file
which have changes.
They are formatted using a syntax similar to the git merge conflict resolution markings,
with the file path right before a fenced block:
````
mathweb/flask/app.py
```
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
````
## diff-fenced
The "diff-fenced" edit format is based on the diff format, but
the file path is placed inside the fence.
It is primarily used with the Gemini family of models,
which often fail to conform to fencing approach specified in the diff format.
````
```
mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
````
## udiff
The "udiff" edit format is based on the widely used unified diff format,
but [modified and simplified](/2023/12/21/unified-diffs.html).
This is an efficient format, because the model only needs to return parts of the file
which have changes.
It was mainly used to the GPT-4 Turbo family of models,
to reduce their "lazy coding" tendencies with other edit formats.
````
```diff
--- mathweb/flask/app.py
+++ mathweb/flask/app.py
@@ ... @@
-class MathWeb:
+import sympy
+
+class MathWeb:
```
````
## editor-diff and editor-whole
These are streamlined versions of the diff and whole formats, intended to be used
with `--editor-edit-format` when using
[architect mode](/docs/usage/modes.html).

View File

@@ -0,0 +1,92 @@
---
parent: More info
nav_order: 920
description: Aider can handle "infinite output" from models that support prefill.
---
# Infinite output
LLM providers limit how much output a model can generate from a single request.
This is usually called the output token limit.
Aider is able to work around this limit with models that support
"prefilling" the assistant response.
When you use aider with a model that supports prefill, you will see
"infinite output" noted in the announcement lines displayed at launch:
```
Aider v0.58.0
Main model: claude-3-5-sonnet-20240620 with diff edit format, prompt cache, infinite output
```
Models that support prefill can be primed to think they started their response
with a specific piece of text.
You can put words in their mouth, and they will continue generating
text from that point forward.
When aider is collecting code edits from a model and
it hits the output token limit,
aider simply initiates another LLM request with the partial
response prefilled.
This prompts the model to continue where it left off,
generating more of the desired response.
This prefilling of the partially completed response can be repeated,
allowing for very long outputs.
Joining the text across these output limit boundaries
requires some heuristics, but is typically fairly reliable.
Aider supports "infinite output" for models that support "prefill",
such as:
<!--[[[cog
import requests
import json
# Fetch the JSON data
url = "https://raw.githubusercontent.com/BerriAI/litellm/refs/heads/main/model_prices_and_context_window.json"
response = requests.get(url)
data = json.loads(response.text)
# Process the JSON to find models with supports_assistant_prefill=true
prefill_models = [model for model, info in data.items() if info.get('supports_assistant_prefill') == True]
# Generate the list of models
model_list = "\n".join(f"- {model}" for model in sorted(prefill_models))
cog.out(model_list)
]]]-->
- claude-3-5-sonnet-20240620
- claude-3-haiku-20240307
- claude-3-opus-20240229
- claude-3-sonnet-20240229
- codestral/codestral-2405
- codestral/codestral-latest
- deepseek-chat
- deepseek-coder
- mistral/codestral-2405
- mistral/codestral-latest
- mistral/codestral-mamba-latest
- mistral/mistral-large-2402
- mistral/mistral-large-2407
- mistral/mistral-large-latest
- mistral/mistral-medium
- mistral/mistral-medium-2312
- mistral/mistral-medium-latest
- mistral/mistral-small
- mistral/mistral-small-latest
- mistral/mistral-tiny
- mistral/open-codestral-mamba
- mistral/open-mistral-7b
- mistral/open-mistral-nemo
- mistral/open-mistral-nemo-2407
- mistral/open-mixtral-8x22b
- mistral/open-mixtral-8x7b
- mistral/pixtral-12b-2409
- openrouter/anthropic/claude-3.5-sonnet
- vertex_ai/claude-3-5-sonnet@20240620
- vertex_ai/claude-3-haiku@20240307
- vertex_ai/claude-3-opus@20240229
- vertex_ai/claude-3-sonnet@20240229
<!--[[[end]]]-->

Some files were not shown because too many files have changed in this diff Show More