feat(kfc):独立私聊回复模型配置

- 在 ModelTaskConfig 中为私聊场景添加 `replyer_private` 字段
- 更新 KFC 回复器和统一模块以使用新的私聊配置
- 配置模板版本升级至 1.4.2,并更新 DeepSeek 模型名称
- 增强 KokoroFlowChatter 的执行日志
This commit is contained in:
tt-P607
2025-12-13 19:38:06 +08:00
parent f1bfcd1cff
commit 87704702ad
5 changed files with 34 additions and 26 deletions

View File

@@ -130,7 +130,8 @@ class ModelTaskConfig(ValidatedConfigBase):
# 必需配置项
utils: TaskConfig = Field(..., description="组件模型配置")
utils_small: TaskConfig = Field(..., description="组件小模型配置")
replyer: TaskConfig = Field(..., description="normal_chat首要回复模型模型配置")
replyer: TaskConfig = Field(..., description="normal_chat首要回复模型模型配置(群聊使用)")
replyer_private: TaskConfig = Field(..., description="normal_chat首要回复模型模型配置私聊使用")
maizone: TaskConfig = Field(..., description="maizone专用模型")
emotion: TaskConfig = Field(..., description="情绪模型配置")
vlm: TaskConfig = Field(..., description="视觉语言模型配置")

View File

@@ -206,7 +206,8 @@ class KokoroFlowChatter(BaseChatter):
exec_results = []
has_reply = False
for action in plan_response.actions:
for idx, action in enumerate(plan_response.actions, 1):
logger.debug(f"[KFC] 执行第 {idx}/{len(plan_response.actions)} 个动作: {action.type}")
action_data = action.params.copy()
result = await self.action_manager.execute_action(
@@ -218,6 +219,7 @@ class KokoroFlowChatter(BaseChatter):
thinking_id=None,
log_prefix="[KFC]",
)
logger.debug(f"[KFC] 动作 {action.type} 执行结果: success={result.get('success')}, reply_text={result.get('reply_text', '')[:50]}")
exec_results.append(result)
if result.get("success") and action.type in ("kfc_reply", "respond"):
has_reply = True

View File

@@ -61,12 +61,12 @@ async def generate_reply_text(
if global_config and global_config.debug.show_prompt:
logger.info(f"[KFC Replyer] 生成的回复提示词:\n{prompt}")
# 2. 获取 replyer 模型配置并调用 LLM
# 2. 获取 replyer_private 模型配置并调用 LLMKFC私聊专用
models = llm_api.get_available_models()
replyer_config = models.get("replyer")
replyer_config = models.get("replyer_private")
if not replyer_config:
logger.error("[KFC Replyer] 未找到 replyer 模型配置")
logger.error("[KFC Replyer] 未找到 replyer_private 模型配置")
return False, "(回复生成失败:未找到模型配置)"
success, raw_response, _reasoning, _model_name = await llm_api.generate_with_model(

View File

@@ -389,13 +389,13 @@ async def generate_unified_response(
f"--- PROMPT END ---"
)
# 获取 replyer 模型配置并调用 LLM
# 获取 replyer_private 模型配置并调用 LLMKFC私聊专用
models = llm_api.get_available_models()
replyer_config = models.get("replyer")
replyer_config = models.get("replyer_private")
if not replyer_config:
logger.error("[KFC Unified] 未找到 replyer 模型配置")
return LLMResponse.create_error_response("未找到 replyer 模型配置")
logger.error("[KFC Unified] 未找到 replyer_private 模型配置")
return LLMResponse.create_error_response("未找到 replyer_private 模型配置")
# 调用 LLM使用合并后的提示词
success, raw_response, _reasoning, _model_name = await llm_api.generate_with_model(