ai-web-summarizer

This commit is contained in:
arafat
2025-01-27 19:08:54 +08:00
parent 2c16f20416
commit d7021cbeb2
10 changed files with 343 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import os
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
class Config:
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
if __name__ == "__main__":
print("Your OpenAI Key is:", Config.OPENAI_API_KEY)

View File

@@ -0,0 +1,16 @@
import logging
# Setup logging configuration
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(message)s",
handlers=[
logging.FileHandler("app.log"),
logging.StreamHandler()
]
)
logger = logging.getLogger(__name__)
if __name__ == "__main__":
logger.info("Logger is working correctly.")