mirror of
https://github.com/stackblitz/bolt.new
synced 2025-02-06 04:48:04 +00:00
feat: better prompt enhancement
This commit is contained in:
parent
d41a4acb89
commit
e25bb28255
@ -31,6 +31,7 @@ https://thinktank.ottomator.ai
|
|||||||
- ✅ Ability to revert code to earlier version (@wonderwhy-er)
|
- ✅ Ability to revert code to earlier version (@wonderwhy-er)
|
||||||
- ✅ Cohere Integration (@hasanraiyan)
|
- ✅ Cohere Integration (@hasanraiyan)
|
||||||
- ✅ Dynamic model max token length (@hasanraiyan)
|
- ✅ Dynamic model max token length (@hasanraiyan)
|
||||||
|
- ✅ Better prompt enhancing (@SujalXplores)
|
||||||
- ⬜ **HIGH PRIORITY** - Prevent Bolt from rewriting files as often (file locking and diffs)
|
- ⬜ **HIGH PRIORITY** - Prevent Bolt from rewriting files as often (file locking and diffs)
|
||||||
- ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start)
|
- ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start)
|
||||||
- ⬜ **HIGH PRIORITY** - Load local projects into the app
|
- ⬜ **HIGH PRIORITY** - Load local projects into the app
|
||||||
@ -43,7 +44,6 @@ https://thinktank.ottomator.ai
|
|||||||
- ⬜ Vertex AI Integration
|
- ⬜ Vertex AI Integration
|
||||||
- ⬜ Deploy directly to Vercel/Netlify/other similar platforms
|
- ⬜ Deploy directly to Vercel/Netlify/other similar platforms
|
||||||
- ⬜ Prompt caching
|
- ⬜ Prompt caching
|
||||||
- ⬜ Better prompt enhancing
|
|
||||||
- ⬜ Have LLM plan the project in a MD file for better results/transparency
|
- ⬜ Have LLM plan the project in a MD file for better results/transparency
|
||||||
- ⬜ VSCode Integration with git-like confirmations
|
- ⬜ VSCode Integration with git-like confirmations
|
||||||
- ⬜ Upload documents for knowledge - UI design templates, a code base to reference coding style, etc.
|
- ⬜ Upload documents for knowledge - UI design templates, a code base to reference coding style, etc.
|
||||||
|
@ -44,9 +44,28 @@ async function enhancerAction({ context, request }: ActionFunctionArgs) {
|
|||||||
content:
|
content:
|
||||||
`[Model: ${model}]\n\n[Provider: ${providerName}]\n\n` +
|
`[Model: ${model}]\n\n[Provider: ${providerName}]\n\n` +
|
||||||
stripIndents`
|
stripIndents`
|
||||||
|
You are a professional prompt engineer specializing in crafting precise, effective prompts.
|
||||||
|
Your task is to enhance prompts by making them more specific, actionable, and effective.
|
||||||
|
|
||||||
I want you to improve the user prompt that is wrapped in \`<original_prompt>\` tags.
|
I want you to improve the user prompt that is wrapped in \`<original_prompt>\` tags.
|
||||||
|
|
||||||
IMPORTANT: Only respond with the improved prompt and nothing else!
|
For valid prompts:
|
||||||
|
- Make instructions explicit and unambiguous
|
||||||
|
- Add relevant context and constraints
|
||||||
|
- Remove redundant information
|
||||||
|
- Maintain the core intent
|
||||||
|
- Ensure the prompt is self-contained
|
||||||
|
- Use professional language
|
||||||
|
|
||||||
|
For invalid or unclear prompts:
|
||||||
|
- Respond with a clear, professional guidance message
|
||||||
|
- Keep responses concise and actionable
|
||||||
|
- Maintain a helpful, constructive tone
|
||||||
|
- Focus on what the user should provide
|
||||||
|
- Use a standard template for consistency
|
||||||
|
|
||||||
|
IMPORTANT: Your response must ONLY contain the enhanced prompt text.
|
||||||
|
Do not include any explanations, metadata, or wrapper tags.
|
||||||
|
|
||||||
<original_prompt>
|
<original_prompt>
|
||||||
${message}
|
${message}
|
||||||
@ -79,7 +98,7 @@ async function enhancerAction({ context, request }: ActionFunctionArgs) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const transformedStream = result.toAIStream().pipeThrough(transformStream);
|
const transformedStream = result.toDataStream().pipeThrough(transformStream);
|
||||||
|
|
||||||
return new StreamingTextResponse(transformedStream);
|
return new StreamingTextResponse(transformedStream);
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
|
Loading…
Reference in New Issue
Block a user