ragV98 commited on
Commit
a34a7f0
Β·
1 Parent(s): 62a4bec

Revamped prompt

Browse files
Files changed (1) hide show
  1. components/generators/daily_feed.py +14 -4
components/generators/daily_feed.py CHANGED
@@ -28,12 +28,22 @@ redis_client = redis.Redis.from_url(REDIS_URL, decode_responses=True)
28
  # πŸ“° Topics to summarize
29
  TOPICS = ["India news", "World news", "Tech news", "Finance news", "Sports news"]
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  # ✍️ Build Mistral prompt
32
  def build_prompt(content: str, topic: str) -> str:
33
- return (
34
- f"You are a news summarizer. Summarize the following content in 25-30 words. "
35
- f"Make it engaging and informative. Include appropriate emojis. Topic: {topic}\n\n{content}"
36
- )
37
 
38
  # 🧠 Send prompt to Mistral
39
  HEADERS = {
 
28
  # πŸ“° Topics to summarize
29
  TOPICS = ["India news", "World news", "Tech news", "Finance news", "Sports news"]
30
 
31
+ BASE_PROMPT = """
32
+ You are the official news summarizer for Nuse β€” a global, AI-powered news delivery platform. Your tone is factual, insightful, and engaging. Summarize news articles in a crisp, modern format.
33
+
34
+ Instructions:
35
+ - Write in 25–30 words only.
36
+ - Generate response organically and avoid trimming words to fit within the limit.
37
+ - Highlight key facts: who, what, when, where, and why.
38
+ - Use a professional tone, but include 1–2 well-placed emojis for engagement.
39
+ - Avoid any mention of Nuse, yourself, or the prompt.
40
+ - Never repeat headlines or include generic filler.
41
+ - Only return the summary. Do not include prompt, context, or metadata.
42
+ """
43
+
44
  # ✍️ Build Mistral prompt
45
  def build_prompt(content: str, topic: str) -> str:
46
+ return f"{BASE_PROMPT.strip()}\n\nTopic: {topic}\n\n{content.strip()}"
 
 
 
47
 
48
  # 🧠 Send prompt to Mistral
49
  HEADERS = {