-
Notifications
You must be signed in to change notification settings - Fork 424
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
Syntax Error in AI-Generated Code Snippet with TypeScript (TSX) in Code Sandbox #1
Comments
did you try again? working fine for me on all of the models |
I tried to optimize the prompt so this shouldn't happen! Lemme know if it's still happening |
Try removing such tags with regex text = text.replace(/```(tsx|typescript|javascript)?/g, ""); |
Yes, it's still happening. Maybe infrequently, but it is. The TS code can filter those out, as @kamaravichow said above. |
Sounds good, thanks for letting me know! I reviewed @kamaravichow's PR and requested some changes, so we'll try to get this fixed :) |
When generating a code snippet using the AI model, the code is rendered with an incorrect syntax that causes a syntax error in a TypeScript (TSX) file. The generated code snippet includes "```tsx" at the beginning, which is not a valid TypeScript syntax and results in an error when executed.
prompt : build the chat APP
AI model : Gemma 2 27B
The text was updated successfully, but these errors were encountered: