shroominic / codeinterpreter-api

👾 Open source implementation of the ChatGPT Code Interpreter
https://discord.gg/Vaq25XJvvW
MIT License
3.76k stars 400 forks source link

Fixed newline SyntaxError #136

Closed erickfm closed 11 months ago

erickfm commented 11 months ago

Added some prompting to the python tool to resolve https://github.com/shroominic/codeinterpreter-api/issues/135 where multi-line code strings are not processed correctly if they're not formatted in compliance with Python's string literal rules. Specifically, the interpreter fails when the code string starts with a newline right after the opening quote or doesn't use triple quotes for multi-line code snippets. This leads to an unended string literal error because the interpreter expects a complete string format as per Python syntax rules.