Files
manual_slop/sloppy.py
T
ed 169fe52092 fix(ai_client_stub): add module-level import for GeminiCliAdapter
The class was only accessible inside function scopes, causing
AttributeError when app_controller tried to instantiate it
at module level via ai_client.GeminiCliAdapter().
2026-05-13 10:53:23 -04:00

30 lines
810 B
Python

import sys
import os
project_root = os.path.dirname(os.path.abspath(__file__))
if project_root not in sys.path:
sys.path.insert(0, project_root)
thirdparty = os.path.join(project_root, "thirdparty")
if thirdparty not in sys.path:
sys.path.insert(0, thirdparty)
os.environ["HF_HUB_DISABLE_SYMLINKS_WARNING"] = "1"
os.environ["HF_HUB_DISABLE_PROGRESS_BARS"] = "1"
os.environ["TOKENIZERS_PARALLELISM"] = "false"
os.environ["AI_SERVER_ENABLED"] = "1"
from defer.sugar import install as _install_defer
_install_defer()
# Route all ai_client imports to ai_client_stub to avoid loading heavy SDKs
if os.environ.get("AI_SERVER_ENABLED"):
import sys
from src import ai_client_stub
sys.modules["src.ai_client"] = ai_client_stub
from src.gui_2 import main
if __name__ == "__main__":
main()