LlamaFinetuneGGUF commited on
Commit
aef26f1
Β·
1 Parent(s): 83191d3

prompt enhanchment

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. 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
- IMPORTANT: Only respond with the improved prompt and nothing else!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
 
51
  <original_prompt>
52
  ${message}
@@ -79,7 +95,7 @@ async function enhancerAction({ context, request }: ActionFunctionArgs) {
79
  },
80
  });
81
 
82
- const transformedStream = result.toAIStream().pipeThrough(transformStream);
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) {