File size: 3,305 Bytes
f154798
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
"""
Generation configuration settings for the LinkedIn Post Generator
"""

# Post length configurations
POST_LENGTHS = {
    "Short (100-200 words)": {"min_words": 100, "max_words": 200},
    "Medium (200-400 words)": {"min_words": 200, "max_words": 400},
    "Long (400-600 words)": {"min_words": 400, "max_words": 600}
}

# Tone configurations
TONES = {
    "Professional": "formal, business-like, authoritative",
    "Casual": "friendly, conversational, approachable",
    "Enthusiastic": "energetic, passionate, motivating",
    "Educational": "informative, instructional, helpful",
    "Inspirational": "motivational, uplifting, encouraging"
}

# Default settings
DEFAULT_SETTINGS = {
    "post_length": "Medium (200-400 words)",
    "tone": "Professional",
    "include_hashtags": True,
    "include_call_to_action": True,
    "max_hashtags": 5,
    "include_emoji": True
}

# Hashtag suggestions for common topics
HASHTAG_SUGGESTIONS = {
    "ai": ["#AI", "#ArtificialIntelligence", "#MachineLearning", "#Tech", "#Innovation"],
    "leadership": ["#Leadership", "#Management", "#Business", "#ProfessionalDevelopment", "#Career"],
    "remote_work": ["#RemoteWork", "#WorkFromHome", "#Productivity", "#DigitalTransformation", "#FutureOfWork"],
    "healthcare": ["#Healthcare", "#HealthTech", "#DigitalHealth", "#Innovation", "#PatientCare"],
    "business": ["#Business", "#Entrepreneurship", "#Strategy", "#Growth", "#Success"]
}

def get_generation_prompt(user_input, context="", settings=None):
    """
    Generate a formatted prompt for the AI agent based on user input and settings
    """
    if settings is None:
        settings = DEFAULT_SETTINGS
    
    prompt = f"Create a LinkedIn post about: {user_input}"
    
    if context:
        prompt += f"\n\nContext: {context}"
    
    # Add length requirements
    length_config = POST_LENGTHS.get(settings.get("post_length", DEFAULT_SETTINGS["post_length"]))
    prompt += f"\n\nLength: {length_config['min_words']}-{length_config['max_words']} words"
    
    # Add tone requirements
    tone = settings.get("tone", DEFAULT_SETTINGS["tone"])
    tone_description = TONES.get(tone, TONES["Professional"])
    prompt += f"\n\nTone: {tone_description}"
    
    # Add hashtag requirements
    if settings.get("include_hashtags", True):
        max_hashtags = settings.get("max_hashtags", 5)
        prompt += f"\n\nInclude {max_hashtags} relevant hashtags at the end"
    
    # Add call to action requirements
    if settings.get("include_call_to_action", True):
        prompt += "\n\nInclude a call to action at the end"
    
    # Add emoji requirements
    if settings.get("include_emoji", True):
        prompt += "\n\nUse emojis sparingly but effectively to enhance readability"
    
    # Add LinkedIn-specific formatting
    prompt += "\n\nFormat the post for LinkedIn with proper paragraph breaks and engaging opening"
    
    return prompt

def get_hashtag_suggestions(topic):
    """
    Get hashtag suggestions based on the topic
    """
    topic_lower = topic.lower()
    
    for key, hashtags in HASHTAG_SUGGESTIONS.items():
        if key in topic_lower:
            return hashtags
    
    # Return general hashtags if no specific match
    return ["#LinkedIn", "#Professional", "#Networking", "#Career", "#Business"]