|
|
|
@ -36,6 +36,7 @@ def get_viral_share_prompt(article_title, content): |
|
|
|
"Make it bold, quirky, and engaging with a Buzzfeed/Upworthy flair (e.g., 'Obsessed? Share Now'). " |
|
|
|
"Make it bold, quirky, and engaging with a Buzzfeed/Upworthy flair (e.g., 'Obsessed? Share Now'). " |
|
|
|
"Avoid clichés like 'game-changer' and words like 'elevate'. " |
|
|
|
"Avoid clichés like 'game-changer' and words like 'elevate'. " |
|
|
|
"Do not include emojis, the platform name (e.g., Twitter, Facebook), or any HTML. " |
|
|
|
"Do not include emojis, the platform name (e.g., Twitter, Facebook), or any HTML. " |
|
|
|
|
|
|
|
"Do not wrap the prompt in quotation marks. " |
|
|
|
"Return only the prompt text." |
|
|
|
"Return only the prompt text." |
|
|
|
) |
|
|
|
) |
|
|
|
response = client.chat.completions.create( |
|
|
|
response = client.chat.completions.create( |
|
|
|
@ -45,9 +46,11 @@ def get_viral_share_prompt(article_title, content): |
|
|
|
{"role": "user", "content": f"Title: {article_title}\nContent: {content}"} |
|
|
|
{"role": "user", "content": f"Title: {article_title}\nContent: {content}"} |
|
|
|
], |
|
|
|
], |
|
|
|
max_tokens=20, |
|
|
|
max_tokens=20, |
|
|
|
temperature=0.9 # Higher temperature for more creativity |
|
|
|
temperature=0.9 |
|
|
|
) |
|
|
|
) |
|
|
|
share_prompt = response.choices[0].message.content.strip() |
|
|
|
share_prompt = response.choices[0].message.content.strip() |
|
|
|
|
|
|
|
# Remove any leading or trailing quotation marks |
|
|
|
|
|
|
|
share_prompt = share_prompt.strip('"\'') |
|
|
|
logging.info(f"Generated viral share prompt: {share_prompt}") |
|
|
|
logging.info(f"Generated viral share prompt: {share_prompt}") |
|
|
|
return share_prompt |
|
|
|
return share_prompt |
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
@ -56,10 +59,8 @@ def get_viral_share_prompt(article_title, content): |
|
|
|
|
|
|
|
|
|
|
|
def select_best_cta(title, content, post_url=None): |
|
|
|
def select_best_cta(title, content, post_url=None): |
|
|
|
cta_templates = [ |
|
|
|
cta_templates = [ |
|
|
|
# Like-focused CTAs |
|
|
|
|
|
|
|
"Love This Foodie Find Hit That Like Button", |
|
|
|
"Love This Foodie Find Hit That Like Button", |
|
|
|
"Think This Dish Is a Game Changer Show Some Love With a Like", |
|
|
|
"Think This Dish Is a Game Changer Show Some Love With a Like", |
|
|
|
# Follow-focused CTAs |
|
|
|
|
|
|
|
"Hungry for More Foodie Insights Follow Us for the Latest Trends", |
|
|
|
"Hungry for More Foodie Insights Follow Us for the Latest Trends", |
|
|
|
"Dont Miss Out on Foodie Updates Follow Us Today" |
|
|
|
"Dont Miss Out on Foodie Updates Follow Us Today" |
|
|
|
] |
|
|
|
] |
|
|
|
|