🤖 自动格式化代码 [skip ci]

This commit is contained in:
github-actions[bot]
2025-07-01 10:15:32 +00:00
parent da1e034509
commit e968064f79
5 changed files with 10 additions and 12 deletions

View File

@@ -29,7 +29,6 @@ import traceback
from .normal_chat_generator import NormalChatGenerator from .normal_chat_generator import NormalChatGenerator
from src.chat.normal_chat.normal_chat_expressor import NormalChatExpressor from src.chat.normal_chat.normal_chat_expressor import NormalChatExpressor
from src.chat.replyer.default_generator import DefaultReplyer
from src.chat.normal_chat.normal_chat_planner import NormalChatPlanner from src.chat.normal_chat.normal_chat_planner import NormalChatPlanner
from src.chat.normal_chat.normal_chat_action_modifier import NormalChatActionModifier from src.chat.normal_chat.normal_chat_action_modifier import NormalChatActionModifier

View File

@@ -172,11 +172,7 @@ class DefaultReplyer:
self.heart_fc_sender = HeartFCSender() self.heart_fc_sender = HeartFCSender()
self.memory_activator = MemoryActivator() self.memory_activator = MemoryActivator()
self.tool_executor = ToolExecutor( self.tool_executor = ToolExecutor(chat_id=self.chat_stream.stream_id, enable_cache=True, cache_ttl=3)
chat_id=self.chat_stream.stream_id,
enable_cache=True,
cache_ttl=3
)
def _select_weighted_model_config(self) -> Dict[str, Any]: def _select_weighted_model_config(self) -> Dict[str, Any]:
"""使用加权随机选择来挑选一个模型配置""" """使用加权随机选择来挑选一个模型配置"""
@@ -575,8 +571,6 @@ class DefaultReplyer:
else: else:
tool_info_block = "" tool_info_block = ""
if extra_info_block: if extra_info_block:
extra_info_block = f"以下是你在回复时需要参考的信息,现在请你阅读以下内容,进行决策\n{extra_info_block}\n以上是你在回复时需要参考的信息,现在请你阅读以下内容,进行决策" extra_info_block = f"以下是你在回复时需要参考的信息,现在请你阅读以下内容,进行决策\n{extra_info_block}\n以上是你在回复时需要参考的信息,现在请你阅读以下内容,进行决策"
else: else:

View File

@@ -166,6 +166,7 @@ class Config(ConfigBase):
lpmm_knowledge: LPMMKnowledgeConfig lpmm_knowledge: LPMMKnowledgeConfig
tool: ToolConfig tool: ToolConfig
def load_config(config_path: str) -> Config: def load_config(config_path: str) -> Config:
""" """
加载配置文件 加载配置文件

View File

@@ -337,6 +337,7 @@ class ExpressionConfig(ConfigBase):
格式: [["qq:12345:group", "qq:67890:private"]] 格式: [["qq:12345:group", "qq:67890:private"]]
""" """
@dataclass @dataclass
class ToolConfig(ConfigBase): class ToolConfig(ConfigBase):
"""工具配置类""" """工具配置类"""
@@ -347,6 +348,7 @@ class ToolConfig(ConfigBase):
enable_in_focus_chat: bool = True enable_in_focus_chat: bool = True
"""是否在专注聊天中启用工具""" """是否在专注聊天中启用工具"""
@dataclass @dataclass
class EmojiConfig(ConfigBase): class EmojiConfig(ConfigBase):
"""表情包配置类""" """表情包配置类"""

View File

@@ -94,7 +94,9 @@ async def generate_reply(
""" """
try: try:
# 获取回复器 # 获取回复器
replyer = get_replyer(chat_stream, chat_id, model_configs=model_configs, request_type=request_type, enable_tool=enable_tool) replyer = get_replyer(
chat_stream, chat_id, model_configs=model_configs, request_type=request_type, enable_tool=enable_tool
)
if not replyer: if not replyer:
logger.error("[GeneratorAPI] 无法获取回复器") logger.error("[GeneratorAPI] 无法获取回复器")
return False, [] return False, []