Spaces:
Sleeping
Sleeping
Update Prompt_Builder.py
Browse files- Prompt_Builder.py +22 -27
Prompt_Builder.py
CHANGED
|
@@ -1,33 +1,28 @@
|
|
| 1 |
def build_prompt(user_text, file_text, link_info, mentions, hashtags, custom_prompt, checked_suggestions):
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
prompt +=
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
if link_info:
|
| 12 |
-
prompt += f"Reference Link: {link_info.get('url')} ({link_info.get('description')})\n"
|
| 13 |
-
|
| 14 |
-
# Mentions
|
| 15 |
-
if mentions:
|
| 16 |
-
for m in mentions:
|
| 17 |
-
prompt += f"Mention {m.get('name')} ({m.get('role')}): {m.get('purpose')} | Link: {m.get('linkedin_url')}\n"
|
| 18 |
-
|
| 19 |
-
# Hashtags
|
| 20 |
if hashtags:
|
| 21 |
-
prompt += f"Include hashtags: {', '.join(hashtags)}\n"
|
| 22 |
-
|
| 23 |
-
# Custom user instructions
|
| 24 |
if custom_prompt:
|
| 25 |
-
prompt += f"User Instructions: {custom_prompt}\n"
|
| 26 |
-
|
| 27 |
-
# AI suggestions
|
| 28 |
-
if checked_suggestions:
|
| 29 |
-
prompt += f"Include suggestions: {', '.join(checked_suggestions)}\n"
|
| 30 |
|
| 31 |
-
|
| 32 |
-
prompt += "
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
return prompt
|
|
|
|
| 1 |
def build_prompt(user_text, file_text, link_info, mentions, hashtags, custom_prompt, checked_suggestions):
|
| 2 |
+
# Professional Persona
|
| 3 |
+
prompt = "You are an expert LinkedIn Content Strategist and Ghostwriter for top-tier tech executives.\n\n"
|
| 4 |
+
|
| 5 |
+
# Context Injection
|
| 6 |
+
prompt += f"CONTEXT DATA:\n- User Input: {user_text}\n"
|
| 7 |
+
if file_text:
|
| 8 |
+
prompt += f"- Extracted Info from Document: {file_text}\n"
|
| 9 |
+
|
| 10 |
+
if link_info and link_info.get('url'):
|
| 11 |
+
prompt += f"- Reference Link: {link_info['url']} ({link_info.get('description', '')})\n"
|
| 12 |
|
| 13 |
+
# Style Requirements
|
| 14 |
+
prompt += "\nSTYLE GUIDELINES:\n"
|
| 15 |
+
if checked_suggestions:
|
| 16 |
+
prompt += f"- Critical Elements: {', '.join(checked_suggestions)}\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
if hashtags:
|
| 18 |
+
prompt += f"- Include these hashtags: {', '.join(hashtags)}\n"
|
|
|
|
|
|
|
| 19 |
if custom_prompt:
|
| 20 |
+
prompt += f"- Specific User Instructions: {custom_prompt}\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
prompt += "\nOUTPUT FORMAT:\n"
|
| 23 |
+
prompt += "1. Write in a human-like, engaging tone (not robotic).\n"
|
| 24 |
+
prompt += "2. Use 'scroll-stopping' hooks.\n"
|
| 25 |
+
prompt += "3. Ensure professional formatting with appropriate spacing and emojis.\n"
|
| 26 |
+
prompt += "4. Provide 2 variations: one short/punchy, one detailed/story-driven."
|
| 27 |
+
|
| 28 |
return prompt
|