-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Continue to run despite unsupported language #741
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
Conversation
} | ||
) | ||
break | ||
yield { | ||
"output": "continue if not finished. User declined to run the code" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prompt here could be better, I am not good at this. This seems to work ok for 7B models
response = input( | ||
" Would you like to run this code? (y/n)\n\n " | ||
) | ||
print("") # <- Aesthetic choice | ||
|
||
if response.strip().lower() == "y": | ||
interpreter.run_code_promt = True | ||
|
||
if interpreter.run_code_promt: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is an unnecessary condition.
We can just set the property to true and follow the code path in this condition without needing to check the value of the property we just set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a second check in respond.py
We need to know if we run the code or not and disable the code_interpreter.
https://github.com/KillianLucas/open-interpreter/pull/741/files#diff-1f2d9ffe69c9b4ee7009e36234869f2a03f0af75f0bef3a1f5b8dac2acbd736eR149
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, for that we need to set the interpreter.run_code_promt
(which I just noticed has a typo, can we make that interpreter.run_code_prompt
), but we don’t need this if
statement because at this point in the code that property can only have one value because we just set it a couple of lines above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it to stop it running the code regardless of y/n. It just didn't output the result when saying n.
I'll double check and come back to this after work 👍
See: Much better solution than my code |
Describe the changes you have made:
Tries to not stop interpreter when using unsupported language.
Still not perfect, looking for testers and feedback.
Reference any relevant issue (Fixes #000)
https://discord.com/channels/1146610656779440188/1171921044496470106
I have tested the code on the following OS:
AI Language Model (if applicable)