xiaozhi-esp32-server/main/xiaozhi-server/plugins_func/loadplugins.py
lapy c5ff101e66 feat(xiaozhi-server): western provider set, English defaults, runtime, and plugins
- Defaults and config aligned with English-first product surface

- Adds/removes ASR/TTS paths; drops China-only provider implementations and bundled SenseVoice assets

- Westernizes prompts, plugin/tool copy, connection and handler behavior on upstream fixes

- Powermem max_tokens and OpenAI no-thinking guard preserved on downstream path
2026-04-25 17:05:08 +01:00

25 lines
No EOL
740 B
Python

import importlib
import pkgutil
from config.logger import setup_logging
TAG = __name__
logger = setup_logging()
def auto_import_modules(package_name):
"""
Automatically import all modules within the specified package.
Args:
package_name (str): Package name, such as 'functions'.
"""
# Get package path
package = importlib.import_module(package_name)
package_path = package.__path__
# Traverse all modules within the package
for _, module_name, _ in pkgutil.iter_modules(package_path):
# Import module
full_module_name = f"{package_name}.{module_name}"
importlib.import_module(full_module_name)
#logger.bind(tag=TAG).info(f"Module '{full_module_name}' loaded")