🤖 自动格式化代码 [skip ci]
This commit is contained in:
@@ -199,7 +199,7 @@ class MongoToSQLiteMigrator:
|
|||||||
"timestamp": "timestamp",
|
"timestamp": "timestamp",
|
||||||
},
|
},
|
||||||
enable_validation=True, # 禁用数据验证"
|
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(
|
MigrationConfig(
|
||||||
|
|||||||
@@ -335,7 +335,9 @@ class HeartFChatting:
|
|||||||
for pname, ptime in processor_time_costs.items():
|
for pname, ptime in processor_time_costs.items():
|
||||||
formatted_ptime = f"{ptime * 1000:.2f}毫秒" if ptime < 1 else f"{ptime:.2f}秒"
|
formatted_ptime = f"{ptime * 1000:.2f}毫秒" if ptime < 1 else f"{ptime:.2f}秒"
|
||||||
processor_time_strings.append(f"{pname}: {formatted_ptime}")
|
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(
|
logger.info(
|
||||||
f"{self.log_prefix} 第{self._current_cycle.cycle_id}次思考,"
|
f"{self.log_prefix} 第{self._current_cycle.cycle_id}次思考,"
|
||||||
@@ -471,7 +473,9 @@ class HeartFChatting:
|
|||||||
running_memorys = await self.memory_activator.activate_memory(observations)
|
running_memorys = await self.memory_activator.activate_memory(observations)
|
||||||
|
|
||||||
with Timer("执行 信息处理器", cycle_timers):
|
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 = {
|
loop_processor_info = {
|
||||||
"all_plan_info": all_plan_info,
|
"all_plan_info": all_plan_info,
|
||||||
|
|||||||
@@ -488,7 +488,7 @@ async def build_anonymous_messages(messages: List[Dict[str, Any]]) -> str:
|
|||||||
content = content.replace("ⁿ", "")
|
content = content.replace("ⁿ", "")
|
||||||
|
|
||||||
# if not all([platform, user_id, timestamp is not None]):
|
# if not all([platform, user_id, timestamp is not None]):
|
||||||
# continue
|
# continue
|
||||||
|
|
||||||
anon_name = get_anon_name(platform, user_id)
|
anon_name = get_anon_name(platform, user_id)
|
||||||
# print(f"anon_name:{anon_name}")
|
# print(f"anon_name:{anon_name}")
|
||||||
@@ -514,7 +514,7 @@ async def build_anonymous_messages(messages: List[Dict[str, Any]]) -> str:
|
|||||||
new_content = ""
|
new_content = ""
|
||||||
last_end = 0
|
last_end = 0
|
||||||
for m in at_matches:
|
for m in at_matches:
|
||||||
new_content += content[last_end:m.start()]
|
new_content += content[last_end : m.start()]
|
||||||
bbb = m.group(2)
|
bbb = m.group(2)
|
||||||
try:
|
try:
|
||||||
anon_at = get_anon_name(platform, bbb)
|
anon_at = get_anon_name(platform, bbb)
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ class PicAction(PluginAction):
|
|||||||
"""根据描述使用火山引擎HTTP API生成图片的动作处理类"""
|
"""根据描述使用火山引擎HTTP API生成图片的动作处理类"""
|
||||||
|
|
||||||
action_name = "pic_action"
|
action_name = "pic_action"
|
||||||
action_description = "可以根据特定的描述,生成并发送一张图片,如果没提供描述,就根据聊天内容生成,你可以立刻画好,不用等待"
|
action_description = (
|
||||||
|
"可以根据特定的描述,生成并发送一张图片,如果没提供描述,就根据聊天内容生成,你可以立刻画好,不用等待"
|
||||||
|
)
|
||||||
action_parameters = {
|
action_parameters = {
|
||||||
"description": "图片描述,输入你想要生成并发送的图片的描述,必填",
|
"description": "图片描述,输入你想要生成并发送的图片的描述,必填",
|
||||||
"size": "图片尺寸,例如 '1024x1024' (可选, 默认从配置或 '1024x1024')",
|
"size": "图片尺寸,例如 '1024x1024' (可选, 默认从配置或 '1024x1024')",
|
||||||
|
|||||||
Reference in New Issue
Block a user