import streamlit as st from newspaper import Article from dotenv import load_dotenv load_dotenv() import google.generativeai as genai import os # Configure Google Generative AI with API key genai.configure(api_key=os.getenv("GOOGLE_API_KEY")) # Function to get a response from the Gemini AI model def get_gemini_response(input): model = genai.GenerativeModel("gemini-pro") response = model.generate_content(input) return response.text # Function to scrape content from the given URL using newspaper3k def scrape_content(url): try: article = Article(url, language='en') # Specify language for better parsing article.download() article.parse() return article.text except Exception as e: st.error(f"Error fetching the content from the website: {e}") return None # Streamlit app configuration st.set_page_config(page_title="News Summarizer") st.markdown("