Skip to content

Conversation

Notnaton
Copy link
Collaborator

@Notnaton Notnaton commented Oct 23, 2023

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 performed a self-review of my code:

I have tested the code on the following OS:

  • Windows
  • MacOS
  • Linux

AI Language Model (if applicable)

  • GPT4
  • GPT3
  • Llama 7B
  • Llama 13B
  • Llama 34B
  • Huggingface model (Please specify which one)

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._code_interpreters[language] = create_code_interpreter(language)
code_interpreter = interpreter._code_interpreters[language]
else:
print(f"{language} not in supported languages.")
Copy link
Collaborator Author

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?

Copy link
Collaborator

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.
@Notnaton
Copy link
Collaborator Author

Notnaton commented Oct 24, 2023

Now it writes the code but disables the ability to run the code.
It also adds a error message on top.
bilde
@ericrallen
I'm not sure how to give feedback to the LLM
Nvm... I figured out something
bilde

@Notnaton Notnaton requested a review from ericrallen October 24, 2023 15:16
@ericrallen
Copy link
Collaborator

ericrallen commented Oct 24, 2023

@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!

@Notnaton
Copy link
Collaborator Author

@ericrallen Final fix done :)

Copy link
Collaborator

@ericrallen ericrallen left a 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.

@ericrallen ericrallen added the Triaged Issue has been reviewed by maintainer label Oct 24, 2023
@ericrallen ericrallen removed the request for review from KillianLucas October 24, 2023 19:24
@KillianLucas
Copy link
Collaborator

Great work @Notnaton! Merging.

@KillianLucas KillianLucas merged commit ece546f into openinterpreter:main Oct 25, 2023
joshuavial pushed a commit to joshuavial/open-interpreter that referenced this pull request Nov 16, 2023
Remove space from language

Former-commit-id: ece546f
Former-commit-id: 8879d9101df512de635762ffc5a6e9aed0e70f05
Former-commit-id: 0e81ccc72dc5d24dc01d7d6cd0af1b57eddd8586 [formerly 9f75e5a62fa2c290a72e4fbcf4ef2d7d27bd5099]
Former-commit-id: 07078e9f5913931cdb9f5400d2d0abd0f7b415a0
joshuavial pushed a commit to joshuavial/open-interpreter that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triaged Issue has been reviewed by maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants