mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
copy
This commit is contained in:
parent
2eced6ce12
commit
771bea1fa4
13 changed files with 34 additions and 31 deletions
|
@ -126,8 +126,11 @@ Aider can help the LLM figure out which files to edit all by itself, but the mos
|
|||
* If your code is throwing an error, share the error output with the LLM using `/run` or by pasting it into the chat. Let the LLM figure out and fix the bug.
|
||||
* LLMs know about a lot of standard tools and libraries, but may get some of the fine details wrong about APIs and function arguments. You can paste doc snippets into the chat to resolve these issues.
|
||||
* The LLM can only see the content of the files you specifically "add to the chat". Aider also sends a [map of your entire git repo](https://aider.chat/docs/repomap.html). So the LLM may ask to see additional files if it feels that's needed for your requests.
|
||||
* I also shared some general [LLM coding tips on Hacker News](https://news.ycombinator.com/item?id=36211879).
|
||||
|
||||
## Example chat transcripts
|
||||
|
||||
[The example transcripts page](/examples/README.md) shows how you can chat with `aider` to write
|
||||
and edit code.
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
<div class="chat-transcript" markdown="1">
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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`.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
<div class="chat-transcript" markdown="1">
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
<div class="chat-transcript" markdown="1">
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue