Spaces:
Sleeping
Sleeping
Update prompts.py
Browse files- prompts.py +24 -5
prompts.py
CHANGED
|
@@ -1,5 +1,26 @@
|
|
| 1 |
from typing import List, Optional
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
def build_post_prompt(topic: str,
|
| 4 |
language: str,
|
| 5 |
tone: str,
|
|
@@ -14,7 +35,6 @@ def build_post_prompt(topic: str,
|
|
| 14 |
kw_block = ", ".join(keywords[:8]) if keywords else "N/A"
|
| 15 |
cues_block = "\n".join(f"- {c}" for c in style_cues[:4]) if style_cues else "- None"
|
| 16 |
hook_line = chosen_hook.strip() if chosen_hook else ""
|
| 17 |
-
|
| 18 |
return (
|
| 19 |
"You are a senior LinkedIn content strategist. "
|
| 20 |
"Write one viral, insightful LinkedIn post as plain text only (no section headers, no labels).\n\n"
|
|
@@ -32,10 +52,9 @@ def build_post_prompt(topic: str,
|
|
| 32 |
"Additional notes from clarifier (apply silently):\n"
|
| 33 |
f"{(clarifier_notes or 'None').strip()}\n\n"
|
| 34 |
f"Preferred opening line (if provided): {hook_line or 'None'}\n\n"
|
| 35 |
-
"Rules (
|
| 36 |
-
"- Curiosity-driven first sentence.\n"
|
| 37 |
-
"-
|
| 38 |
-
"- Max 2 emojis; 2–4 niche hashtags only at end (optional).\n"
|
| 39 |
"- No repeated sentences; avoid clichés.\n"
|
| 40 |
"- Return a single cohesive post in plain text only."
|
| 41 |
)
|
|
|
|
| 1 |
from typing import List, Optional
|
| 2 |
|
| 3 |
+
def build_quick_prompt(idea: str,
|
| 4 |
+
tone: str,
|
| 5 |
+
words: int,
|
| 6 |
+
include_emoji: bool,
|
| 7 |
+
add_hashtags: bool,
|
| 8 |
+
language: str) -> str:
|
| 9 |
+
return (
|
| 10 |
+
"You are a senior LinkedIn content strategist. "
|
| 11 |
+
"Write one cohesive LinkedIn post as plain text only (no section headers, no labels).\n\n"
|
| 12 |
+
f"Language: {language}\n"
|
| 13 |
+
f"Idea: {idea}\n"
|
| 14 |
+
f"Tone: {tone}\n"
|
| 15 |
+
f"Target length: ~{words} words\n"
|
| 16 |
+
"Rules (apply silently):\n"
|
| 17 |
+
f"- Emojis: {'allow up to 5' if include_emoji else 'no emojis'}.\n"
|
| 18 |
+
f"- Hashtags: {'append 2–4 niche hashtags at the very end' if add_hashtags else 'no hashtags'}.\n"
|
| 19 |
+
"- Curiosity-driven opening; short paragraphs; 3–5 concrete insights or examples.\n"
|
| 20 |
+
"- No repeated sentences;no Preamble avoid clichés.\n"
|
| 21 |
+
"- Return plain text only."
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
def build_post_prompt(topic: str,
|
| 25 |
language: str,
|
| 26 |
tone: str,
|
|
|
|
| 35 |
kw_block = ", ".join(keywords[:8]) if keywords else "N/A"
|
| 36 |
cues_block = "\n".join(f"- {c}" for c in style_cues[:4]) if style_cues else "- None"
|
| 37 |
hook_line = chosen_hook.strip() if chosen_hook else ""
|
|
|
|
| 38 |
return (
|
| 39 |
"You are a senior LinkedIn content strategist. "
|
| 40 |
"Write one viral, insightful LinkedIn post as plain text only (no section headers, no labels).\n\n"
|
|
|
|
| 52 |
"Additional notes from clarifier (apply silently):\n"
|
| 53 |
f"{(clarifier_notes or 'None').strip()}\n\n"
|
| 54 |
f"Preferred opening line (if provided): {hook_line or 'None'}\n\n"
|
| 55 |
+
"Rules (apply silently):\n"
|
| 56 |
+
"- Curiosity-driven first sentence; short paragraphs; 3–5 concrete insights.\n"
|
| 57 |
+
"- Max 2 emojis; 2–4 niche hashtags only at the end (optional).\n"
|
|
|
|
| 58 |
"- No repeated sentences; avoid clichés.\n"
|
| 59 |
"- Return a single cohesive post in plain text only."
|
| 60 |
)
|