genai-rss-space / app.py
8shanrahan2
Initial commit ๐Ÿš€
42b5a1a
raw
history blame
900 Bytes
import gradio as gr
from rss_reader import fetch_articles
from agent import analyze_article
from renderer import render_html
def process_rss(rss_input):
rss_urls = [url.strip() for url in rss_input.strip().splitlines() if url.strip()]
raw_articles = fetch_articles(rss_urls)
analyzed = [analyze_article(a['text'], a['title'], a['link']) for a in raw_articles]
return render_html(analyzed)
default_rss = """https://rss.nytimes.com/services/xml/rss/nyt/Technology.xml
https://www.reutersagency.com/feed/?best-sectors=technology"""
iface = gr.Interface(
fn=process_rss,
inputs=gr.Textbox(label="Enter RSS URLs (one per line)", value=default_rss, lines=4),
outputs=gr.HTML(label="๐Ÿ“Š GenAI RSS Digest"),
title="GenAI RSS Summarizer",
description="Summarizes articles and detects whatโ€™s useful to analytics teams"
)
if __name__ == "__main__":
iface.launch()