open-interpreter icon indicating copy to clipboard operation
open-interpreter copied to clipboard

Identation issues when working on Python scripts

Open stevenbaert opened this issue 1 year ago • 2 comments

Describe the bug

I really appreciate this project, but I often find myself turning to ChatGPT for assistance with Python code because the open interpreter repeatedly struggles to understand, modify, and accurately produce code. I'm working with GPT-4, which ends up using a significant amount of tokens as I go through numerous iterations to rectify its mistakes.

Reproduce

I've requested reviews for several Python scripts, seeking advice on enhancements. While it does offer valuable suggestions, it consistently introduces indentation errors in the scripts. Despite acknowledging these mistakes with apologies for incorrect indentation, the issue recurs, leading me to manually adjust the indentations. Consequently, I find it more reliable to consult ChatGPT, although it's regrettable that I have to resort to this approach.

Expected behavior

Correct writing of code into Python files.

Screenshots

No response

Open Interpreter version

0.2.0

Python version

3.10.12

Operating System name and version

Mac OS

Additional context

No response

stevenbaert avatar Feb 14 '24 09:02 stevenbaert

Hi @stevenbaert, could you please save and share one of your chats with OI as a JSON file? The command to save a chat is %save_message [path] – see docs for reference here. Seeing the proceeding chat history which led to the indentation errors could provide valuable insights.

MrJarnould avatar Feb 15 '24 01:02 MrJarnould

Surprised to see that this isn't a known issue. I have it from the start using Open Interpreter and never saw any improvements. It is also the reason I switched to ChatGPT back and forth when coding Python Open Interpreter fails to write coherent code in files and costs lots of tokens in doing so. Could provide you input but this is default behavior when you ask open interpreter to go through Python code and improve/review then write that code. At least with all the Python code I worked with and that's nothing really special. Would be a life changer it Open Interpreter could do where I need Chatgpt for now. Btw any chance Open Interpreter could have like OpenAI’s GPTs features so it can fetch sources like website or docs when helping yoi/me out during coding or other tasks?

stevenbaert avatar Feb 15 '24 22:02 stevenbaert