This commit is contained in:
Paul Gauthier 2023-04-11 12:53:56 -07:00
parent bfbf6e3e96
commit 4feb57e9c9

View file

@ -140,8 +140,6 @@ class Coder:
] ]
content = self.send(messages) content = self.send(messages)
dump(repr(content))
cur_messages += [ cur_messages += [
dict(role = 'assistant', content = content), dict(role = 'assistant', content = content),
] ]
@ -227,7 +225,7 @@ class Coder:
partial_line = '' partial_line = ''
for chunk in completion: for chunk in completion:
if chunk.choices[0].finish_reason: if chunk.choices[0].finish_reason not in (None, 'stop'):
dump(chunk.choices[0].finish_reason) dump(chunk.choices[0].finish_reason)
try: try:
text = chunk.choices[0].delta.content text = chunk.choices[0].delta.content
@ -376,8 +374,4 @@ coder = Coder()
for fname in sys.argv[1:]: for fname in sys.argv[1:]:
coder.add_file(fname) coder.add_file(fname)
#coder.update_files(Path('tmp.commands').read_text()) ; sys.exit()
content = 'new.py\n<<<<<<< ORIGINAL\n# Removed the nth_prime endpoint\n=======\n>>>>>>> UPDATED'
coder.update_files(content, 'remove the prime comment'); sys.exit()
coder.run() coder.run()