ai-chat-ui/server/config/__init__.py
MT-Fire d8a6f696e7 refactor: 优化后端目录结构和代码组织
- 重构目录结构,将配置和日志模块分离到独立目录
- 创建 config/ 目录,统一管理平台配置和 API 密钥
- 创建 core/ 目录,集中管理日志系统功能
- 创建 database/ 目录,添加 SQLite 数据库初始化和管理
- 删除不必要的文件:测试文件、缓存文件、重复代码文件
- 更新所有导入路径,确保模块引用正确

主要变更:
- config.py → config/settings.py
- utils/logger.py → core/logger.py
- init_logging.py → core/init.py
- 删除 logging.conf(配置已整合到代码中)
- 新增 database/__init__.py 提供数据库连接管理

改进点:
- 更清晰的模块划分,便于维护和扩展
- 避免命名冲突(logging 模块与 Python 标准库冲突)
- 统一的配置和日志管理接口
2026-03-08 17:12:08 +08:00

24 lines
431 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
配置模块
提供统一的配置管理功能包括平台配置、API密钥管理等。
"""
from .settings import (
ProviderConfig,
PROVIDERS,
get_provider_config,
is_provider_available,
get_available_providers,
DEFAULT_PROVIDER,
)
__all__ = [
"ProviderConfig",
"PROVIDERS",
"get_provider_config",
"is_provider_available",
"get_available_providers",
"DEFAULT_PROVIDER",
]