Phoenix21's picture
Create config.py
b5475f0 verified
raw
history blame contribute delete
481 Bytes
# config.py
import os
import logging
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger(__name__)
def clean_api_key(key: str) -> str:
return ''.join(c for c in key if ord(c) < 128).strip()
for key in ["GEMINI_API_KEY", "GROQ_API_KEY"]:
if not os.environ.get(key):
raise ValueError(f"Environment variable {key} is not set.")
gemini_api_key = clean_api_key(os.environ["GEMINI_API_KEY"])
groq_api_key = clean_api_key(os.environ["GROQ_API_KEY"])