refactor(core): 统一代码风格并移除未使用的导入
本次提交主要进行代码风格的统一和现代化改造,具体包括: - 使用 `|` 联合类型替代 `typing.Optional`,以符合 PEP 604 的现代语法。 - 移除多个文件中未被使用的导入语句,清理代码。 - 调整了部分日志输出的级别,使其更符合调试场景。 - 统一了部分文件的导入顺序和格式。
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
提供独立的兴趣管理功能,不依赖任何插件
|
||||
"""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from src.chat.interest_system import bot_interest_manager
|
||||
from src.common.logger import get_logger
|
||||
@@ -41,7 +40,7 @@ class InterestService:
|
||||
logger.error(f"初始化智能兴趣系统失败: {e}")
|
||||
self.is_initialized = False
|
||||
|
||||
async def calculate_interest_match(self, content: str, keywords: Optional[list[str]] = None):
|
||||
async def calculate_interest_match(self, content: str, keywords: list[str] | None = None):
|
||||
"""
|
||||
计算内容与兴趣的匹配度
|
||||
|
||||
@@ -105,4 +104,4 @@ class InterestService:
|
||||
|
||||
|
||||
# 创建全局实例
|
||||
interest_service = InterestService()
|
||||
interest_service = InterestService()
|
||||
|
||||
Reference in New Issue
Block a user