News Agent is an intelligent AI-powered news assistant that provides real-time news updates and summaries. It combines the power of Google Search API, OpenAI's GPT models, and advanced text processing to deliver accurate and concise news information through both text and voice interfaces.
- π Real-Time News Updates: Fetches latest news using Google Search API
- π§ AI-Powered Summarization: Generates concise summaries using OpenAI GPT-3.5
- π Regional News Support: Switch between Global and India-specific news
- π¬ Interactive Chat Interface: User-friendly web interface for news interaction
- π€ Voice Assistant: Complete voice interaction with speech recognition and synthesis
- π Text-to-Speech: Converts news summaries to speech using ElevenLabs
- π Multi-Source Aggregation: Aggregates news from various reliable sources
- πΎ Chat History: Persistent conversation history using Supabase
- π User Authentication: Secure login and signup system
- π± Responsive Design: Works seamlessly on desktop and mobile devices
- Backend: Python 3.12, Flask
- AI/ML: OpenAI GPT-3.5 Turbo, NLTK
- APIs: Google Search API (SerpAPI), ElevenLabs Text-to-Speech
- Database: Supabase (PostgreSQL)
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Web Scraping: BeautifulSoup4, Requests
- Deployment: Vercel
- Clone the repository:
git clone https://github.com/dhruvldrp9/NewsAgent.git cd NewsAgent - Set up environment variables:
OPENAI_API_KEY- Your OpenAI API keyGOOGLE_NEWS_API_KEY- Your SerpAPI keyELEVENLABS_API_KEY- Your ElevenLabs API keySUPABASE_URL- Your Supabase project URLSUPABASE_ANON_KEY- Your Supabase anon keySUPABASE_SERVICE_ROLE_KEY- Your Supabase service role keySECRET_KEY- A secure secret key for sessions
- Deploy to Vercel or run locally with
python app.py
- API keys for:
- OpenAI (GPT API)
- SerpAPI (Google Search)
- ElevenLabs (Text-to-Speech)
- Supabase (Database)
- Visit OpenAI Platform
- Create account and get API key
- Add to environment variables as
OPENAI_API_KEY
- Visit SerpAPI
- Sign up for free account (250 searches/month)
- Add to environment variables as
GOOGLE_NEWS_API_KEY
- Visit ElevenLabs
- Sign up and get API key
- Add to environment variables as
ELEVENLABS_API_KEY
- Visit Supabase
- Create new project
- Get URL, anon key, and service role key
- Add to environment variables
- Navigate to the main chat interface
- Select news region (Global/India)
- Ask questions about current news
- Get AI-powered summaries and insights
- Click on "Voice Assistant" in the header
- Tap the microphone button to start
- Speak your news query
- Listen to AI-generated audio responses
NewsAgent/
βββ app.py # Main Flask application
βββ models/
β βββ Communication_OpenAI.py # Core AI communication logic
β βββ chat_model.py # Chat model interface
β βββ WebScrapper1.py # Web scraping utilities
β βββ database.py # Supabase database interface
β βββ summarizer.py # Text summarization
βββ templates/ # HTML templates
βββ static/ # CSS, JS, and static assets
βββ requirements.txt # Python dependencies
βββ env.example # Environment variables template
This application is deployed on Vercel. To deploy your own instance:
- Fork this repository
- Connect your GitHub account to Vercel
- Import the repository in Vercel
- Set up environment variables in Vercel dashboard
- Deploy automatically
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
- Make your changes and test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Developer: Dhruv Patel
- Email: dhruv.ldrp9@gmail.com
- LinkedIn: linkedin.com/in/dhruvp9
- GitHub: @dhruvldrp9
Live Demo: newsagent.dhruv.at