-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Remove space from language #680
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
https://discord.com/channels/1146610656779440188/1164496324591353946/1164496324591353946 The LLM might have put a space between code block start and language: "``` python ". Added Error handling to get better error messages.
interpreter/core/respond.py
Outdated
interpreter._code_interpreters[language] = create_code_interpreter(language) | ||
code_interpreter = interpreter._code_interpreters[language] | ||
else: | ||
print(f"{language} not in supported languages.") |
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.
What should happen when language is not in language_map?
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.
Probably something like what you have here where we say something like: Error: Open Interpreter does not currently support {language}.
and then we might need to yield that as output to make sure open interpreter recognizes the issue.
I'm not sure how to give feedback back to Open-interpreter.
Now it writes the code but disables the ability to run the code. |
@Notnaton Just had one tiny little change, and then I think this is good to go. This is a really nice improvement for the end user. Great work! |
@ericrallen Final fix done :) |
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.
Thanks for digging into the language
edge case with the space and also making our handling of unsupported languages way more robust.
This is great.
Great work @Notnaton! Merging. |
Remove space from language Former-commit-id: ece546f Former-commit-id: 8879d9101df512de635762ffc5a6e9aed0e70f05 Former-commit-id: 0e81ccc72dc5d24dc01d7d6cd0af1b57eddd8586 [formerly 9f75e5a62fa2c290a72e4fbcf4ef2d7d27bd5099] Former-commit-id: 07078e9f5913931cdb9f5400d2d0abd0f7b415a0
Remove space from language
The LLM might have put a space between code block start and language: "``` python ". Added Error handling to get better error messages.
Describe the changes you have made:
Remove space from "language"
Added try/except to handle other errors with better error message.
Reference any relevant issue (Fixes #000)
Discord issue
https://discord.com/channels/1146610656779440188/1164496324591353946/1164496324591353946
I have tested the code on the following OS:
AI Language Model (if applicable)