feat:可选打开prompt显示,
This commit is contained in:
@@ -224,7 +224,7 @@ class NormalChat:
|
||||
mark_head = False
|
||||
first_bot_msg = None
|
||||
for msg in response_set:
|
||||
if global_config.experimental.debug_show_chat_mode:
|
||||
if global_config.debug.debug_show_chat_mode:
|
||||
msg += "ⁿ"
|
||||
message_segment = Seg(type="text", data=msg)
|
||||
bot_message = MessageSending(
|
||||
@@ -434,11 +434,12 @@ class NormalChat:
|
||||
# current_time = time.strftime("%H:%M:%S", time.localtime(message.message_info.time))
|
||||
# 使用 self.stream_id
|
||||
# willing_log = f"[激活值:{await willing_manager.get_willing(self.stream_id):.2f}]" if is_willing else ""
|
||||
logger.info(
|
||||
f"[{mes_name}]"
|
||||
f"{message.message_info.user_info.user_nickname}:" # 使用 self.chat_stream
|
||||
f"{message.processed_plain_text}[兴趣:{interested_rate:.2f}][回复概率:{reply_probability * 100:.1f}%]"
|
||||
)
|
||||
if reply_probability > 0.1:
|
||||
logger.info(
|
||||
f"[{mes_name}]"
|
||||
f"{message.message_info.user_info.user_nickname}:" # 使用 self.chat_stream
|
||||
f"{message.processed_plain_text}[兴趣:{interested_rate:.2f}][回复概率:{reply_probability * 100:.1f}%]"
|
||||
)
|
||||
do_reply = False
|
||||
response_set = None # 初始化 response_set
|
||||
if random() < reply_probability:
|
||||
|
||||
@@ -119,10 +119,11 @@ class ActionPlanner:
|
||||
try:
|
||||
llm_content, (reasoning_content, _) = await self.planner_llm.generate_response_async(prompt=prompt)
|
||||
|
||||
logger.info(f"{self.log_prefix}规划器原始提示词: {prompt}")
|
||||
logger.info(f"{self.log_prefix}规划器原始响应: {llm_content}")
|
||||
if reasoning_content:
|
||||
logger.info(f"{self.log_prefix}规划器推理: {reasoning_content}")
|
||||
if global_config.debug.show_prompt:
|
||||
logger.info(f"{self.log_prefix}规划器原始提示词: {prompt}")
|
||||
logger.info(f"{self.log_prefix}规划器原始响应: {llm_content}")
|
||||
if reasoning_content:
|
||||
logger.info(f"{self.log_prefix}规划器推理: {reasoning_content}")
|
||||
|
||||
except Exception as req_e:
|
||||
logger.error(f"{self.log_prefix}LLM 请求执行失败: {req_e}")
|
||||
|
||||
@@ -217,7 +217,9 @@ class DefaultReplyer:
|
||||
request_type=self.request_type,
|
||||
)
|
||||
|
||||
logger.info(f"{self.log_prefix}Prompt:\n{prompt}\n")
|
||||
if global_config.debug.show_prompt:
|
||||
logger.info(f"{self.log_prefix}Prompt:\n{prompt}\n")
|
||||
|
||||
content, (reasoning_content, model_name) = await express_model.generate_response_async(prompt)
|
||||
|
||||
logger.info(f"最终回复: {content}")
|
||||
@@ -560,7 +562,9 @@ class DefaultReplyer:
|
||||
for name, result, duration in task_results:
|
||||
results_dict[name] = result
|
||||
timing_logs.append(f"{name}: {duration:.4f}s")
|
||||
logger.info(f"回复生成前信息获取时间: {'; '.join(timing_logs)}")
|
||||
if duration > 8:
|
||||
logger.warning(f"回复生成前信息获取耗时过长: {name} 耗时: {duration:.4f}s,请使用更快的模型")
|
||||
logger.info(f"回复生成前信息获取耗时: {'; '.join(timing_logs)}")
|
||||
|
||||
expression_habits_block = results_dict["build_expression_habits"]
|
||||
relation_info = results_dict["build_relation_info"]
|
||||
@@ -850,7 +854,7 @@ class DefaultReplyer:
|
||||
type = msg_text[0]
|
||||
data = msg_text[1]
|
||||
|
||||
if global_config.experimental.debug_show_chat_mode and type == "text":
|
||||
if global_config.debug.debug_show_chat_mode and type == "text":
|
||||
data += "ᶠ"
|
||||
|
||||
part_message_id = f"{thinking_id}_{i}"
|
||||
|
||||
Reference in New Issue
Block a user