mirror of https://github.com/Mai-with-u/MaiBot.git
可见30条消息
parent
19a172fad7
commit
b93086fc37
|
|
@ -248,7 +248,7 @@ class Conversation:
|
||||||
self.observation_info.last_message_content = last_msg.get("processed_plain_text", "")
|
self.observation_info.last_message_content = last_msg.get("processed_plain_text", "")
|
||||||
|
|
||||||
# 构建用于 Prompt 的历史记录字符串 (只使用最近的一部分)
|
# 构建用于 Prompt 的历史记录字符串 (只使用最近的一部分)
|
||||||
history_slice_for_str = initial_messages[-20:] # 可配置
|
history_slice_for_str = initial_messages[-30:] # 可配置
|
||||||
self.observation_info.chat_history_str = await build_readable_messages(
|
self.observation_info.chat_history_str = await build_readable_messages(
|
||||||
history_slice_for_str,
|
history_slice_for_str,
|
||||||
replace_bot_name=True,
|
replace_bot_name=True,
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,7 @@ class ObservationInfo:
|
||||||
self.chat_history = self.chat_history[-max_history_len:]
|
self.chat_history = self.chat_history[-max_history_len:]
|
||||||
|
|
||||||
# 更新历史记录字符串 (仅使用最近一部分生成,提高效率)
|
# 更新历史记录字符串 (仅使用最近一部分生成,提高效率)
|
||||||
history_slice_for_str = self.chat_history[-20:] # 例如最近 20 条
|
history_slice_for_str = self.chat_history[-30:] # 例如最近 20 条
|
||||||
try:
|
try:
|
||||||
self.chat_history_str = await build_readable_messages(
|
self.chat_history_str = await build_readable_messages(
|
||||||
history_slice_for_str,
|
history_slice_for_str,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue