ai-demo/app/__init__.py

12 lines
288 B
Python
Raw Normal View History

2026-05-07 07:51:23 +00:00
# 延迟导入,避免循环依赖
__all__ = ["app"]
# 导入 tools 模块,触发工具注册
import app.tools
def __getattr__(name):
if name == "app":
from app.main import app
return app
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")