ruff fix但指定了--unsafe-fixes

This commit is contained in:
minecraft1024a
2025-10-05 21:48:32 +08:00
parent 0b4e1f5b7b
commit 9d705463ce
76 changed files with 300 additions and 315 deletions

View File

@@ -13,10 +13,9 @@ __all__ = [
"BotInterestManager",
"BotInterestTag",
"BotPersonalityInterests",
"InterestMatchResult",
"bot_interest_manager",
# 消息兴趣值计算管理
"InterestManager",
"InterestMatchResult",
"bot_interest_manager",
"get_interest_manager",
]

View File

@@ -429,7 +429,7 @@ class BotInterestManager:
except Exception as e:
logger.error(f"❌ 计算相似度分数失败: {e}")
async def calculate_interest_match(self, message_text: str, keywords: list[str] = None) -> InterestMatchResult:
async def calculate_interest_match(self, message_text: str, keywords: list[str] | None = None) -> InterestMatchResult:
"""计算消息与机器人兴趣的匹配度"""
if not self.current_interests or not self._initialized:
raise RuntimeError("❌ 兴趣标签系统未初始化")
@@ -825,7 +825,7 @@ class BotInterestManager:
"cache_size": len(self.embedding_cache),
}
async def update_interest_tags(self, new_personality_description: str = None):
async def update_interest_tags(self, new_personality_description: str | None = None):
"""更新兴趣标签"""
try:
if not self.current_interests: