File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,6 +157,9 @@ email-validator>=2.2.0 # Pydantic email 验证依赖
157157# Logging
158158loguru >= 0.7.0
159159
160+ # Environment Variable Management
161+ python-dotenv >= 1.0.0
162+
160163# Office Document Parsing (MarkItDown backend)
161164markitdown [all ]>= 0.1.3
162165
Original file line number Diff line number Diff line change 2020from pathlib import Path
2121import argparse
2222from utils import parse_list_arg
23+ from dotenv import load_dotenv
2324
2425
2526class TianshuLauncher :
@@ -283,6 +284,14 @@ def wait(self):
283284
284285def main ():
285286 """主函数"""
287+ env_path = Path (__file__ ).parent / ".env"
288+ if env_path .exists ():
289+ load_dotenv (dotenv_path = env_path )
290+ logger .info (f"✅ Loaded .env from: { env_path } " )
291+ else :
292+ logger .error (f"❌ .env file not found at: { env_path } " )
293+ logger .error ("Please create a .env file in the backend directory with required environment variables" )
294+ sys .exit (1 )
286295 parser = argparse .ArgumentParser (
287296 description = "MinerU Tianshu - 统一启动脚本" ,
288297 formatter_class = argparse .RawDescriptionHelpFormatter ,
You can’t perform that action at this time.
0 commit comments