Add .env file loading — cp .env.example .env and edit

This commit is contained in:
Jarvis Prime
2026-03-04 04:41:48 +00:00
parent 66f9f03409
commit 6ebd8f8d28
2 changed files with 19 additions and 0 deletions

View File

@@ -4,6 +4,16 @@ import requests
import os
import concurrent.futures
import time
from pathlib import Path
# Load .env if present
_env_file = Path(__file__).parent / ".env"
if _env_file.exists():
for line in _env_file.read_text().splitlines():
line = line.strip()
if line and not line.startswith("#") and "=" in line:
key, _, val = line.partition("=")
os.environ.setdefault(key.strip(), val.strip())
# Backend: "ollama" or "openai"
LLM_BACKEND = os.environ.get("LLM_BACKEND", "ollama")