Peterase commited on
Commit
1d5c812
Β·
1 Parent(s): 3fbed31

feat: refine search query and increase top stories limit to 6

Browse files
Files changed (1) hide show
  1. src/api/routes/top_stories.py +5 -5
src/api/routes/top_stories.py CHANGED
@@ -226,14 +226,14 @@ async def fetch_kafka_stories(n: int = 3) -> List[TopStory]:
226
 
227
  # ── DuckDuckGo: fetch N live stories ─────────────────────────────────────────
228
 
229
- async def fetch_live_stories(n: int = 4, adapter: DuckDuckGoAdapter = None) -> List[TopStory]:
230
  """Fetch N live stories from DuckDuckGo using the dedicated adapter"""
231
  if not adapter:
232
  return []
233
 
234
  try:
235
- # Search for fresh Ethiopia news
236
- query = "Ethiopia news today"
237
  results = await adapter.search(query)
238
 
239
  stories = []
@@ -288,8 +288,8 @@ async def get_top_stories(
288
 
289
  # Fetch both sources in parallel
290
  kafka_stories, live_stories = await asyncio.gather(
291
- fetch_kafka_stories(3),
292
- fetch_live_stories(4, adapter),
293
  )
294
 
295
  # Merge and deduplicate
 
226
 
227
  # ── DuckDuckGo: fetch N live stories ─────────────────────────────────────────
228
 
229
+ async def fetch_live_stories(n: int = 6, adapter: DuckDuckGoAdapter = None) -> List[TopStory]:
230
  """Fetch N live stories from DuckDuckGo using the dedicated adapter"""
231
  if not adapter:
232
  return []
233
 
234
  try:
235
+ # Focus on Ethiopia-related world-wide news
236
+ query = "Ethiopia related world-wide news today"
237
  results = await adapter.search(query)
238
 
239
  stories = []
 
288
 
289
  # Fetch both sources in parallel
290
  kafka_stories, live_stories = await asyncio.gather(
291
+ fetch_kafka_stories(4),
292
+ fetch_live_stories(6, adapter),
293
  )
294
 
295
  # Merge and deduplicate