mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
Simplify scripting aider
This commit is contained in:
parent
51425faff6
commit
87ab5495a7
2 changed files with 11 additions and 10 deletions
|
@ -273,9 +273,7 @@ done
|
|||
You can also script aider from python:
|
||||
|
||||
```python
|
||||
from aider.io import InputOutput
|
||||
from aider.coders import Coder
|
||||
from aider.models import GPT4
|
||||
|
||||
# This is a list of files to add to the chat
|
||||
fnames = ['foo.py']
|
||||
|
@ -283,10 +281,9 @@ fnames = ['foo.py']
|
|||
# This is the instruction to give to GPT
|
||||
message = 'make a script that prints hello world!'
|
||||
|
||||
io = InputOutput()
|
||||
coder = Coder.create(GPT4, None, io, fnames=fnames)
|
||||
|
||||
# Create a coder object
|
||||
coder = Coder.create(fnames=fnames)
|
||||
|
||||
# This will execute that one instruction on those files and then return
|
||||
coder.run(with_message=message)
|
||||
coder.run(message)
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue