...")
+ sys.exit(1)
+
+ linter = Linter(root=os.getcwd())
+ for file_path in sys.argv[1:]:
+ errors = linter.lint(file_path)
+ if errors:
+ print(errors)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/aider/litellm.py b/aider/litellm.py
index ff6d2d528..f6faa403b 100644
--- a/aider/litellm.py
+++ b/aider/litellm.py
@@ -8,4 +8,6 @@ os.environ["OR_APP_NAME"] = "Aider"
import litellm # noqa: E402
+litellm.suppress_debug_info = True
+
__all__ = [litellm]
diff --git a/aider/main.py b/aider/main.py
index 2074cf803..ad4c55c3d 100644
--- a/aider/main.py
+++ b/aider/main.py
@@ -177,6 +177,29 @@ def launch_gui(args):
# sys.argv = ['streamlit', 'run', '--'] + args
+def parse_lint_cmds(lint_cmds, io):
+ err = False
+ res = dict()
+ for lint_cmd in lint_cmds:
+ pieces = lint_cmd.split(":")
+ lang = pieces[0]
+ cmd = lint_cmd[len(lang) + 1 :]
+
+ lang = lang.strip()
+ cmd = cmd.strip()
+
+ if lang and cmd:
+ 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"')
+ err = True
+ if err:
+ return
+ return res
+
+
def main(argv=None, input=None, output=None, force_git_root=None, return_coder=False):
if argv is None:
argv = sys.argv[1:]
@@ -306,6 +329,10 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
main_model = models.Model(args.model, weak_model=args.weak_model)
+ lint_cmds = parse_lint_cmds(args.lint_cmd, io)
+ if lint_cmds is None:
+ return 1
+
if args.show_model_warnings:
models.sanity_check_models(io, main_model)
@@ -332,6 +359,10 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
aider_ignore_file=args.aiderignore,
max_chat_history_tokens=args.max_chat_history_tokens,
restore_chat_history=args.restore_chat_history,
+ auto_lint=args.auto_lint,
+ auto_test=args.auto_test,
+ lint_cmds=lint_cmds,
+ test_cmd=args.test_cmd,
)
except ValueError as err:
@@ -355,6 +386,19 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
coder.commands.cmd_commit("")
return
+ if args.lint:
+ coder.commands.cmd_lint("")
+ return
+
+ if args.test:
+ if not args.test_cmd:
+ io.tool_error("No --test-cmd provided.")
+ return 1
+ test_errors = coder.commands.cmd_test(args.test_cmd)
+ if test_errors:
+ coder.run(test_errors)
+ return
+
if args.show_repo_map:
repo_map = coder.get_repo_map()
if repo_map:
diff --git a/aider/repo.py b/aider/repo.py
index 4538c16a3..666a8f084 100644
--- a/aider/repo.py
+++ b/aider/repo.py
@@ -242,6 +242,23 @@ class GitRepo:
res = Path(self.root) / path
return utils.safe_abs_path(res)
+ def get_dirty_files(self):
+ """
+ Returns a list of all files which are dirty (not committed), either staged or in the working
+ directory.
+ """
+ dirty_files = set()
+
+ # Get staged files
+ staged_files = self.repo.git.diff("--name-only", "--cached").splitlines()
+ dirty_files.update(staged_files)
+
+ # Get unstaged files
+ unstaged_files = self.repo.git.diff("--name-only").splitlines()
+ dirty_files.update(unstaged_files)
+
+ return list(dirty_files)
+
def is_dirty(self, path=None):
if path and not self.path_in_repo(path):
return True
diff --git a/assets/css/style.scss b/assets/css/style.scss
index 3f558490a..e15a84ea5 100644
--- a/assets/css/style.scss
+++ b/assets/css/style.scss
@@ -49,6 +49,7 @@
color: #0f0;
padding: 1em 1em 1em 1em;
border-radius: 5px;
+ margin-top: 50px;
}
.chat-transcript blockquote {
diff --git a/assets/models-over-time.png b/assets/models-over-time.png
new file mode 100644
index 000000000..eaed94a53
Binary files /dev/null and b/assets/models-over-time.png differ
diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py
index a729e0c19..6261e00f9 100755
--- a/benchmark/benchmark.py
+++ b/benchmark/benchmark.py
@@ -317,6 +317,7 @@ def summarize_results(dirname):
res.test_timeouts = 0
res.exhausted_context_windows = 0
res.num_malformed_responses = 0
+ res.num_with_malformed_responses = 0
res.syntax_errors = 0
res.indentation_errors = 0
res.lazy_comments = 0
@@ -342,6 +343,8 @@ def summarize_results(dirname):
res.user_asks += results.get("num_user_asks", 0)
res.exhausted_context_windows += results.get("num_exhausted_context_windows", 0)
res.num_malformed_responses += results.get("num_malformed_responses", 0)
+ if results.get("num_malformed_responses"):
+ res.num_with_malformed_responses += 1
res.lazy_comments += results.get("lazy_comments", 0)
res.syntax_errors += results.get("syntax_errors", 0)
@@ -392,11 +395,12 @@ def summarize_results(dirname):
for i in range(tries):
print(f" pass_rate_{i+1}: {percents[i]:.1f}")
- pct_well_formed = 1.0 - res.num_malformed_responses / res.completed_tests
+ pct_well_formed = 1.0 - res.num_with_malformed_responses / res.completed_tests
print(f" percent_cases_well_formed: {pct_well_formed*100:.1f}")
show("error_outputs")
show("num_malformed_responses")
+ show("num_with_malformed_responses")
show("user_asks")
show("lazy_comments")
show("syntax_errors")
diff --git a/dev-requirements.txt b/dev-requirements.txt
index 86199961b..fcbb97d26 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -2,11 +2,11 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
-# pip-compile dev-requirements.in
+# pip-compile --output-file=dev-requirements.txt dev-requirements.in
#
alabaster==0.7.16
# via sphinx
-babel==2.14.0
+babel==2.15.0
# via sphinx
build==1.2.1
# via pip-tools
@@ -48,7 +48,7 @@ imgcat==0.5.0
# via -r dev-requirements.in
iniconfig==2.0.0
# via pytest
-jinja2==3.1.3
+jinja2==3.1.4
# via sphinx
kiwisolver==1.4.5
# via matplotlib
@@ -58,7 +58,7 @@ markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via jinja2
-matplotlib==3.8.4
+matplotlib==3.9.0
# via -r dev-requirements.in
mdurl==0.1.2
# via markdown-it-py
@@ -85,7 +85,7 @@ pillow==10.3.0
# via matplotlib
pip-tools==7.4.1
# via -r dev-requirements.in
-platformdirs==4.2.1
+platformdirs==4.2.2
# via virtualenv
pluggy==1.5.0
# via pytest
@@ -93,9 +93,9 @@ pox==0.3.4
# via pathos
ppft==1.7.6.8
# via pathos
-pre-commit==3.7.0
+pre-commit==3.7.1
# via -r dev-requirements.in
-pygments==2.17.2
+pygments==2.18.0
# via
# rich
# sphinx
@@ -153,7 +153,7 @@ tzdata==2024.1
# via pandas
urllib3==2.2.1
# via requests
-virtualenv==20.26.1
+virtualenv==20.26.2
# via pre-commit
wheel==0.43.0
# via pip-tools
diff --git a/docs/commands.md b/docs/commands.md
index 35cd9d7be..9f28d03c9 100644
--- a/docs/commands.md
+++ b/docs/commands.md
@@ -37,6 +37,5 @@ The interactive prompt is built with [prompt-toolkit](https://github.com/prompt-
- `Ctrl-P` : Move up to the previous history entry.
- `Ctrl-R` : Reverse search in command history.
-Note: aider currently exits vi normal mode after a single command, (maybe something to do with the esc keybinding?). Feel free to investigate and make a PR if you would like to see it fully supported.
-
-Prompt toolkit also does not provide clear documentation on the bindings they support - maybe you can take aider and help them out with that and we can then link to the authoritative docs.
+Note: aider currently exits vi normal mode after a single command, (maybe something to do with the esc keybinding?).
+Feel free to investigate and make a PR if you would like to see it fully supported.
diff --git a/docs/install.md b/docs/install.md
index 3c38edbc9..73ece46c9 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -29,8 +29,8 @@ To work with Anthropic's models like Claude 3 Opus you need a paid
# Install aider
py -m pip install aider-chat
-# To work with GPT-4 Turbo:
-$ aider --openai-api-key sk-xxx... --4turbo
+# To work with GPT-4o:
+$ aider --openai-api-key sk-xxx...
# To work with Claude 3 Opus:
$ aider --anthropic-api-key sk-xxx... --opus
@@ -42,8 +42,8 @@ $ aider --anthropic-api-key sk-xxx... --opus
# Install aider
python -m pip install aider-chat
-# To work with GPT-4 Turbo:
-$ aider --openai-api-key sk-xxx... --4turbo
+# To work with GPT-4o:
+$ aider --openai-api-key sk-xxx...
# To work with Claude 3 Opus:
$ aider --anthropic-api-key sk-xxx... --opus
@@ -51,10 +51,7 @@ $ aider --anthropic-api-key sk-xxx... --opus
## Working with other LLMs
-Aider works well with GPT 3.5, GPT-4, GPT-4 Turbo with Vision,
-and Claude 3 Opus.
-It also has support for [connecting to almost any LLM](https://aider.chat/docs/llms.html).
-
+Aider works well with GPT-4o, Claude 3 Opus, GPT-3.5 and supports [connecting to almost any LLM](https://aider.chat/docs/llms.html).
## Tutorial videos
diff --git a/docs/leaderboards/index.md b/docs/leaderboards/index.md
index d33cc6a54..7fb8cf290 100644
--- a/docs/leaderboards/index.md
+++ b/docs/leaderboards/index.md
@@ -2,7 +2,7 @@
highlight_image: /assets/leaderboard.jpg
---
-# GPT-4o takes #1 & #2 on the Aider LLM leaderboards
+# Aider LLM Leaderboards
Aider works best with LLMs which are good at *editing* code, not just good at writing
code.
@@ -14,7 +14,7 @@ The leaderboards below report the results from a number of popular LLMs.
While [aider can connect to almost any LLM](/docs/llms.html),
it works best with models that score well on the benchmarks.
-## GPT-4o
+## GPT-4o takes the #1 & #2 spots
GPT-4o tops the aider LLM code editing leaderboard at 72.9%, versus 68.4% for Opus. GPT-4o takes second on aider's refactoring leaderboard with 62.9%, versus Opus at 72.3%.
diff --git a/examples/2048-game.md b/examples/2048-game.md
index a1a8de1fd..1e1313530 100644
--- a/examples/2048-game.md
+++ b/examples/2048-game.md
@@ -1,9 +1,9 @@
-# Modify an open source 2048 game with aider and gpt-4
+# Modify an open source 2048 game with aider
In this chat transcript, the user explores and modifies an open source [javascript 2048 game repo](https://github.com/gabrielecirulli/2048).
-Notice that GPT-4 asks to see a particular source file, and aider automatically includes it in the chat session after getting permission from the user.
+Notice that the LLM asks to see a particular source file, and aider automatically includes it in the chat session after getting permission from the user.
@@ -18,6 +18,8 @@ Based on the file names you provided, it seems like this repository is for a web
If you need help with any specific part of the code or want to add new features, please let me know, and I'll be happy to assist you.
+
+
#### how does the scoring work?
To help you with the scoring mechanism, I need to see the relevant code. Please provide the contents of the `js/game_manager.js` file, as it is likely to contain the scoring logic.
@@ -58,6 +60,8 @@ if (next && next.value === tile.value && !next.mergedFrom) {
In this code snippet, when two tiles with the same value (`tile` and `next`) are found, they are merged into a new tile (`merged`). The value of the new tile is added to the current score (`self.score += merged.value`). If the merged tile's value is 2048, the game is considered won (`self.won = true`).
+
+
#### can we add some randomness? maybe 10% of the time give the user a 10x bonus?
Sure, we can add a 10% chance of giving the user a 10x bonus when two tiles merge. To implement this, we'll modify the scoring logic in the `js/game_manager.js` file. Here's the step-by-step plan:
diff --git a/examples/README.md b/examples/README.md
index e66ed963c..8224c0771 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -1,19 +1,19 @@
-# What's it like to code with GPT-4 and aider?
+# What's it like to code with aider?
-Below are some chat transcripts showing what it's like to code with the help of GPT-4 using the `aider` command-line chat tool.
+Below are some chat transcripts showing what it's like to code with aider.
In the chats, you'll see a varity of coding tasks like generating new code, editing existing code, debugging, exploring unfamiliar code, etc.
-* [**Hello World Flask App**](https://aider.chat/examples/hello-world-flask.html): Start from scratch and have GPT create a simple Flask app with various endpoints, such as adding two numbers and calculating the Fibonacci sequence.
+* [**Hello World Flask App**](https://aider.chat/examples/hello-world-flask.html): Start from scratch and have aider create a simple Flask app with various endpoints, such as adding two numbers and calculating the Fibonacci sequence.
-* [**Javascript Game Modification**](https://aider.chat/examples/2048-game.html): Dive into an existing open-source repo, and get GPT's help to understand it and make modifications.
+* [**Javascript Game Modification**](https://aider.chat/examples/2048-game.html): Dive into an existing open-source repo, and get aider's help to understand it and make modifications.
-* [**Complex Multi-file Change with Debugging**](https://aider.chat/examples/complex-change.html): GPT makes a complex code change that is coordinated across multiple source files, and resolves bugs by reviewing error output and doc snippets.
+* [**Complex Multi-file Change with Debugging**](https://aider.chat/examples/complex-change.html): Aider makes a complex code change that is coordinated across multiple source files, and resolves bugs by reviewing error output and doc snippets.
-* [**Create a Black Box Test Case**](https://aider.chat/examples/add-test.html): GPT creates a "black box" test case without access to the source of the method being tested, using only a [high level map of the repository based on ctags](https://aider.chat/docs/ctags.html).
+* [**Create a Black Box Test Case**](https://aider.chat/examples/add-test.html): Aider creates a "black box" test case without access to the source of the method being tested, using only a [high level map of the repository based on ctags](https://aider.chat/docs/ctags.html).
-* [**Honor the NO_COLOR env var**](https://aider.chat/examples/no-color.html): The user pastes the NO_COLOR spec from no-color.org into the chat, and GPT-4 modifies the application to conform.
+* [**Honor the NO_COLOR env var**](https://aider.chat/examples/no-color.html): The user pastes the NO_COLOR spec from no-color.org into the chat, and aider modifies the application to conform.
-* [**Download, analyze and plot US Census data**](https://aider.chat/examples/census.html): GPT-4 downloads census data, suggests some hypotheses to test, tests one and then summarizes and plots a graph of the results.
+* [**Download, analyze and plot US Census data**](https://aider.chat/examples/census.html): Aider downloads census data, suggests some hypotheses to test, tests one and then summarizes and plots a graph of the results.
* [**Semantic Search & Replace**](semantic-search-replace.md): Updating a collection of function calls, which requires dealing with various formatting and semantic differences in the various function call sites.
@@ -29,9 +29,9 @@ In the chats, you'll see a varity of coding tasks like generating new code, edit
To better understand the chat transcripts, it's worth knowing that:
- - Each time GPT-4 suggests a code change, `aider` automatically applies it to the source files.
+ - Each time the LLM suggests a code change, `aider` automatically applies it to the source files.
- After applying the edits, `aider` commits them to git with a descriptive commit message.
- - GPT-4 can only see and edit files which have been "added to the chat session". The user adds files either via the command line or the in-chat `/add` command. If GPT-4 asks to see specific files, `aider` asks the user for permission to add them to the chat. The transcripts contain notifications from `aider` whenever a file is added or dropped from the session.
+ - The LLM can only see and edit files which have been "added to the chat session". The user adds files either via the command line or the in-chat `/add` command. If the LLM asks to see specific files, `aider` asks the user for permission to add them to the chat. The transcripts contain notifications from `aider` whenever a file is added or dropped from the session.
## Transcript formatting
@@ -41,7 +41,7 @@ To better understand the chat transcripts, it's worth knowing that:
#### These are chat messages written by the user.
-Chat responses from GPT-4 are in a blue font like this, and often include colorized "edit blocks" that specify edits to the code.
+Chat responses from the LLM are in a blue font like this, and often include colorized "edit blocks" that specify edits to the code.
Here's a sample edit block that switches from printing "hello" to "goodbye":
```python
diff --git a/examples/add-test.md b/examples/add-test.md
index cada5104b..c3b79cbaf 100644
--- a/examples/add-test.md
+++ b/examples/add-test.md
@@ -1,17 +1,17 @@
# Create a "black box" test case
-This transcript shows GPT-4 creating a black box test case,
+This transcript shows aider creating a black box test case,
**without being given
access to the source code of the function being tested or any of the
other code in the repo.**
-Instead, GPT is operating entirely off a
+Instead, aider is operating entirely off a
[high level map of the repository based on ctags](https://aider.chat/docs/ctags.html),
which provides details on all the symbols and function signatures in the repo.
-Using only the meta-data in the map, GPT is able to figure out how to call the method to be tested, as well as how to instantiate multiple class objects that are required to prepare for the test.
+Using only the meta-data in the map, the LLM is able to figure out how to call the method to be tested, as well as how to instantiate multiple class objects that are required to prepare for the test.
-In detail, GPT is able to use the repo map to:
+In detail, aider is able to use the repo map to:
- Find the function signature of the `cmd_add()` function which the user wants a test case for.
- Determine that it is a method of the `Command` class, so the test case will need to instantiate an instance to conduct the test.
@@ -19,12 +19,12 @@ In detail, GPT is able to use the repo map to:
- Figure out the arguments required to instantiate the `InputOutput` instance.
- Decide that the `Coder` class looks complex enough to use a `MagickMock`.
-The `cmd_add()` method is defined without type annotations, so GPT makes a
+The `cmd_add()` method is defined without type annotations, so aider makes a
reasonable but incorrect guess that it accepts a `list` of files. The
user invokes the `/run` command to run the new unit test, which throws an
error based on this misunderstanding.
-GPT reviews the error message and fixes the call to `cmd_add()` to
+The LLM reviews the error message and fixes the call to `cmd_add()` to
correctly pass a `str` with a space-separated list of filenames
instead. The test then passes on the next `/run`.
@@ -83,6 +83,8 @@ This test will ensure that the `cmd_add` method creates the specified files in t
> Applied edit to tests/test_commands.py
> Commit e2d5212 aider: Added a test method `test_cmd_add` that creates a temporary directory, calls the `cmd_add` method with 'foo.txt' and 'bar.txt', and checks if both files have been created in the temporary directory.
+
+
#### /run pytest tests/test_commands.py
> ```
@@ -157,6 +159,8 @@ pytest tests/test_commands.py
> Applied edit to tests/test_commands.py
> Commit d1551b4 aider: Updated test to pass a string instead of a list when calling `cmd_add` method.
+
+
#### /run pytest tests/test_commands.py
> ```
diff --git a/examples/asciinema.md b/examples/asciinema.md
index afb664f8c..a6940a6a6 100644
--- a/examples/asciinema.md
+++ b/examples/asciinema.md
@@ -1,5 +1,5 @@
-# Editing an asciinema cast file with aider and gpt-4
+# Editing an asciinema cast file with aider
The user needs to make some tedious edits to the escape sequences in an `asciinema` screencast file.
diff --git a/examples/census.md b/examples/census.md
index 8988010b9..d734a6f56 100644
--- a/examples/census.md
+++ b/examples/census.md
@@ -4,7 +4,7 @@
Inspired by
[Ethan Mollick's recent blog article about ChatGPT plugins](https://www.oneusefulthing.org/p/it-is-starting-to-get-strange),
I used `aider` and GPT-4 to do data analysis of some US Census data.
-I asked GPT-4 how to download census data and to suggest some
+I asked aider how to download census data and to suggest some
hypotheses to test. I asked it to write the code to get the data, test one of the
hypotheses and provide a summary and plot of the results.
@@ -30,6 +30,8 @@ Some interesting patterns to analyze in the ACS dataset could include:
Remember to consider the dataset's documentation and guidelines to understand the data and its limitations.
+
+
#### do you know how to download American Community Survey data?
Yes, I can guide you on how to download American Community Survey (ACS) data. You can use the Census Bureau's API to access the data. To do this, you'll need an API key, which you can obtain from the Census Bureau's website.
@@ -75,6 +77,8 @@ For more information on available variables and geographic areas, refer to the A
- Geographic Areas: https://api.census.gov/data/2019/acs/acs5/geography.html
+
+
#### how do i get an api key?
To obtain an API key from the Census Bureau, follow these steps:
@@ -90,6 +94,8 @@ To obtain an API key from the Census Bureau, follow these steps:
Once you have your API key, you can use it in your Python code to access the American Community Survey data, as shown in the previous example. Replace `'your_api_key'` with the API key you received in the email.
+
+
#### please save your download script as `getdata.py`
Here's the `getdata.py` file with the download script:
@@ -128,6 +134,8 @@ Save this code in a new file named `getdata.py`. Remember to replace `'your_api_
> Applied edit to new_file/getdata.py
> Commit afcb9d1 aider: Added `getdata.py` file with download script.
+
+
#### add my api key: 4ae31ed2a0f0dd62609e51cd95deadbeefe7774f
I will update the API key in the file.
@@ -145,6 +153,8 @@ api_key = '4ae31ed2a0f0dd62609e51cd95deadbeefe7774f'
> Commit 1d8b4a6 aider: Updated the API key in new_file/getdata.py.
+
+
#### what are some interesting hypothesis that you might be able to test using ACS data?
Here are some interesting hypotheses that you can test using ACS (American Community Survey) data:
@@ -158,6 +168,8 @@ Here are some interesting hypotheses that you can test using ACS (American Commu
These are just a few examples. ACS data provides a wealth of information on various demographic, social, economic, and housing characteristics, allowing you to explore many different hypotheses.
+
+
#### can you download the data to test #2 Impact of population density on housing prices: Higher population density areas have higher housing prices.
As an AI language model, I cannot directly download or access data. However, I can help you with the code to download the required data for testing hypothesis #2 using the ACS data.
@@ -183,6 +195,8 @@ After running the updated code, you'll have the population and housing price dat
> Applied edit to new_file/getdata.py
> Commit 81549ab aider: Updated code to fetch population and housing price data for testing hypothesis #2.
+
+
#### instead of printing all the data, print a summary table that shows whether the data supports the hypothesis
To print a summary table, you can use the pandas library to analyze the data and calculate the correlation between population density and housing prices. Here's how to modify the code:
@@ -239,6 +253,8 @@ After applying these changes, the code will print a summary table showing the co
> Commit 2f4fcd4 aider: Added pandas library to analyze data and calculate correlation between population density and housing prices, and printed the correlation as a summary table.
+
+
#### /run python3 new_file/getdata.py
>```
>Summary Table:
@@ -250,6 +266,8 @@ After applying these changes, the code will print a summary table showing the co
Great! The script seems to be working as expected. The correlation between population density and housing prices is 0.1602. If you need any further assistance or modifications to the code, please let me know.
+
+
#### can you also plot a graph which would show any correlation?
To plot a graph showing the correlation between population density and housing prices, we'll need to modify the `new_file/getdata.py` file. We'll use the `matplotlib` library to create the plot. If you don't have it installed, you can install it using `pip install matplotlib`.
diff --git a/examples/chat-transcript-css.md b/examples/chat-transcript-css.md
index 96e4f4f98..6a4c772a9 100644
--- a/examples/chat-transcript-css.md
+++ b/examples/chat-transcript-css.md
@@ -24,6 +24,8 @@ assets/css/style.css
> ^C again to quit
+
+
#### make all the edits to the embedded style tag in the html
```html
@@ -63,12 +65,9 @@ index.html
> Commit e7a5cb5 aider: Added rounded border to all sides of the boxquote.
-#### (blank)
-> Git repo has uncommitted changes.
-> Commit before the chat proceeds [y/n/commit message]? Changed border color and width of blockquote in index.html.
-> Commit 6898a1d Changed border color and width of blockquote in index.html.
-
+
+
#### make the blockquote font color the same as the p color
> Git repo has uncommitted changes.
> Commit before the chat proceeds [y/n/commit message]? Added note about missing method and incorrect method calls in index.html.
@@ -123,12 +122,8 @@ index.html
> Commit 8645217 aider: Changed blockquote font color to match
color in index.html.
-#### (blank)
-> Git repo has uncommitted changes.
-> Commit before the chat proceeds [y/n/commit message]? Removed color and button styles from blockquote in index.html.
-> Commit f8d4782 Removed color and button styles from blockquote in index.html.
-
-
+
+
#### make the blockquote background a lighter shade of the same green as the border
```html
@@ -153,6 +148,8 @@ index.html
> Commit 57b7b10 aider: Changed blockquote background color to a lighter shade of green.
+
+
#### add some space inside the border of the blockquote
```html
@@ -179,6 +176,8 @@ index.html
> Commit dd7dcb6 aider: Added padding inside the border of the blockquote.
+
+
#### can we add a label "aider" along the top of the blockquote box only using style
```html
@@ -220,6 +219,8 @@ index.html
> Commit 0b0e332 aider: Added label "aider" to the top of the blockquote box using style.
+
+
#### add more padding on the top of the box and bring the label into the box so it doesn't intersect the border
```html
@@ -273,12 +274,8 @@ index.html
> Commit eee902e aider: Added more padding on the top of the box and brought the label into the box so it doesn't intersect the border.
-#### (blank)
-> Git repo has uncommitted changes.
-> Commit before the chat proceeds [y/n/commit message]? Changed padding and added margin to main-content blockquote.
-> Commit c9128d1 Changed padding and added margin to main-content blockquote.
-
-
+
+
#### change all the blockquote colors to be shades of blue instead of green. choose the blue based on the blue in the header gradient
```html
@@ -331,6 +328,8 @@ index.html
> Applied edit to index.html
> Commit a26c135 aider: Changed blockquote colors to shades of blue based on the blue in the header gradient.
+
+
#### can you style the "aider" label on the blockquote as a "tab" that docks onto the top of the box?
```html
@@ -385,12 +384,8 @@ index.html
> Commit 292eda3 aider: Styled the "aider" label on the blockquote as a "tab" that docks onto the top of the box.
-#### (blank)
-> Git repo has uncommitted changes.
-> Commit before the chat proceeds [y/n/commit message]? Changed padding and positioning of a CSS element and updated its border.
-> Commit 01fda51 Changed padding and positioning of a CSS element and updated its border.
-
-
+
+
#### apply the same box around the h4 element
```html
diff --git a/examples/complex-change.md b/examples/complex-change.md
index df2d21321..d79079a3e 100644
--- a/examples/complex-change.md
+++ b/examples/complex-change.md
@@ -6,7 +6,7 @@ This is a chat transcript of a fairly complex code change. The user is trying to
Some things to notice:
- The initial changes don't work, so the user provides error messages and snippets from the `prompt_toolkit` docs to collaboratively debug and solve the problem.
- The user edits a file outside the chat using their editor. `aider` notices these out-of-band changes and offers to commit them.
- - At one point the user hits `^C` to interrupt the GPT-4 response, since it's not a useful response. The user gives clarifications and gets a better result on the next reply.
+ - At one point the user hits `^C` to interrupt the LLM response, since it's not a useful response. The user gives clarifications and gets a better result on the next reply.
@@ -114,6 +114,8 @@ These changes will replace the usage of `/dev/null` with `prompt_toolkit`'s inpu
> Commit 6724fcd Added import statement for sys module in test_main.py.
+
+
#### /add aider/main.py
> Added aider/main.py to the chat
@@ -145,6 +147,8 @@ Now, the `main()` function will accept the `input` and `output` keyword argument
> Applied edit to aider/main.py
> Commit 79dfba9 aider: Fixed main() function to accept input and output keyword arguments.
+
+
#### we need to pass those into InputOutput and to prompt_toolkit right?
Yes, you're right. We need to pass the `input` and `output` arguments to the `InputOutput` class and then to the `prompt_toolkit.prompt()` function. Here's how to modify the `aider/getinput.py` and `aider/main.py` files:
@@ -209,6 +213,8 @@ These changes will ensure that the `input` and `output` arguments are passed to
> Applied edit to aider/main.py
> Commit cea9d2a aider: Updated InputOutput class to accept input and output arguments and passed them to prompt_toolkit.prompt() function.
+
+
#### FAILED tests/test_main.py::TestMain::test_main_with_empty_git_dir_new_file - TypeError: prompt() got an unexpected keyword argument 'input'
I apologize for the confusion. It seems I made a mistake in the `prompt_toolkit.prompt()` function call. The `prompt()` function accepts `stdin` and `stdout` arguments instead of `input` and `output`. Here's the fix:
@@ -231,6 +237,8 @@ These changes will ensure that the `input` and `output` arguments are passed cor
> Applied edit to aider/getinput.py
> Commit 55d3540 aider: Fixed `prompt()` function call in `get_input()` method to pass `stdin` and `stdout` arguments instead of `input` and `output`.
+
+
#### prompt_toolkit.shortcuts.prompt(message: AnyFormattedText | None = None, *, history: History | None = None, editing_mode: EditingMode | None = None, refresh_interval: float | None = None, vi_mode: bool | None = None, lexer: Lexer | None = None, completer: Completer | None = None, complete_in_thread: bool | None = None, is_password: bool | None = None, key_bindings: KeyBindingsBase | None = None, bottom_toolbar: AnyFormattedText | None = None, style: BaseStyle | None = None, color_depth: ColorDepth | None = None, cursor: AnyCursorShapeConfig = None, include_default_pygments_style: FilterOrBool | None = None, style_transformation: StyleTransformation | None = None, swap_light_and_dark_colors: FilterOrBool | None = None, rprompt: AnyFormattedText | None = None, multiline: FilterOrBool | None = None, prompt_continuation: PromptContinuationText | None = None, wrap_lines: FilterOrBool | None = None, enable_history_search: FilterOrBool | None = None, search_ignore_case: FilterOrBool | None = None, complete_while_typing: FilterOrBool | None = None, validate_while_typing: FilterOrBool | None = None, complete_style: CompleteStyle | None = None, auto_suggest: AutoSuggest | None = None, validator: Validator | None = None, clipboard: Clipboard | None = None, mouse_support: FilterOrBool | None = None, input_processors: list[Processor] | None = None, placeholder: AnyFormattedText | None = None, reserve_space_for_menu: int | None = None, enable_system_prompt: FilterOrBool | None = None, enable_suspend: FilterOrBool | None = None, enable_open_in_editor: FilterOrBool | None = None, tempfile_suffix: str | Callable[[], str] | None = None, tempfile: str | Callable[[], str] | None = None, default: str = '', accept_default: bool = False, pre_run: Callable[[], None] | None = None) → str
I apologize for the confusion earlier. It seems that the `prompt_toolkit.prompt()` function does not accept `stdin` and `stdout` arguments directly. Instead, we need to use the `Application` class from `prompt_toolkit` to create a custom application with the desired input and output. Here's how to modify the `aider/getinput.py` file:
@@ -239,6 +247,8 @@ First, import the necessary classes and functions from `prompt_tool
> ^C KeyboardInterrupt
+
+
#### class prompt_toolkit.shortcuts.PromptSession(message: AnyFormattedText = '', *, multiline: FilterOrBool = False, wrap_lines: FilterOrBool = True, is_password: FilterOrBool = False, vi_mode: bool = False, editing_mode: EditingMode = , complete_while_typing: FilterOrBool = True, validate_while_typing: FilterOrBool = True, enable_history_search: FilterOrBool = False, search_ignore_case: FilterOrBool = False, lexer: Lexer | None = None, enable_system_prompt: FilterOrBool = False, enable_suspend: FilterOrBool = False, enable_open_in_editor: FilterOrBool = False, validator: Validator | None = None, completer: Completer | None = None, complete_in_thread: bool = False, reserve_space_for_menu: int = 8, complete_style: CompleteStyle = , auto_suggest: AutoSuggest | None = None, style: BaseStyle | None = None, style_transformation: StyleTransformation | None = None, swap_light_and_dark_colors: FilterOrBool = False, color_depth: ColorDepth | None = None, cursor: AnyCursorShapeConfig = None, include_default_pygments_style: FilterOrBool = True, history: History | None = None, clipboard: Clipboard | None = None, prompt_continuation: PromptContinuationText | None = None, rprompt: AnyFormattedText = None, bottom_toolbar: AnyFormattedText = None, mouse_support: FilterOrBool = False, input_processors: list[Processor] | None = None, placeholder: AnyFormattedText | None = None, key_bindings: KeyBindingsBase | None = None, erase_when_done: bool = False, tempfile_suffix: str | Callable[[], str] | None = '.txt', tempfile: str | Callable[[], str] | None = None, refresh_interval: float = 0, input: Input | None = None, output: Output | None = None)
Thank you for providing the `PromptSession` class information. We can use the `PromptSession` class to create a custom session with the desired input and output. Here's how to modify the `aider/getinput.py` file:
@@ -290,6 +300,8 @@ These changes will ensure that the `input` and `output` arguments are passed cor
> Applied edit to aider/getinput.py
> Commit ac92cca aider: Replaced `prompt()` with `PromptSession()` to correctly pass input and output arguments.
+
+
#### try using create_input(StringIO('')) in the tests
@@ -345,6 +357,8 @@ These changes will replace the usage of `create_pipe_input()` with `create_input
> Applied edit to tests/test_main.py
> Commit 4bb043f aider: Replaced the usage of `create_pipe_input()` with `create_input(StringIO(''))` in the test cases.
+
+
#### nice, that worked!
I'm glad the changes worked for you! If you have any more requests or need further assistance, feel free to ask.
diff --git a/examples/css-exercises.md b/examples/css-exercises.md
index 7a361965d..6197d6d2b 100644
--- a/examples/css-exercises.md
+++ b/examples/css-exercises.md
@@ -1,5 +1,5 @@
-# Complete a css exercise with aider and GPT-4
+# Complete a css exercise with aider
In this chat transcript, the user asks about the open source [CSS Exercises repo](https://github.com/TheOdinProject/css-exercises) and completes an animation exercise.
@@ -12,6 +12,8 @@ In this chat transcript, the user asks about the open source [CSS Exercises repo
Based on the file list provided, it seems like this repository contains a collection of CSS and HTML exercises, solutions, and examples. The exercises cover various topics such as Flexbox, Grid, Animation, Foundations, and Margin & Padding. The repository also includes images and other assets used in the exercises.
+
+
#### /add animation/03-dropdown-menu/README.md
> Added animation/03-dropdown-menu/README.md to the chat
@@ -21,6 +23,8 @@ Yes, I see the content of the `animation/03-dropdown-menu/README.md` file. It de
Is there any specific change or improvement you would like me to make to this file or any other file in the repository?
+
+
#### can you make the changes suggested in the readme?
To make the changes suggested in the `animation/03-dropdown-menu/README.md`, I need to see the contents of the following files:
@@ -70,6 +74,8 @@ These changes add the bounce animation to the dropdown menu by creating a new ke
> Applied edit to animation/03-dropdown-menu/style.css
> Commit bb3a813 aider: Added bounce animation to dropdown menu.
+
+
#### that worked!
I'm glad the changes worked for you! If you have any more requests or need assistance with other parts of the code, feel free to ask. I'm here to help!
diff --git a/examples/hello-world-flask.md b/examples/hello-world-flask.md
index af52a7a2a..95d72bdf3 100644
--- a/examples/hello-world-flask.md
+++ b/examples/hello-world-flask.md
@@ -1,5 +1,5 @@
-# Create a simple flask app with aider & gpt-4
+# Create a simple flask app with aider
In this chat transcript, the user asks to make a simple flask app with various endpoints.
@@ -36,6 +36,8 @@ Make sure to install Flask in your project environment using `pip install flask`
> Applied edit to app.py
> Commit 414c394 aider: Added a `/hello` endpoint that returns "Hello, World!" to the Flask app.
+
+
#### add an endpoint like /add/3/5 which returns the sum of the 2 numbers
To add an endpoint like `/add/3/5` that returns the sum of the two numbers, you can create a new route with two URL parameters. Update the `app.py` file as follows:
@@ -62,6 +64,8 @@ Now, when you visit `/add/3/5`, it will return the sum of the two numbers, which
> Applied edit to app.py
> Commit 0872c51 aider: Added an endpoint `/add//` that returns the sum of the two numbers.
+
+
#### add /fibonacci/X
To add a `/fibonacci/X` endpoint that returns the Xth number in the Fibonacci sequence, you can create a new route with a URL parameter for X and a function to calculate the Fibonacci number. Update the `app.py` file as follows:
@@ -101,6 +105,8 @@ Now, when you visit `/fibonacci/X`, it will return the Xth number in the Fibonac
> Applied edit to app.py
> Commit 163fba8 aider: Added a `/fibonacci/X` endpoint that returns the Xth number in the Fibonacci sequence.
+
+
#### remove the hello endpoint
To remove the `/hello` endpoint, you can simply delete the corresponding route and function in the `app.py` file. Here's the update:
diff --git a/examples/no-color.md b/examples/no-color.md
index 8cc3042ce..c018ebc55 100644
--- a/examples/no-color.md
+++ b/examples/no-color.md
@@ -2,13 +2,13 @@
# Honor the NO_COLOR environment variable
The user pastes the specification of the NO_COLOR environment variable protocol
-from [no-color.org](https://no-color.org) into the chat with GPT-4.
+from [no-color.org](https://no-color.org) into the aider chat.
-GPT figures out which files need to be edited, and asks permission to make changes.
+Aider figures out which files need to be edited, and asks permission to make changes.
It then disables all the color and pretty-printing functions if NO_COLOR is
set, so the tool conforms to the specification.
-The user then asks for a test case, which GPT adds as well.
+The user then asks for a test case, which aider adds as well.
@@ -107,6 +107,8 @@ These changes will make the software check for the `NO_COLOR` environment variab
> Applied edit to aider/io.py
> Commit 3218242 aider: Added check for NO_COLOR environment variable to disable ANSI color.
+
+
#### add a test
To add a test for the `NO_COLOR` environment variable, we will create a new test function in the `tests/test_io.py` file. Since this file does not exist, we will create it first.
@@ -138,6 +140,8 @@ This test function checks if the `pretty` attribute of the `InputOutput` class i
> Applied edit to tests/test_io.py
> Commit 52a9df5 aider: Added a test function to check if the `pretty` attribute of the `InputOutput` class is set to `False` when the `NO_COLOR` environment variable is set.
+
+
#### /run pytest
> ============================= test session starts ==============================
diff --git a/examples/pong.md b/examples/pong.md
index d5268563f..6b89ed23e 100644
--- a/examples/pong.md
+++ b/examples/pong.md
@@ -1,5 +1,5 @@
-# Build pong with aider, gpt-4 and pygame.
+# Build pong with aider and pygame.
In this chat transcript, the user asks to make a pong game using pygame.
After setting up a basic game, the user asks for some customization of the colors and game mechanics.
@@ -68,6 +68,8 @@ This is the basic structure of the game. Now, let's add the Paddle and Ball clas
> Applied edit to pong_game.py
> Commit 14799cb aider: Added basic Pygame initialization and game loop structure to `pong_game.py`.
+
+
#### go ahead
Now, let's add the Paddle and Ball classes, handle user input, update the ball position, draw the objects, and handle scoring. I'll provide the code changes in an *EDIT BLOCK*.
@@ -218,6 +220,8 @@ Now, you should have a simple Pong game using Pygame. You can further improve th
> Applied edit to pong_game.py
> Commit b20bcee aider: Added Paddle and Ball classes, handled user input, updated ball position, drew objects, and handled scoring.
+
+
#### nice, it works. but the ball moves way too fast.
I'm glad it works! Let's slow down the ball by reducing its speed. We can do this by changing the values of `self.dx` and `self.dy` in the `Ball` class.
@@ -238,6 +242,8 @@ This change will reduce the ball's speed by half. You can adjust the values furt
> Applied edit to pong_game.py
> Commit f4ceed4 aider: Reduced ball speed by half.
+
+
#### can you make the paddles a bit bigger? and make one paddle red and one blue?
Sure, let's make the paddles bigger and change their colors. We can do this by modifying the `Paddle` class in the `pong_game.py` file.
@@ -277,6 +283,8 @@ With these changes, the paddles will be larger, and the left paddle will be red
> Applied edit to pong_game.py
> Commit 2c645c9 aider: Changed paddle size and color, and set left paddle to red.
+
+
#### each time the ball bounces off the paddle, can you make it go 10% faster?
Sure, let's increase the ball's speed by 10% each time it bounces off a paddle. We can do this by modifying the `collide_with` method in the `Ball` class.
diff --git a/examples/semantic-search-replace.md b/examples/semantic-search-replace.md
index 212a7dff3..9b8e11bf2 100644
--- a/examples/semantic-search-replace.md
+++ b/examples/semantic-search-replace.md
@@ -1,4 +1,4 @@
-# Semantic search & replace code with aider and gpt-4
+# Semantic search & replace code with aider
In this chat transcript, the user asks to modify a series of function calls.
diff --git a/examples/update-docs.md b/examples/update-docs.md
index ca956b5f8..94164845e 100644
--- a/examples/update-docs.md
+++ b/examples/update-docs.md
@@ -1,4 +1,4 @@
-# Automatically update docs with aider and gpt-4
+# Automatically update docs with aider
In this chat transcript, the user asks to automatically update the Usage docs based on the latest version of the main() function in the code.
diff --git a/requirements.in b/requirements.in
index bbf213d8a..1da3cbafa 100644
--- a/requirements.in
+++ b/requirements.in
@@ -12,7 +12,6 @@ numpy
scipy
backoff
pathspec
-networkx<3.3 # 3.3 no longer works on python 3.9
diskcache
grep_ast
packaging
@@ -27,3 +26,10 @@ pypandoc
litellm
google-generativeai
streamlit
+flake8
+
+# v3.3 no longer works on python 3.9
+networkx<3.3
+
+# v0.22.2 seems to break tree-sitter-languages?
+tree-sitter==0.21.3
diff --git a/requirements.txt b/requirements.txt
index abf014eae..90a340ccb 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -56,11 +56,13 @@ distro==1.9.0
# via openai
filelock==3.14.0
# via huggingface-hub
+flake8==7.0.0
+ # via -r requirements.in
frozenlist==1.4.1
# via
# aiohttp
# aiosignal
-fsspec==2024.3.1
+fsspec==2024.5.0
# via huggingface-hub
gitdb==4.0.11
# via gitpython
@@ -68,14 +70,14 @@ gitpython==3.1.43
# via
# -r requirements.in
# streamlit
-google-ai-generativelanguage==0.6.2
+google-ai-generativelanguage==0.6.4
# via google-generativeai
google-api-core[grpc]==2.19.0
# via
# google-ai-generativelanguage
# google-api-python-client
# google-generativeai
-google-api-python-client==2.128.0
+google-api-python-client==2.129.0
# via google-generativeai
google-auth==2.29.0
# via
@@ -86,7 +88,7 @@ google-auth==2.29.0
# google-generativeai
google-auth-httplib2==0.2.0
# via google-api-python-client
-google-generativeai==0.5.2
+google-generativeai==0.5.4
# via -r requirements.in
googleapis-common-protos==1.63.0
# via
@@ -94,7 +96,7 @@ googleapis-common-protos==1.63.0
# grpcio-status
greenlet==3.0.3
# via playwright
-grep-ast==0.2.4
+grep-ast==0.3.1
# via -r requirements.in
grpcio==1.63.0
# via
@@ -133,12 +135,14 @@ jsonschema==4.22.0
# altair
jsonschema-specifications==2023.12.1
# via jsonschema
-litellm==1.36.2
+litellm==1.37.16
# via -r requirements.in
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via jinja2
+mccabe==0.7.0
+ # via flake8
mdurl==0.1.2
# via markdown-it-py
multidict==6.0.5
@@ -156,7 +160,7 @@ numpy==1.26.4
# pydeck
# scipy
# streamlit
-openai==1.26.0
+openai==1.30.1
# via
# -r requirements.in
# litellm
@@ -178,7 +182,7 @@ pillow==10.3.0
# via
# -r requirements.in
# streamlit
-playwright==1.43.0
+playwright==1.44.0
# via -r requirements.in
prompt-toolkit==3.0.43
# via -r requirements.in
@@ -195,7 +199,7 @@ protobuf==4.25.3
# grpcio-status
# proto-plus
# streamlit
-pyarrow==16.0.0
+pyarrow==16.1.0
# via streamlit
pyasn1==0.6.0
# via
@@ -203,6 +207,8 @@ pyasn1==0.6.0
# rsa
pyasn1-modules==0.4.0
# via google-auth
+pycodestyle==2.11.1
+ # via flake8
pycparser==2.22
# via cffi
pydantic==2.7.1
@@ -211,10 +217,12 @@ pydantic==2.7.1
# openai
pydantic-core==2.18.2
# via pydantic
-pydeck==0.9.0
+pydeck==0.9.1
# via streamlit
pyee==11.1.0
# via playwright
+pyflakes==3.2.0
+ # via flake8
pygments==2.18.0
# via rich
pypandoc==1.13
@@ -235,7 +243,7 @@ referencing==0.35.1
# via
# jsonschema
# jsonschema-specifications
-regex==2024.4.28
+regex==2024.5.15
# via tiktoken
requests==2.31.0
# via
@@ -275,7 +283,7 @@ streamlit==1.34.0
# via -r requirements.in
tenacity==8.3.0
# via streamlit
-tiktoken==0.6.0
+tiktoken==0.7.0
# via
# -r requirements.in
# litellm
@@ -293,7 +301,9 @@ tqdm==4.66.4
# huggingface-hub
# openai
tree-sitter==0.21.3
- # via tree-sitter-languages
+ # via
+ # -r requirements.in
+ # tree-sitter-languages
tree-sitter-languages==1.10.2
# via grep-ast
typing-extensions==4.11.0
@@ -315,5 +325,5 @@ wcwidth==0.2.13
# via prompt-toolkit
yarl==1.9.4
# via aiohttp
-zipp==3.18.1
+zipp==3.18.2
# via importlib-metadata