Commit
Β·
aef26f1
1
Parent(s):
83191d3
prompt enhanchment
Browse files- README.md +1 -1
- app/routes/api.enhancer.ts +18 -2
README.md
CHANGED
@@ -35,6 +35,7 @@ https://thinktank.ottomator.ai
|
|
35 |
- β
Load local projects into the app (@wonderwhy-er)
|
36 |
- β
Together Integration (@mouimet-infinisoft)
|
37 |
- β
Mobile friendly (@qwikode)
|
|
|
38 |
- β¬ **HIGH PRIORITY** - ALMOST DONE - Attach images to prompts (@atrokhym)
|
39 |
- β¬ **HIGH PRIORITY** - Prevent Bolt from rewriting files as often (file locking and diffs)
|
40 |
- β¬ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start)
|
@@ -43,7 +44,6 @@ https://thinktank.ottomator.ai
|
|
43 |
- β¬ Perplexity Integration
|
44 |
- β¬ Vertex AI Integration
|
45 |
- β¬ Deploy directly to Vercel/Netlify/other similar platforms
|
46 |
-
- β¬ Better prompt enhancing
|
47 |
- β¬ Have LLM plan the project in a MD file for better results/transparency
|
48 |
- β¬ VSCode Integration with git-like confirmations
|
49 |
- β¬ Upload documents for knowledge - UI design templates, a code base to reference coding style, etc.
|
|
|
35 |
- β
Load local projects into the app (@wonderwhy-er)
|
36 |
- β
Together Integration (@mouimet-infinisoft)
|
37 |
- β
Mobile friendly (@qwikode)
|
38 |
+
- β
Better prompt enhancing (@SujalXplores)
|
39 |
- β¬ **HIGH PRIORITY** - ALMOST DONE - Attach images to prompts (@atrokhym)
|
40 |
- β¬ **HIGH PRIORITY** - Prevent Bolt from rewriting files as often (file locking and diffs)
|
41 |
- β¬ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start)
|
|
|
44 |
- β¬ Perplexity Integration
|
45 |
- β¬ Vertex AI Integration
|
46 |
- β¬ Deploy directly to Vercel/Netlify/other similar platforms
|
|
|
47 |
- β¬ Have LLM plan the project in a MD file for better results/transparency
|
48 |
- β¬ VSCode Integration with git-like confirmations
|
49 |
- β¬ Upload documents for knowledge - UI design templates, a code base to reference coding style, etc.
|
app/routes/api.enhancer.ts
CHANGED
@@ -44,9 +44,25 @@ async function enhancerAction({ context, request }: ActionFunctionArgs) {
|
|
44 |
content:
|
45 |
`[Model: ${model}]\n\n[Provider: ${providerName}]\n\n` +
|
46 |
stripIndents`
|
|
|
|
|
47 |
I want you to improve the user prompt that is wrapped in \`<original_prompt>\` tags.
|
48 |
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
<original_prompt>
|
52 |
${message}
|
@@ -79,7 +95,7 @@ async function enhancerAction({ context, request }: ActionFunctionArgs) {
|
|
79 |
},
|
80 |
});
|
81 |
|
82 |
-
const transformedStream = result.
|
83 |
|
84 |
return new StreamingTextResponse(transformedStream);
|
85 |
} catch (error: unknown) {
|
|
|
44 |
content:
|
45 |
`[Model: ${model}]\n\n[Provider: ${providerName}]\n\n` +
|
46 |
stripIndents`
|
47 |
+
You are a professional prompt engineer specializing in crafting precise, effective prompts.
|
48 |
+
Your task is to enhance prompts by making them more specific, actionable, and effective.
|
49 |
I want you to improve the user prompt that is wrapped in \`<original_prompt>\` tags.
|
50 |
|
51 |
+
For valid prompts:
|
52 |
+
- Make instructions explicit and unambiguous
|
53 |
+
- Add relevant context and constraints
|
54 |
+
- Remove redundant information
|
55 |
+
- Maintain the core intent
|
56 |
+
- Ensure the prompt is self-contained
|
57 |
+
- Use professional language
|
58 |
+
For invalid or unclear prompts:
|
59 |
+
- Respond with a clear, professional guidance message
|
60 |
+
- Keep responses concise and actionable
|
61 |
+
- Maintain a helpful, constructive tone
|
62 |
+
- Focus on what the user should provide
|
63 |
+
- Use a standard template for consistency
|
64 |
+
IMPORTANT: Your response must ONLY contain the enhanced prompt text.
|
65 |
+
Do not include any explanations, metadata, or wrapper tags.
|
66 |
|
67 |
<original_prompt>
|
68 |
${message}
|
|
|
95 |
},
|
96 |
});
|
97 |
|
98 |
+
const transformedStream = result.toDataStream().pipeThrough(transformStream);
|
99 |
|
100 |
return new StreamingTextResponse(transformedStream);
|
101 |
} catch (error: unknown) {
|