I’m trying to control the code cloned from bolt.diy, to handle multiple types of messages ( not only related to code ) .
but most of them answers opening code editor . how I can control this thing ?
I know it might seem dumb, but I just tried this and it seemed to work:
I ONLY WANT TO CHAT. DO NOT OPEN THE CODE EDITOR.
Hello
So it’s really just controlled by the system prompt, which you can modify. Currently the system prompt is static and tells the AI how to use Bolt, the terminal, and Artifacts. We really should have a light weight “Reasoner” model like QwQ to say classify the request and determine the details instead with say a primer or memory database with reference on how to use Artifacts, Terminal, etc. (if needed instead of ALWAYS provided). That would be a lot more efficient at Token usage and should result in better results.
So what you could do, is make a new system prompt that you tell to Classify the user input to one of the following categories: Code, Math, Science, Conversation, etc.
. Then have a list of conditional statements that add context to each “category”.
Something like:
if category=="Code":
system_prompt = "Systematically break down the problem into steps, plan and document process BEFORE writing any code. If request is ambiguous, get clarification from the user...."
...
<artifact_info>
<artifact_instructions>
...
</artifact_instructions>
</artifact_info>
Of course you would make this more dynamic by making “pieces” that build the prompt, but this is effectively what the “reasoner” would do.
Take a look at ./app/lib/common/prompts/prompts.ts
.