Skip to content
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

Chatbot now only creates Python code #654

Open
angelhodar opened this issue Dec 21, 2024 · 2 comments
Open

Chatbot now only creates Python code #654

angelhodar opened this issue Dec 21, 2024 · 2 comments

Comments

@angelhodar
Copy link

angelhodar commented Dec 21, 2024

I have updated the code and now the chatbot refuses to create any code that is not Python. You can test it in chat.vercel.ai as well

image

I know its because of this line in the first prompt in prompts.ts

When asked to write code, always use blocks. When writing code, specify the language in the backticks, e.g. \`\`\`python\`code here\`\`\`. The default language is Python. Other languages are not yet supported, so let the user know if they request a different language.

But it should be able to just generate plain code in other languages even if its not executable. I have modified the prompt but the generated typescript code is not shown formatted, only python code is formatted somehow.

@JuniYadi
Copy link

Screenshot 2024-12-23 at 17 32 47

we can make a different language but it's still a prompt console for Python, probably needs changes too

change the codePrompt => https://github.com/vercel/ai-chatbot/blob/main/lib/ai/prompts.ts

@athrael-soju
Copy link

athrael-soju commented Dec 23, 2024

This looks intentional, as the app uses pyodide to run the generated Python code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants