mirror of https://github.com/Mai-with-u/MaiBot.git
🤖 自动格式化代码 [skip ci]
parent
46a413abe4
commit
1f5bc87b4d
|
|
@ -199,7 +199,7 @@ class MongoToSQLiteMigrator:
|
|||
"timestamp": "timestamp",
|
||||
},
|
||||
enable_validation=True, # 禁用数据验证"
|
||||
unique_fields=["user_id", "prompt_tokens","completion_tokens","total_tokens","cost"], # 组合唯一性
|
||||
unique_fields=["user_id", "prompt_tokens", "completion_tokens", "total_tokens", "cost"], # 组合唯一性
|
||||
),
|
||||
# 消息迁移配置
|
||||
MigrationConfig(
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ class ExpressionLearner:
|
|||
# random_msg_str: str = await build_readable_messages(random_msg, timestamp_mode="normal")
|
||||
random_msg_str: str = await build_anonymous_messages(random_msg)
|
||||
# print(f"random_msg_str:{random_msg_str}")
|
||||
|
||||
|
||||
prompt: str = await global_prompt_manager.format_prompt(
|
||||
prompt,
|
||||
chat_str=random_msg_str,
|
||||
|
|
|
|||
|
|
@ -335,7 +335,9 @@ class HeartFChatting:
|
|||
for pname, ptime in processor_time_costs.items():
|
||||
formatted_ptime = f"{ptime * 1000:.2f}毫秒" if ptime < 1 else f"{ptime:.2f}秒"
|
||||
processor_time_strings.append(f"{pname}: {formatted_ptime}")
|
||||
processor_time_log = ("\n各处理器耗时: " + "; ".join(processor_time_strings)) if processor_time_strings else ""
|
||||
processor_time_log = (
|
||||
("\n各处理器耗时: " + "; ".join(processor_time_strings)) if processor_time_strings else ""
|
||||
)
|
||||
|
||||
logger.info(
|
||||
f"{self.log_prefix} 第{self._current_cycle.cycle_id}次思考,"
|
||||
|
|
@ -471,7 +473,9 @@ class HeartFChatting:
|
|||
running_memorys = await self.memory_activator.activate_memory(observations)
|
||||
|
||||
with Timer("执行 信息处理器", cycle_timers):
|
||||
all_plan_info, processor_time_costs = await self._process_processors(observations, running_memorys, cycle_timers)
|
||||
all_plan_info, processor_time_costs = await self._process_processors(
|
||||
observations, running_memorys, cycle_timers
|
||||
)
|
||||
|
||||
loop_processor_info = {
|
||||
"all_plan_info": all_plan_info,
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class MainSystem:
|
|||
"""学习并存储表达方式任务"""
|
||||
while True:
|
||||
await asyncio.sleep(global_config.expression.learning_interval)
|
||||
if global_config.expression.enable_expression_learning:
|
||||
if global_config.expression.enable_expression_learning:
|
||||
logger.info("[表达方式学习] 开始学习表达方式...")
|
||||
await expression_learner.learn_and_store_expression()
|
||||
logger.info("[表达方式学习] 表达方式学习完成")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from src.tools.tool_can_use.base_tool import BaseTool,run_lua_code
|
||||
from src.tools.tool_can_use.base_tool import BaseTool, run_lua_code
|
||||
from src.common.logger import get_module_logger
|
||||
from typing import Any
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from src.tools.tool_can_use.base_tool import BaseTool,run_lua_code
|
||||
from src.tools.tool_can_use.base_tool import BaseTool, run_lua_code
|
||||
from src.common.logger_manager import get_logger
|
||||
from typing import Dict, Any
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue