|
|
|
|
@ -497,6 +497,12 @@ def summarize_with_gpt4o(content, source_name, link, interest_score=0, extra_pro |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
summary = response.choices[0].message.content.strip() |
|
|
|
|
|
|
|
|
|
# Post-processing: Normalize paragraph separation to ensure a single \n break |
|
|
|
|
# Split by any combination of newlines, filter out empty paragraphs, and join with a single \n |
|
|
|
|
paragraphs = [p.strip() for p in summary.split('\n') if p.strip()] |
|
|
|
|
summary = '\n'.join(paragraphs) |
|
|
|
|
|
|
|
|
|
logging.info(f"Processed summary (Persona: {persona}): {summary}") |
|
|
|
|
return summary |
|
|
|
|
|
|
|
|
|
|