update personas to add Tone

This commit is contained in:
2025-04-28 18:30:09 +10:00
parent 1f1c5012c7
commit a1d2ce4215
5 changed files with 166 additions and 75 deletions
+12 -1
View File
@@ -339,7 +339,18 @@ def generate_title_from_summary(summary):
def summarize_with_gpt4o(content, source_name, link, interest_score=0, extra_prompt=""):
try:
persona = select_best_persona(interest_score, content)
prompt = SUMMARY_PERSONA_PROMPTS.get(persona, "Write a concise, engaging summary that captures the essence of the content for food lovers.")
# Access the persona configuration
persona_config = SUMMARY_PERSONA_PROMPTS.get(persona, {
"prompt": "Write a concise, engaging summary that captures the essence of the content for food lovers.",
"description": "a generic food writer",
"tone": "an engaging tone"
})
# Format the prompt using description and tone
prompt = persona_config["prompt"].format(
description=persona_config["description"],
tone=persona_config["tone"],
num_paragraphs=determine_paragraph_count(interest_score)
)
logging.info(f"Using {persona} with interest_score and content")
full_prompt = (