ForcePilot/backend/package/yuxi/__init__.py

34 lines
790 B
Python
Raw Normal View History

2025-03-08 20:26:00 +08:00
from dotenv import load_dotenv
load_dotenv(".env", override=True)
2025-03-16 01:11:13 +08:00
2025-05-24 11:29:45 +08:00
from concurrent.futures import ThreadPoolExecutor # noqa: E402
from importlib import import_module # noqa: E402
from yuxi.config import config as config # noqa: E402
try:
from importlib.metadata import version
__version__ = version("yuxi")
except Exception:
__version__ = "unknown"
executor = ThreadPoolExecutor() # noqa: E402
def get_version():
"""Return the Yuxi version."""
return __version__
def __getattr__(name: str):
if name == "knowledge_base":
knowledge = import_module("yuxi.knowledge")
return getattr(knowledge, name)
raise AttributeError(f"module 'yuxi' has no attribute {name!r}")
def __dir__():
return sorted(set(globals()) | {"knowledge_base"})