--- title: NewsIntel Agent emoji: πŸ’» colorFrom: indigo colorTo: purple sdk: gradio app_file: app.py python_version: 3.11 pinned: false sdk_version: 5.42.0 --- πŸ—žοΈ NewsIntel Agent β€” Job Briefings & Hiring Signals A Gradio app that pulls recent news, generates grounded summaries, detects entities & sentiment, and produces interview-ready briefings (HTML/PDF). Includes one-click modes (Healthcare / Finance / R&D), caching, charts, and optional S3/SES export + weekly email. ✨ Features Google/press-release RSS + your custom get_news source LLM-generated grounded summaries (via your services.llm.summarize) Entity extraction, keywording, sentiment Trend & simple 7-day forecast (linear fit on daily sentiment) Briefing export: HTML (built-in) and PDF (optional, via reportlab) Optional S3 upload + SES weekly email πŸ“ Repository layout (minimum) β”œβ”€ app.py # (rename your gradio_app -> app.py) β”œβ”€ requirements.txt β”œβ”€ README.md β”œβ”€ services/ β”‚ β”œβ”€ init.py β”‚ β”œβ”€ search.py # must define get_news(query, days, k) -> list[dict] β”‚ β”œβ”€ llm.py # must define summarize(prompt) -> str β”‚ β”œβ”€ huggingface_nlp.py # must define analyze_sentiment, analyze_entities, extract_keywords β”‚ β”œβ”€ aws.py # optional: s3_upload(path), ses_send_email(to, subj, html) β”‚ └─ cache.py # get_cache(*keys), set_cache(obj, *keys) Do NOT upload your local .env. Use Spaces β†’ Settings β†’ Variables & secrets instead. πŸ”§ Environment variables (set in Spaces β†’ Settings β†’ Variables & secrets) Only set what you actually use in your services/ modules. If your services/llm.py calls OpenAI (example): OPENAI_API_KEY If your services/llm.py calls Hugging Face Inference API (example): HF_TOKEN If enabling S3 uploads in services/aws.py: AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_DEFAULT_REGION (e.g., us-east-1) S3_BUCKET (bucket name) If enabling SES emails in services/aws.py: SES_SENDER_EMAIL (verified in SES) (same AWS creds/region as above) If these aren’t set, the app will still run; S3/SES buttons will simply show fallback messages. ▢️ Run locally python -m venv .venv && source .venv/bin/activate # on Windows: .venv\Scripts\activate pip install -r requirements.txt python app.py