This commit is contained in:
SengokuCola
2025-08-13 23:17:36 +08:00
3 changed files with 8 additions and 8 deletions

View File

@@ -193,7 +193,7 @@ class HeartFChatting:
+ (f"\n详情: {'; '.join(timer_strings)}" if timer_strings else "")
)
def _determine_form_type(self) -> str:
def _determine_form_type(self) -> None:
"""判断使用哪种形式的no_reply"""
# 如果连续no_reply次数少于3次使用waiting形式
if self.no_reply_consecutive <= 3:

View File

@@ -3,7 +3,7 @@ import time
import random
import hashlib
from typing import List, Dict, Optional, Any
from typing import List, Dict, Optional, Any, Tuple
from json_repair import repair_json
from src.llm_models.utils_model import LLMRequest
@@ -197,7 +197,7 @@ class ExpressionSelector:
chat_info: str,
max_num: int = 10,
target_message: Optional[str] = None,
) -> List[Dict[str, Any]]:
) -> Tuple[List[Dict[str, Any]], List[int]]:
# sourcery skip: inline-variable, list-comprehension
"""使用LLM选择适合的表达方式"""
@@ -214,8 +214,8 @@ class ExpressionSelector:
return [], []
# 2. 构建所有表达方式的索引和情境列表
all_expressions = []
all_situations = []
all_expressions: List[Dict[str, Any]] = []
all_situations: List[str] = []
# 添加style表达方式
for expr in style_exprs:
@@ -277,7 +277,7 @@ class ExpressionSelector:
selected_indices = result["selected_situations"]
# 根据索引获取完整的表达方式
valid_expressions = []
valid_expressions: List[Dict[str, Any]] = []
selected_ids = []
for idx in selected_indices:
if isinstance(idx, int) and 1 <= idx <= len(all_expressions):

View File

@@ -170,7 +170,7 @@ class ChatBot:
# 处理消息内容
await message.process()
person = Person.register_person(platform=message.message_info.platform, user_id=message.message_info.user_info.user_id,nickname=user_info.user_nickname)
_ = Person.register_person(platform=message.message_info.platform, user_id=message.message_info.user_info.user_id,nickname=user_info.user_nickname) # type: ignore
await self.s4u_message_processor.process_message(message)