config:change some parameters

pull/1414/head
SengokuCola 2025-12-06 15:02:40 +08:00
parent 1ca27815cd
commit 83ec86f28b
3 changed files with 24 additions and 18 deletions

View File

@ -180,32 +180,38 @@ def _log_conversation_messages(
for idx, msg in enumerate(conversation_messages, start_idx):
role_name = msg.role.value if hasattr(msg.role, "value") else str(msg.role)
# 处理内容 - 显示完整内容,不截断
if isinstance(msg.content, str):
full_content = msg.content
content_type = "文本"
elif isinstance(msg.content, list):
text_parts = [item for item in msg.content if isinstance(item, str)]
image_count = len([item for item in msg.content if isinstance(item, tuple)])
full_content = "".join(text_parts) if text_parts else ""
content_type = f"混合({len(text_parts)}段文本, {image_count}张图片)"
else:
full_content = str(msg.content)
content_type = "未知"
# # 处理内容 - 显示完整内容,不截断
# if isinstance(msg.content, str):
# full_content = msg.content
# content_type = "文本"
# elif isinstance(msg.content, list):
# text_parts = [item for item in msg.content if isinstance(item, str)]
# image_count = len([item for item in msg.content if isinstance(item, tuple)])
# full_content = "".join(text_parts) if text_parts else ""
# content_type = f"混合({len(text_parts)}段文本, {image_count}张图片)"
# else:
# full_content = str(msg.content)
# content_type = "未知"
# 构建单条消息的日志信息
msg_info = f"\n========================================\n[消息 {idx}] 角色: {role_name} 内容类型: {content_type}\n-----------------------------"
# msg_info = f"\n========================================\n[消息 {idx}] 角色: {role_name} 内容类型: {content_type}\n-----------------------------"
msg_info = f"\n========================================\n[消息 {idx}] 角色: {role_name}\n-----------------------------"
if full_content:
msg_info += f"\n{full_content}"
# if full_content:
# msg_info += f"\n{full_content}"
if msg.content:
msg_info += f"\n{msg.content}"
if msg.tool_calls:
msg_info += f"\n 工具调用: {len(msg.tool_calls)}"
for tool_call in msg.tool_calls:
msg_info += f"\n - {tool_call}"
msg_info += f"\n - {tool_call.func_name}: {json.dumps(tool_call.args, ensure_ascii=False)}"
if msg.tool_call_id:
msg_info += f"\n 工具调用ID: {msg.tool_call_id}"
# if msg.tool_call_id:
# msg_info += f"\n 工具调用ID: {msg.tool_call_id}"
log_lines.append(msg_info)

View File

@ -153,7 +153,7 @@ async def search_chat_history(
return "未找到相关聊天记录"
# 如果匹配结果超过20条不返回具体记录只返回提示和所有相关关键词
if len(filtered_records) > 20:
if len(filtered_records) > 15:
# 统计所有记录上的关键词并去重
all_keywords_set = set()
for record in filtered_records:

View File

@ -114,9 +114,9 @@ enable_jargon_detection = true # 记忆检索过程中是否启用黑话识别
global_memory = false # 是否允许记忆检索进行全局查询
[dream]
interval_minutes = 45 # 做梦时间间隔分钟默认30分钟
interval_minutes = 60 # 做梦时间间隔分钟默认30分钟
max_iterations = 20 # 做梦最大轮次默认20轮
first_delay_seconds = 1200 # 程序启动后首次做梦前的延迟时间默认60秒
first_delay_seconds = 1800 # 程序启动后首次做梦前的延迟时间默认60秒
# 做梦时间段配置,格式:["HH:MM-HH:MM", ...]
# 如果列表为空,则表示全天允许做梦。