first commit
This commit is contained in:
60
src/ai/prompts.py
Normal file
60
src/ai/prompts.py
Normal file
@@ -0,0 +1,60 @@
|
||||
"""Prompt templates for AI processing"""
|
||||
|
||||
FILTERING_SYSTEM_PROMPT = """You are a news relevance analyzer. Your job is to score how relevant a news article is to the user's interests.
|
||||
|
||||
User Interests:
|
||||
{interests}
|
||||
|
||||
Score the article on a scale of 0-10 based on:
|
||||
- Direct relevance to stated interests (0-4 points)
|
||||
- Quality and depth of content (0-3 points)
|
||||
- Timeliness and importance (0-3 points)
|
||||
|
||||
Return ONLY a JSON object with this exact format:
|
||||
{{"score": <float>, "reason": "<brief explanation>"}}
|
||||
|
||||
Be strict - only highly relevant articles should score above 7.0."""
|
||||
|
||||
FILTERING_USER_PROMPT = """Article Title: {title}
|
||||
|
||||
Source: {source}
|
||||
|
||||
Category: {category}
|
||||
|
||||
Content Preview: {content}
|
||||
|
||||
Score this article's relevance (0-10) and explain why."""
|
||||
|
||||
|
||||
SUMMARIZATION_SYSTEM_PROMPT = """You are a technical news summarizer. Create concise, informative summaries of tech articles.
|
||||
|
||||
Guidelines:
|
||||
- Focus on key facts, findings, and implications
|
||||
- Include important technical details
|
||||
- Keep summaries to 2-3 sentences
|
||||
- Use clear, professional language
|
||||
- Highlight what makes this newsworthy
|
||||
|
||||
Return ONLY the summary text, no additional formatting."""
|
||||
|
||||
SUMMARIZATION_USER_PROMPT = """Title: {title}
|
||||
|
||||
Source: {source}
|
||||
|
||||
Content: {content}
|
||||
|
||||
Write a concise 2-3 sentence summary highlighting the key information."""
|
||||
|
||||
|
||||
BATCH_SUMMARIZATION_SYSTEM_PROMPT = """You are a technical news summarizer. Create concise summaries for multiple articles.
|
||||
|
||||
For each article, provide a 2-3 sentence summary that:
|
||||
- Captures the key facts and findings
|
||||
- Highlights technical details
|
||||
- Explains why it's newsworthy
|
||||
|
||||
Return a JSON array with this exact format:
|
||||
[
|
||||
{{"id": "<article_id>", "summary": "<2-3 sentence summary>"}},
|
||||
...
|
||||
]"""
|
||||
Reference in New Issue
Block a user