@@ -90,15 +90,13 @@ private String buildPrompt(List<NewsItem> items) {
9090 prompt .append ("\n TASK:\n " );
9191 prompt .append ("1. Identify the TOP 3 most important updates (framework releases, major news)\n " );
9292 prompt .append ("2. List 3-5 quick mentions (interesting but less critical)\n " );
93- prompt .append ("3. Highlight 2-3 community discussions (Reddit/HN posts with high engagement)\n " );
94- prompt .append ("4. Provide a 1-sentence insight about trends you notice\n \n " );
93+ prompt .append ("3. Highlight 2-3 community discussions (Reddit/HN posts with high engagement)\n \n " );
9594
9695 prompt .append ("OUTPUT FORMAT (respond with ONLY this JSON, no markdown formatting):\n " );
9796 prompt .append ("{\n " );
9897 prompt .append (" \" topUpdates\" : [1, 3, 7], // indices of top 3 items\n " );
9998 prompt .append (" \" quickMentions\" : [2, 5, 9, 12], // indices of 3-5 items\n " );
100- prompt .append (" \" communityBuzz\" : [4, 8], // indices of 2-3 discussion items\n " );
101- prompt .append (" \" insight\" : \" One sentence about what's trending\" \n " );
99+ prompt .append (" \" communityBuzz\" : [4, 8] // indices of 2-3 discussion items\n " );
102100 prompt .append ("}\n " );
103101
104102 return prompt .toString ();
@@ -172,14 +170,12 @@ private Digest parseDigestResponse(String response, List<NewsItem> items) {
172170 List <NewsItem > topUpdates = extractItems (json , "topUpdates" , items );
173171 List <NewsItem > quickMentions = extractItems (json , "quickMentions" , items );
174172 List <NewsItem > communityBuzz = extractItems (json , "communityBuzz" , items );
175- String insight = json .has ("insight" ) ? json .get ("insight" ).getAsString () : "" ;
176173
177174 return Digest .builder ()
178175 .date (LocalDate .now ().format (DateTimeFormatter .ofPattern ("EEEE, MMMM d, yyyy" )))
179176 .topUpdates (topUpdates )
180177 .quickMentions (quickMentions )
181178 .communityBuzz (communityBuzz )
182- .insight (insight )
183179 .build ();
184180
185181 } catch (Exception e ) {
@@ -212,7 +208,6 @@ private Digest createEmptyDigest() {
212208 .topUpdates (new ArrayList <>())
213209 .quickMentions (new ArrayList <>())
214210 .communityBuzz (new ArrayList <>())
215- .insight ("No news items collected today." )
216211 .build ();
217212 }
218213
@@ -236,7 +231,6 @@ private Digest createFallbackDigest(List<NewsItem> items) {
236231 .topUpdates (topUpdates )
237232 .quickMentions (quickMentions )
238233 .communityBuzz (communityBuzz )
239- .insight ("Frontend development continues to evolve rapidly." )
240234 .build ();
241235 }
242236}
0 commit comments