mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
show messages
This commit is contained in:
parent
99106a1b98
commit
a070c357a0
2 changed files with 12 additions and 7 deletions
15
coder.py
15
coder.py
|
@ -109,8 +109,8 @@ class Coder:
|
||||||
messages += [
|
messages += [
|
||||||
dict(role = 'user', content = files_content),
|
dict(role = 'user', content = files_content),
|
||||||
dict(role = 'assistant', content = "Ok."),
|
dict(role = 'assistant', content = "Ok."),
|
||||||
dict(role = 'user', content = inp + prompts.user_suffix),
|
dict(role = 'user', content = inp),
|
||||||
dict(role = 'system', content = 'ONLY RETURN CODE USING THE ORIGINAL/UPDATED FORMAT!'),
|
dict(role = 'system', content = 'REMEMBER, ONLY RETURN CODE USING THE ORIGINAL/UPDATED FORMAT!'),
|
||||||
]
|
]
|
||||||
|
|
||||||
content = self.send(messages)
|
content = self.send(messages)
|
||||||
|
@ -134,9 +134,16 @@ class Coder:
|
||||||
print()
|
print()
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
def send(self, messages, show_progress = 0):
|
def show_messages(self, messages):
|
||||||
for msg in messages:
|
for msg in messages:
|
||||||
dump(msg)
|
print()
|
||||||
|
print('-' * 50)
|
||||||
|
role = msg['role'].upper()
|
||||||
|
content = msg['content']
|
||||||
|
print(f'{role}: {content.strip()}')
|
||||||
|
|
||||||
|
def send(self, messages, show_progress = 0):
|
||||||
|
self.show_messages(messages)
|
||||||
|
|
||||||
completion = openai.ChatCompletion.create(
|
completion = openai.ChatCompletion.create(
|
||||||
model="gpt-3.5-turbo",
|
model="gpt-3.5-turbo",
|
||||||
|
|
|
@ -98,9 +98,7 @@ files_content_prefix_edited = 'I made your suggested changes, here are the updat
|
||||||
|
|
||||||
files_content_prefix_plain = 'Here are the files I need you to edit:\n\n'
|
files_content_prefix_plain = 'Here are the files I need you to edit:\n\n'
|
||||||
|
|
||||||
files_content_suffix = ''
|
files_content_suffix = '''
|
||||||
|
|
||||||
user_suffix = '''
|
|
||||||
|
|
||||||
BASE ANY EDITS ON THE CURRENT CONTENTS OF THE FILES AS SHOWN IN THIS MESSAGE.
|
BASE ANY EDITS ON THE CURRENT CONTENTS OF THE FILES AS SHOWN IN THIS MESSAGE.
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue