| """ |
| PIOE Configuration Management |
| """ |
| from pydantic_settings import BaseSettings |
| from functools import lru_cache |
| from typing import Literal |
|
|
|
|
| class Settings(BaseSettings): |
| """Application settings loaded from environment variables.""" |
| |
| |
| ai_provider: Literal["gemini", "openai"] = "gemini" |
| gemini_api_key: str = "" |
| openai_api_key: str = "" |
| |
| |
| reddit_client_id: str = "" |
| reddit_client_secret: str = "" |
| reddit_user_agent: str = "PIOE/1.0" |
| |
| |
| github_token: str = "" |
| |
| |
| |
| |
| |
| |
| |
| adzuna_app_id: str = "" |
| adzuna_api_key: str = "" |
| |
| |
| |
| jooble_api_key: str = "" |
| |
| |
| |
| rapidapi_key: str = "" |
| |
| |
| |
| |
| database_url: str = "sqlite:///./pioe.db" |
| |
| |
| ingestion_interval_hours: int = 6 |
| |
| |
| min_relevance_score: float = 0.3 |
| min_novelty_score: float = 0.3 |
| min_credibility_score: float = 0.5 |
| |
| |
| high_priority_keywords: list[str] = [ |
| "computer vision", "robotics", "ROS", "PyTorch", "TensorFlow", |
| "machine learning", "deep learning", "neural network", |
| "internship", "fellowship", "scholarship", "grant", "funding", |
| "hackathon", "competition", "challenge", "bounty", |
| "research assistant", "PhD", "postdoc", "hiring", |
| "early-stage", "seed", "Series A", "startup", |
| "AI", "artificial intelligence", "data science", "NLP" |
| ] |
| |
| class Config: |
| env_file = ".env" |
| env_file_encoding = "utf-8" |
| extra = "ignore" |
|
|
|
|
| @lru_cache |
| def get_settings() -> Settings: |
| """Get cached settings instance.""" |
| return Settings() |
|
|
|
|