🤖 自动格式化代码 [skip ci]
This commit is contained in:
@@ -29,7 +29,6 @@ import traceback
|
||||
|
||||
from .normal_chat_generator import NormalChatGenerator
|
||||
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_action_modifier import NormalChatActionModifier
|
||||
|
||||
|
||||
@@ -172,11 +172,7 @@ class DefaultReplyer:
|
||||
|
||||
self.heart_fc_sender = HeartFCSender()
|
||||
self.memory_activator = MemoryActivator()
|
||||
self.tool_executor = ToolExecutor(
|
||||
chat_id=self.chat_stream.stream_id,
|
||||
enable_cache=True,
|
||||
cache_ttl=3
|
||||
)
|
||||
self.tool_executor = ToolExecutor(chat_id=self.chat_stream.stream_id, enable_cache=True, cache_ttl=3)
|
||||
|
||||
def _select_weighted_model_config(self) -> Dict[str, Any]:
|
||||
"""使用加权随机选择来挑选一个模型配置"""
|
||||
@@ -575,8 +571,6 @@ class DefaultReplyer:
|
||||
else:
|
||||
tool_info_block = ""
|
||||
|
||||
|
||||
|
||||
if extra_info_block:
|
||||
extra_info_block = f"以下是你在回复时需要参考的信息,现在请你阅读以下内容,进行决策\n{extra_info_block}\n以上是你在回复时需要参考的信息,现在请你阅读以下内容,进行决策"
|
||||
else:
|
||||
|
||||
@@ -166,6 +166,7 @@ class Config(ConfigBase):
|
||||
lpmm_knowledge: LPMMKnowledgeConfig
|
||||
tool: ToolConfig
|
||||
|
||||
|
||||
def load_config(config_path: str) -> Config:
|
||||
"""
|
||||
加载配置文件
|
||||
|
||||
@@ -337,6 +337,7 @@ class ExpressionConfig(ConfigBase):
|
||||
格式: [["qq:12345:group", "qq:67890:private"]]
|
||||
"""
|
||||
|
||||
|
||||
@dataclass
|
||||
class ToolConfig(ConfigBase):
|
||||
"""工具配置类"""
|
||||
@@ -347,6 +348,7 @@ class ToolConfig(ConfigBase):
|
||||
enable_in_focus_chat: bool = True
|
||||
"""是否在专注聊天中启用工具"""
|
||||
|
||||
|
||||
@dataclass
|
||||
class EmojiConfig(ConfigBase):
|
||||
"""表情包配置类"""
|
||||
|
||||
@@ -94,7 +94,9 @@ async def generate_reply(
|
||||
"""
|
||||
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:
|
||||
logger.error("[GeneratorAPI] 无法获取回复器")
|
||||
return False, []
|
||||
|
||||
Reference in New Issue
Block a user