bc485b44b8
- Enhanced README.md with a clearer project overview, features, technologies used, and installation instructions. - Updated vector dimension in config.py from 4096 to 1024 for Cohere embeddings. - Modified main.py to serve HTML responses for the home page, news fetching, and recommendations. - Improved error handling and ensured articles have links in the responses. - Cleaned up news_fetcher.py by removing unnecessary print statements. - Updated recommender.py to refine insights generation and summary extraction. - Added Jinja2 for templating and improved the project structure for better organization. - Included API documentation for better understanding of endpoints and usage.
39 lines
1.0 KiB
Python
39 lines
1.0 KiB
Python
import os
|
|
from dotenv import load_dotenv
|
|
|
|
# Load environment variables
|
|
|
|
# Construct the path to the .env file
|
|
# dotenv_path = os.path.join(os.path.dirname(__file__), '..', '.env')
|
|
|
|
# Load environment variables from the specified path
|
|
load_dotenv()
|
|
|
|
# API Keys
|
|
COHERE_API_KEY = os.getenv("COHERE_API_KEY")
|
|
GROQ_API_KEY = os.getenv("GROQ_API_KEY")
|
|
PINECONE_API_KEY = os.getenv("PINECONE_API_KEY")
|
|
|
|
# Pinecone Configuration
|
|
PINECONE_INDEX_NAME = os.getenv("PINECONE_INDEX_NAME", "news-articles")
|
|
|
|
# News Sources
|
|
RSS_FEEDS = [
|
|
"https://feeds.feedburner.com/TechCrunch/",
|
|
# "https://www.theverge.com/rss/index.xml",
|
|
# "https://www.wired.com/feed/rss",
|
|
# "https://www.technologyreview.com/feed/",
|
|
]
|
|
|
|
# Vector Database Settings
|
|
VECTOR_DIMENSION = 1024 # Cohere embedding dimension
|
|
TOP_K_RESULTS = 5
|
|
|
|
# Data Directories
|
|
RAW_NEWS_DIR = "data/raw_news"
|
|
PROCESSED_NEWS_DIR = "data/processed_news"
|
|
|
|
# Create directories if they don't exist
|
|
os.makedirs(RAW_NEWS_DIR, exist_ok=True)
|
|
os.makedirs(PROCESSED_NEWS_DIR, exist_ok=True)
|