细微调整
This commit is contained in:
@@ -27,12 +27,14 @@ def init_prompt():
|
|||||||
你现在需要根据聊天内容,选择的合适的action来参与聊天。
|
你现在需要根据聊天内容,选择的合适的action来参与聊天。
|
||||||
{chat_context_description},以下是具体的聊天内容:
|
{chat_context_description},以下是具体的聊天内容:
|
||||||
{chat_content_block}
|
{chat_content_block}
|
||||||
你刚刚进行过的action是:
|
|
||||||
{actions_before_now_block}
|
|
||||||
|
|
||||||
{moderation_prompt}
|
{moderation_prompt}
|
||||||
|
|
||||||
现在请你根据{by_what}选择合适的action:
|
现在请你根据{by_what}选择合适的action:
|
||||||
|
你刚刚选择并执行过的action是:
|
||||||
|
{actions_before_now_block}
|
||||||
|
|
||||||
{no_action_block}
|
{no_action_block}
|
||||||
{action_options_text}
|
{action_options_text}
|
||||||
|
|
||||||
|
|||||||
@@ -571,9 +571,9 @@ def build_readable_actions(actions: List[Dict[str, Any]]) -> str:
|
|||||||
current_time = time.time()
|
current_time = time.time()
|
||||||
|
|
||||||
# The get functions return actions sorted ascending by time. Let's reverse it to show newest first.
|
# The get functions return actions sorted ascending by time. Let's reverse it to show newest first.
|
||||||
sorted_actions = sorted(actions, key=lambda x: x.get("time", 0), reverse=True)
|
# sorted_actions = sorted(actions, key=lambda x: x.get("time", 0), reverse=True)
|
||||||
|
|
||||||
for action in sorted_actions:
|
for action in actions:
|
||||||
action_time = action.get("time", current_time)
|
action_time = action.get("time", current_time)
|
||||||
action_name = action.get("action_name", "未知动作")
|
action_name = action.get("action_name", "未知动作")
|
||||||
action_prompt_display = action.get("action_prompt_display", "无具体内容")
|
action_prompt_display = action.get("action_prompt_display", "无具体内容")
|
||||||
@@ -581,10 +581,10 @@ def build_readable_actions(actions: List[Dict[str, Any]]) -> str:
|
|||||||
time_diff_seconds = current_time - action_time
|
time_diff_seconds = current_time - action_time
|
||||||
|
|
||||||
if time_diff_seconds < 60:
|
if time_diff_seconds < 60:
|
||||||
time_ago_str = f"在{time_diff_seconds}秒前"
|
time_ago_str = f"在{int(time_diff_seconds)}秒前"
|
||||||
else:
|
else:
|
||||||
time_diff_minutes = round(time_diff_seconds / 60)
|
time_diff_minutes = round(time_diff_seconds / 60)
|
||||||
time_ago_str = f"在{time_diff_minutes}分钟前"
|
time_ago_str = f"在{int(time_diff_minutes)}分钟前"
|
||||||
|
|
||||||
line = f"{time_ago_str},你使用了“{action_name}”,具体内容是:“{action_prompt_display}”"
|
line = f"{time_ago_str},你使用了“{action_name}”,具体内容是:“{action_prompt_display}”"
|
||||||
output_lines.append(line)
|
output_lines.append(line)
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ class NoReplyAction(BaseAction):
|
|||||||
try:
|
try:
|
||||||
interested_rate = await hippocampus_manager.get_activate_from_text(
|
interested_rate = await hippocampus_manager.get_activate_from_text(
|
||||||
full_text,
|
full_text,
|
||||||
fast_retrieval=True,
|
fast_retrieval=False,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"{self.log_prefix} 记忆激活计算失败: {e}")
|
logger.error(f"{self.log_prefix} 记忆激活计算失败: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user