Spaces:
Sleeping
Sleeping
| def build_prompt(user_text, file_text, link_info, mentions, hashtags, custom_prompt, checked_suggestions): | |
| # Professional Persona | |
| prompt = "You are an expert LinkedIn Content Strategist and Ghostwriter for top-tier tech executives.\n\n" | |
| # Context Injection | |
| prompt += f"CONTEXT DATA:\n- User Input: {user_text}\n" | |
| if file_text: | |
| prompt += f"- Extracted Info from Document: {file_text}\n" | |
| if link_info and link_info.get('url'): | |
| prompt += f"- Reference Link: {link_info['url']} ({link_info.get('description', '')})\n" | |
| # Style Requirements | |
| prompt += "\nSTYLE GUIDELINES:\n" | |
| if checked_suggestions: | |
| prompt += f"- Critical Elements: {', '.join(checked_suggestions)}\n" | |
| if hashtags: | |
| prompt += f"- Include these hashtags: {', '.join(hashtags)}\n" | |
| if custom_prompt: | |
| prompt += f"- Specific User Instructions: {custom_prompt}\n" | |
| prompt += "\nOUTPUT FORMAT:\n" | |
| prompt += "1. Write in a human-like, engaging tone (not robotic).\n" | |
| prompt += "2. Use 'scroll-stopping' hooks.\n" | |
| prompt += "3. Ensure professional formatting with appropriate spacing and emojis.\n" | |
| prompt += "4. Provide 2 variations: one short/punchy, one detailed/story-driven." | |
| return prompt |