mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 21:04:59 +00:00
chat -> coder
This commit is contained in:
parent
692e649c3f
commit
eea2c87210
1 changed files with 16 additions and 15 deletions
31
coder.py
31
coder.py
|
@ -24,7 +24,7 @@ MAKE NO OTHER CHANGES!
|
||||||
Do not provide explanations!
|
Do not provide explanations!
|
||||||
'''
|
'''
|
||||||
|
|
||||||
class Chat:
|
class Coder:
|
||||||
fnames = []
|
fnames = []
|
||||||
def system(self, prompt):
|
def system(self, prompt):
|
||||||
self.system_prompt = prompt
|
self.system_prompt = prompt
|
||||||
|
@ -82,7 +82,9 @@ class Chat:
|
||||||
def update_file(self, fname):
|
def update_file(self, fname):
|
||||||
prompt = self.prompt
|
prompt = self.prompt
|
||||||
prompt += f'''
|
prompt += f'''
|
||||||
Output the updated version of {fname.name}
|
Output the new {fname.name} which includes all the requested changes.
|
||||||
|
MAKE NO OTHER CHANGES.
|
||||||
|
Just output {fname.name}.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
messages = [
|
messages = [
|
||||||
|
@ -90,7 +92,7 @@ Output the updated version of {fname.name}
|
||||||
dict(role = 'user', content = prompt),
|
dict(role = 'user', content = prompt),
|
||||||
]
|
]
|
||||||
|
|
||||||
content = chat.send(messages)
|
content = self.send(messages)
|
||||||
if content.strip() == 'NONE':
|
if content.strip() == 'NONE':
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -103,23 +105,22 @@ Output the updated version of {fname.name}
|
||||||
lines = lines[:-1]
|
lines = lines[:-1]
|
||||||
fname.write_text('\n'.join(lines))
|
fname.write_text('\n'.join(lines))
|
||||||
|
|
||||||
chat = Chat()
|
coder = Coder()
|
||||||
|
|
||||||
chat.system(prompt_webdev)
|
coder.system(prompt_webdev)
|
||||||
|
|
||||||
dname = Path('../easy-chat')
|
dname = Path('../easy-chat')
|
||||||
chat.file(dname / 'index.html')
|
coder.file(dname / 'index.html')
|
||||||
chat.file(dname / 'chat.css')
|
coder.file(dname / 'chat.css')
|
||||||
chat.file(dname / 'chat.js')
|
coder.file(dname / 'chat.js')
|
||||||
|
|
||||||
#for fname in chat.fnames:
|
#for fname in coder.fnames:
|
||||||
# print(chat.quoted_file(fname))
|
# print(coder.quoted_file(fname))
|
||||||
#sys.exit()
|
#sys.exit()
|
||||||
|
|
||||||
chat.request('''
|
coder.request('''
|
||||||
Right now the speaker icons come after the text in each speech bubble.
|
Make the speaker icons red.
|
||||||
Move all the speaker icons so they come before the text.
|
|
||||||
''')
|
''')
|
||||||
|
|
||||||
chat.setup()
|
coder.setup()
|
||||||
chat.update_files()
|
coder.update_files()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue