update personas to add Tone
This commit is contained in:
+12
-1
@@ -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 = (
|
||||
|
||||
Reference in New Issue
Block a user