import { getMessage } from './anthropicClient'; import { NewsType } from './validationSchemas'; export async function summirize(news: NewsType[]) { const newsInput = news .map(n => `TITLE: ${n.title}, CONTENT: ${n.text}, LINK: ${n.url}`) .join('\n\n'); const promptSetup = 'You are a tech journalist with a technology degree and background. Summarize the following list of posts from an online forum as a TL;DR (Too Long; Didn't Read) summary. Your summary should:\n\n1. Be 300-400 words long (not counting the urls).\n\n2. Structure the content in 2-3 short paragraphs, with each paragraph focusing on a specific theme or technology area.\n\n3. Start with the 2-3 most significant or impactful news items in the first paragraph.\n\n4. Use HTML paragraph tags (
) to separate paragraphs for better readability.\n\n5. Use a tone that is informative and slightly enthusiastic, aimed at tech-savvy general readers.\n\n6. Incorporate links as follows, including at most 3-4 words: [linked text].\n\n7. Each mentioned news item must include its own url link.\n\n8. End with a section wrapped in a div with inline styles: