import gradio as gr import google.generativeai as genai import textstat import re import os from datetime import datetime import tempfile class PRArticleGenerator: def __init__(self): self.pr_prompt = """ π§ SYSTEM ROLE: You are an elite PR copywriter and strategic storyteller, trusted by Forbes-level publishers, corporate PR firms, and influential entrepreneurs. Your role is to transform raw business content, personal bios, investment stories, or news leads into a **professionally polished, elite-grade PR article** optimized for SEO, brand perception, and high-impact online publication. π― OBJECTIVE: - Transform the user's input into a **trustworthy, media-ready PR article with strategic depth and journalistic integrity**. - Use a **neutral-positive, authoritative, and sophisticated tone**βlike a feature in Bloomberg, Forbes, or Business Insider. - Follow a **Rank Math-optimized structure** to improve search visibility and engagement, ensuring narrative flow and impactful messaging. π§ CONTENT STRATEGY: Mimic top-tier PR publications using this structure: 1. **Headline (`
`, `
Transform any content into professional, high-impact PR-style articles optimized for SEO and top-tier media consumption.
Business Acquisition: "Global tech leader InnovateCo today announced its strategic acquisition of cutting-edge AI startup, Nexus Solutions, for $150 million in cash. The acquisition aims to integrate Nexus's patented machine learning algorithms into InnovateCo's enterprise software suite, enhancing predictive analytics capabilities for Fortune 500 clients. InnovateCo CEO, Dr. Anya Sharma, stated, 'This acquisition is a pivotal moment for us, accelerating our AI roadmap and solidifying our leadership in intelligent automation.' Nexus Solutions, founded by visionary AI engineer Mark Chen, is renowned for its breakthroughs in unsupervised learning and has consistently been recognized for its innovation in the AI landscape."
Product Launch: "Sustainable Energy Corp. unveils 'EcoGrid Pro,' a revolutionary smart grid management software designed to optimize renewable energy distribution by 40%. The system leverages AI to predict energy demand fluctuations and seamlessly integrate solar and wind power into existing grids. Early pilot programs with major utility providers in California and Germany demonstrated a 25% reduction in energy waste. CEO Elena Petrova highlights, 'EcoGrid Pro isn't just a product; it's a commitment to a more resilient and sustainable energy future.' The company plans a global rollout in Q3 2025."
Executive Profile: "Dr. David Kim, newly appointed Chief Innovation Officer at BioSynth Labs, brings over two decades of experience in pharmaceutical R&D, including leading three blockbuster drug development programs at PharmaGiant Inc. A graduate of Stanford University with a Ph.D. in Molecular Biology, Dr. Kim is known for his pioneering work in CRISPR gene-editing technologies. His vision for BioSynth Labs focuses on accelerating therapeutic breakthroughs for neurodegenerative diseases and establishing new industry benchmarks for drug discovery. He believes, 'True innovation stems from a relentless pursuit of curiosity and a collaborative spirit to challenge existing paradigms.'"