-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: Could not parse following text as code edit: #841
Comments
I believe this could be loosely related to #814 in that the diff head sections of the diffs are not completely clean. |
I do get the same error : |
Thanks for reporting. We are working on a solution to make code improve more reliable. |
For clarification, it happened after specifically asking to refactor a long python file into smaller ones, and I believe the edit structure ('>>>>' ...) wasn't part of the newly generated files making the function raise the error. |
@ATheorell any up? |
I'm looking at implementing #869 together with @similato87 to improve on this front. If you are interested in joining this effort, you are more than welcome. |
I get the same error, basically unable to use the improvement as it errors out in the middle : ValueError: Could not parse following text as code edit |
Hello @RiccardoRomagnoli, @LRpz, @Chemformalixer, I'm thrilled to share that we've developed a solid approach to addressing these challenges. @ATheorell and I have rigorously tested it across a range of parsing tasks, and the results with the GPT-engineer are promising. Moreover, for tasks that surpass the capabilities of existing LLMs, our project will ensure accurate change instructions, providing an opportunity for you to optimize your token usage. No waste token anymore :) @RiccardoRomagnoli. |
Great! This is very exciting news. Do you know when you'd like to release the update? |
It is already released in the main branch. Release on pip will follow in a few days to allow for potential feedback @LRpz |
Expected Behavior
Improve the code
Current Behavior
Error gets thrown
Failure Information
Traceback (most recent call last):
File "/home/riccardo/.local/bin/gpt-engineer", line 8, in
sys.exit(app())
File "/home/riccardo/.local/lib/python3.10/site-packages/gpt_engineer/cli/main.py", line 169, in main
messages = step(ai, dbs)
File "/home/riccardo/.local/lib/python3.10/site-packages/gpt_engineer/core/steps.py", line 588, in improve_existing_code
overwrite_files_with_edits(messages[-1].content.strip(), dbs)
File "/home/riccardo/.local/lib/python3.10/site-packages/gpt_engineer/core/chat_to_files.py", line 219, in overwrite_files_with_edits
edits = parse_edits(chat)
File "/home/riccardo/.local/lib/python3.10/site-packages/gpt_engineer/core/chat_to_files.py", line 268, in parse_edits
return parse_all_edits(llm_response)
File "/home/riccardo/.local/lib/python3.10/site-packages/gpt_engineer/core/chat_to_files.py", line 255, in parse_all_edits
edits.append(parse_one_edit(current_edit))
File "/home/riccardo/.local/lib/python3.10/site-packages/gpt_engineer/core/chat_to_files.py", line 240, in parse_one_edit
raise ValueError(f"Could not parse following text as code edit: \n{text}")
Steps to Reproduce
I'm using this prompt:
Also, I got charged :'(
The text was updated successfully, but these errors were encountered: