Initial release — OpenMontage: the first open-source agentic video production system
11 production pipelines, 47 tools, 124 agent skills. Supports cloud APIs (fal.ai, OpenAI, ElevenLabs, Suno, HeyGen, Runway) and free local providers (diffusers, Piper TTS, WAN 2.1, Hunyuan, CogVideo). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""Environment variable loader for OpenMontage.
|
||||
|
||||
Loads .env file and provides typed access to environment configuration.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
|
||||
def load_env(project_root: Optional[Path] = None) -> None:
|
||||
"""Load .env file from project root."""
|
||||
if project_root is None:
|
||||
project_root = Path(__file__).resolve().parent.parent
|
||||
env_path = project_root / ".env"
|
||||
if env_path.exists():
|
||||
load_dotenv(env_path)
|
||||
|
||||
|
||||
def get_env(key: str, default: Optional[str] = None) -> Optional[str]:
|
||||
"""Get an environment variable with optional default."""
|
||||
return os.environ.get(key, default)
|
||||
|
||||
|
||||
def require_env(key: str) -> str:
|
||||
"""Get a required environment variable. Raises if missing."""
|
||||
value = os.environ.get(key)
|
||||
if value is None:
|
||||
raise EnvironmentError(f"Required environment variable {key!r} is not set")
|
||||
return value
|
||||
Reference in New Issue
Block a user