🤖 自动格式化代码 [skip ci]
This commit is contained in:
@@ -427,7 +427,9 @@ class CoreActionsPlugin(BasePlugin):
|
||||
"name": ConfigField(type=str, default="core_actions", description="插件名称", required=True),
|
||||
"version": ConfigField(type=str, default="1.0.0", description="插件版本号"),
|
||||
"enabled": ConfigField(type=bool, default=True, description="是否启用插件"),
|
||||
"description": ConfigField(type=str, default="系统核心动作插件,提供基础聊天交互功能", description="插件描述", required=True)
|
||||
"description": ConfigField(
|
||||
type=str, default="系统核心动作插件,提供基础聊天交互功能", description="插件描述", required=True
|
||||
),
|
||||
},
|
||||
"components": {
|
||||
"enable_reply": ConfigField(type=bool, default=True, description="是否启用'回复'动作"),
|
||||
@@ -436,22 +438,21 @@ class CoreActionsPlugin(BasePlugin):
|
||||
"enable_change_to_focus": ConfigField(type=bool, default=True, description="是否启用'切换到专注模式'动作"),
|
||||
"enable_exit_focus": ConfigField(type=bool, default=True, description="是否启用'退出专注模式'动作"),
|
||||
"enable_ping_command": ConfigField(type=bool, default=True, description="是否启用'/ping'测试命令"),
|
||||
"enable_log_command": ConfigField(type=bool, default=True, description="是否启用'/log'日志命令")
|
||||
"enable_log_command": ConfigField(type=bool, default=True, description="是否启用'/log'日志命令"),
|
||||
},
|
||||
"no_reply": {
|
||||
"waiting_timeout": ConfigField(type=int, default=1200, description="连续不回复时,最长的等待超时时间(秒)"),
|
||||
"waiting_timeout": ConfigField(
|
||||
type=int, default=1200, description="连续不回复时,最长的等待超时时间(秒)"
|
||||
),
|
||||
"stage_1_wait": ConfigField(type=int, default=10, description="第1次连续不回复的等待时间(秒)"),
|
||||
"stage_2_wait": ConfigField(type=int, default=60, description="第2次连续不回复的等待时间(秒)"),
|
||||
"stage_3_wait": ConfigField(type=int, default=600, description="第3次连续不回复的等待时间(秒)"),
|
||||
},
|
||||
"emoji": {
|
||||
"random_probability": ConfigField(
|
||||
type=float,
|
||||
default=0.1,
|
||||
description="Normal模式下,随机发送表情的概率(0.0到1.0)",
|
||||
example=0.15
|
||||
type=float, default=0.1, description="Normal模式下,随机发送表情的概率(0.0到1.0)", example=0.15
|
||||
)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
def get_plugin_components(self) -> List[Tuple[ComponentInfo, Type]]:
|
||||
@@ -482,9 +483,13 @@ class CoreActionsPlugin(BasePlugin):
|
||||
if self.get_config("components.enable_change_to_focus", True):
|
||||
components.append((ChangeToFocusChatAction.get_action_info(), ChangeToFocusChatAction))
|
||||
if self.get_config("components.enable_ping_command", True):
|
||||
components.append((PingCommand.get_command_info(name="ping", description="测试机器人响应,拦截后续处理"), PingCommand))
|
||||
components.append(
|
||||
(PingCommand.get_command_info(name="ping", description="测试机器人响应,拦截后续处理"), PingCommand)
|
||||
)
|
||||
if self.get_config("components.enable_log_command", True):
|
||||
components.append((LogCommand.get_command_info(name="log", description="记录消息到日志,不拦截后续处理"), LogCommand))
|
||||
components.append(
|
||||
(LogCommand.get_command_info(name="log", description="记录消息到日志,不拦截后续处理"), LogCommand)
|
||||
)
|
||||
|
||||
return components
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ class DoubaoImagePlugin(BasePlugin):
|
||||
"api": "API相关配置,包含火山引擎API的访问信息",
|
||||
"generation": "图片生成参数配置,控制生成图片的各种参数",
|
||||
"cache": "结果缓存配置",
|
||||
"components": "组件启用配置"
|
||||
"components": "组件启用配置",
|
||||
}
|
||||
|
||||
# 配置Schema定义
|
||||
@@ -422,56 +422,47 @@ class DoubaoImagePlugin(BasePlugin):
|
||||
"version": ConfigField(type=str, default="2.0.0", description="插件版本号"),
|
||||
"enabled": ConfigField(type=bool, default=True, description="是否启用插件"),
|
||||
"description": ConfigField(
|
||||
type=str,
|
||||
default="基于火山引擎豆包模型的AI图片生成插件",
|
||||
description="插件描述",
|
||||
required=True
|
||||
)
|
||||
type=str, default="基于火山引擎豆包模型的AI图片生成插件", description="插件描述", required=True
|
||||
),
|
||||
},
|
||||
"api": {
|
||||
"base_url": ConfigField(
|
||||
type=str,
|
||||
default="https://ark.cn-beijing.volces.com/api/v3",
|
||||
description="API基础URL",
|
||||
example="https://api.example.com/v1"
|
||||
example="https://api.example.com/v1",
|
||||
),
|
||||
"volcano_generate_api_key": ConfigField(
|
||||
type=str,
|
||||
default="YOUR_DOUBAO_API_KEY_HERE",
|
||||
description="火山引擎豆包API密钥",
|
||||
required=True
|
||||
)
|
||||
type=str, default="YOUR_DOUBAO_API_KEY_HERE", description="火山引擎豆包API密钥", required=True
|
||||
),
|
||||
},
|
||||
"generation": {
|
||||
"default_model": ConfigField(
|
||||
type=str,
|
||||
default="doubao-seedream-3-0-t2i-250415",
|
||||
description="默认使用的文生图模型",
|
||||
choices=["doubao-seedream-3-0-t2i-250415", "doubao-seedream-2-0-t2i"]
|
||||
choices=["doubao-seedream-3-0-t2i-250415", "doubao-seedream-2-0-t2i"],
|
||||
),
|
||||
"default_size": ConfigField(
|
||||
type=str,
|
||||
default="1024x1024",
|
||||
description="默认图片尺寸",
|
||||
example="1024x1024",
|
||||
choices=["1024x1024", "1024x1280", "1280x1024", "1024x1536", "1536x1024"]
|
||||
choices=["1024x1024", "1024x1280", "1280x1024", "1024x1536", "1536x1024"],
|
||||
),
|
||||
"default_watermark": ConfigField(type=bool, default=True, description="是否默认添加水印"),
|
||||
"default_guidance_scale": ConfigField(
|
||||
type=float,
|
||||
default=2.5,
|
||||
description="模型指导强度,影响图片与提示的关联性",
|
||||
example="2.0"
|
||||
type=float, default=2.5, description="模型指导强度,影响图片与提示的关联性", example="2.0"
|
||||
),
|
||||
"default_seed": ConfigField(type=int, default=42, description="随机种子,用于复现图片")
|
||||
"default_seed": ConfigField(type=int, default=42, description="随机种子,用于复现图片"),
|
||||
},
|
||||
"cache": {
|
||||
"enabled": ConfigField(type=bool, default=True, description="是否启用请求缓存"),
|
||||
"max_size": ConfigField(type=int, default=10, description="最大缓存数量")
|
||||
"max_size": ConfigField(type=int, default=10, description="最大缓存数量"),
|
||||
},
|
||||
"components": {
|
||||
"enable_image_generation": ConfigField(type=bool, default=True, description="是否启用图片生成Action")
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
def get_plugin_components(self) -> List[Tuple[ComponentInfo, Type]]:
|
||||
|
||||
@@ -164,7 +164,7 @@ class MuteAction(BaseAction):
|
||||
success = await self.send_command(
|
||||
command_name="GROUP_BAN",
|
||||
args={"qq_id": str(user_id), "duration": str(duration_int)},
|
||||
display_message=f"发送禁言命令",
|
||||
display_message="发送禁言命令",
|
||||
)
|
||||
|
||||
if success:
|
||||
@@ -180,8 +180,8 @@ class MuteAction(BaseAction):
|
||||
"user_id": user_id,
|
||||
"duration": duration_int,
|
||||
"duration_str": time_str,
|
||||
"reason": reason
|
||||
}
|
||||
"reason": reason,
|
||||
},
|
||||
)
|
||||
return True, f"成功禁言 {target},时长 {time_str}"
|
||||
else:
|
||||
@@ -389,7 +389,7 @@ class MutePlugin(BasePlugin):
|
||||
"mute": "核心禁言功能配置",
|
||||
"smart_mute": "智能禁言Action的专属配置",
|
||||
"mute_command": "禁言命令Command的专属配置",
|
||||
"logging": "日志记录相关配置"
|
||||
"logging": "日志记录相关配置",
|
||||
}
|
||||
|
||||
# 配置Schema定义
|
||||
@@ -398,17 +398,21 @@ class MutePlugin(BasePlugin):
|
||||
"name": ConfigField(type=str, default="mute_plugin", description="插件名称", required=True),
|
||||
"version": ConfigField(type=str, default="2.0.0", description="插件版本号"),
|
||||
"enabled": ConfigField(type=bool, default=False, description="是否启用插件"),
|
||||
"description": ConfigField(type=str, default="群聊禁言管理插件,提供智能禁言功能", description="插件描述", required=True)
|
||||
"description": ConfigField(
|
||||
type=str, default="群聊禁言管理插件,提供智能禁言功能", description="插件描述", required=True
|
||||
),
|
||||
},
|
||||
"components": {
|
||||
"enable_smart_mute": ConfigField(type=bool, default=True, description="是否启用智能禁言Action"),
|
||||
"enable_mute_command": ConfigField(type=bool, default=False, description="是否启用禁言命令Command")
|
||||
"enable_mute_command": ConfigField(type=bool, default=False, description="是否启用禁言命令Command"),
|
||||
},
|
||||
"mute": {
|
||||
"min_duration": ConfigField(type=int, default=60, description="最短禁言时长(秒)"),
|
||||
"max_duration": ConfigField(type=int, default=2592000, description="最长禁言时长(秒),默认30天"),
|
||||
"default_duration": ConfigField(type=int, default=300, description="默认禁言时长(秒),默认5分钟"),
|
||||
"enable_duration_formatting": ConfigField(type=bool, default=True, description="是否启用人性化的时长显示(如 '5分钟' 而非 '300秒')"),
|
||||
"enable_duration_formatting": ConfigField(
|
||||
type=bool, default=True, description="是否启用人性化的时长显示(如 '5分钟' 而非 '300秒')"
|
||||
),
|
||||
"log_mute_history": ConfigField(type=bool, default=True, description="是否记录禁言历史(未来功能)"),
|
||||
"templates": ConfigField(
|
||||
type=list,
|
||||
@@ -418,9 +422,9 @@ class MutePlugin(BasePlugin):
|
||||
"明白了,禁言 {target} {duration},原因是{reason}",
|
||||
"哇哈哈哈哈哈,已禁言 {target} {duration},理由:{reason}",
|
||||
"哎呦我去,对 {target} 执行禁言 {duration},因为{reason}",
|
||||
"{target},你完蛋了,我要禁言你 {duration} 秒,原因:{reason}"
|
||||
"{target},你完蛋了,我要禁言你 {duration} 秒,原因:{reason}",
|
||||
],
|
||||
description="成功禁言后发送的随机消息模板"
|
||||
description="成功禁言后发送的随机消息模板",
|
||||
),
|
||||
"error_messages": ConfigField(
|
||||
type=list,
|
||||
@@ -430,26 +434,30 @@ class MutePlugin(BasePlugin):
|
||||
"禁言时长必须是正数哦~",
|
||||
"禁言时长必须是数字哦~",
|
||||
"找不到 {target} 这个人呢~",
|
||||
"查找用户信息时出现问题~"
|
||||
"查找用户信息时出现问题~",
|
||||
],
|
||||
description="执行禁言过程中发生错误时发送的随机消息模板"
|
||||
)
|
||||
description="执行禁言过程中发生错误时发送的随机消息模板",
|
||||
),
|
||||
},
|
||||
"smart_mute": {
|
||||
"strict_mode": ConfigField(type=bool, default=True, description="LLM判定的严格模式"),
|
||||
"keyword_sensitivity": ConfigField(type=str, default="normal", description="关键词激活的敏感度", choices=["low", "normal", "high"]),
|
||||
"allow_parallel": ConfigField(type=bool, default=False, description="是否允许并行执行(暂未启用)")
|
||||
"keyword_sensitivity": ConfigField(
|
||||
type=str, default="normal", description="关键词激活的敏感度", choices=["low", "normal", "high"]
|
||||
),
|
||||
"allow_parallel": ConfigField(type=bool, default=False, description="是否允许并行执行(暂未启用)"),
|
||||
},
|
||||
"mute_command": {
|
||||
"max_batch_size": ConfigField(type=int, default=5, description="最大批量禁言数量(未来功能)"),
|
||||
"cooldown_seconds": ConfigField(type=int, default=3, description="命令冷却时间(秒)")
|
||||
"cooldown_seconds": ConfigField(type=int, default=3, description="命令冷却时间(秒)"),
|
||||
},
|
||||
"logging": {
|
||||
"level": ConfigField(type=str, default="INFO", description="日志记录级别", choices=["DEBUG", "INFO", "WARNING", "ERROR"]),
|
||||
"level": ConfigField(
|
||||
type=str, default="INFO", description="日志记录级别", choices=["DEBUG", "INFO", "WARNING", "ERROR"]
|
||||
),
|
||||
"prefix": ConfigField(type=str, default="[MutePlugin]", description="日志记录前缀"),
|
||||
"include_user_info": ConfigField(type=bool, default=True, description="日志中是否包含用户信息"),
|
||||
"include_duration_info": ConfigField(type=bool, default=True, description="日志中是否包含禁言时长信息")
|
||||
}
|
||||
"include_duration_info": ConfigField(type=bool, default=True, description="日志中是否包含禁言时长信息"),
|
||||
},
|
||||
}
|
||||
|
||||
def get_plugin_components(self) -> List[Tuple[ComponentInfo, Type]]:
|
||||
|
||||
@@ -112,7 +112,7 @@ class TTSPlugin(BasePlugin):
|
||||
config_section_descriptions = {
|
||||
"plugin": "插件基本信息配置",
|
||||
"components": "组件启用控制",
|
||||
"logging": "日志记录相关配置"
|
||||
"logging": "日志记录相关配置",
|
||||
}
|
||||
|
||||
# 配置Schema定义
|
||||
@@ -121,15 +121,15 @@ class TTSPlugin(BasePlugin):
|
||||
"name": ConfigField(type=str, default="tts_plugin", description="插件名称", required=True),
|
||||
"version": ConfigField(type=str, default="0.1.0", description="插件版本号"),
|
||||
"enabled": ConfigField(type=bool, default=True, description="是否启用插件"),
|
||||
"description": ConfigField(type=str, default="文字转语音插件", description="插件描述", required=True)
|
||||
},
|
||||
"components": {
|
||||
"enable_tts": ConfigField(type=bool, default=True, description="是否启用TTS Action")
|
||||
"description": ConfigField(type=str, default="文字转语音插件", description="插件描述", required=True),
|
||||
},
|
||||
"components": {"enable_tts": ConfigField(type=bool, default=True, description="是否启用TTS Action")},
|
||||
"logging": {
|
||||
"level": ConfigField(type=str, default="INFO", description="日志记录级别", choices=["DEBUG", "INFO", "WARNING", "ERROR"]),
|
||||
"prefix": ConfigField(type=str, default="[TTS]", description="日志记录前缀")
|
||||
}
|
||||
"level": ConfigField(
|
||||
type=str, default="INFO", description="日志记录级别", choices=["DEBUG", "INFO", "WARNING", "ERROR"]
|
||||
),
|
||||
"prefix": ConfigField(type=str, default="[TTS]", description="日志记录前缀"),
|
||||
},
|
||||
}
|
||||
|
||||
def get_plugin_components(self) -> List[Tuple[ComponentInfo, Type]]:
|
||||
|
||||
@@ -128,25 +128,22 @@ class VTBPlugin(BasePlugin):
|
||||
"name": ConfigField(type=str, default="vtb_plugin", description="插件名称", required=True),
|
||||
"version": ConfigField(type=str, default="0.1.0", description="插件版本号"),
|
||||
"enabled": ConfigField(type=bool, default=True, description="是否启用插件"),
|
||||
"description": ConfigField(type=str, default="虚拟主播情感表达插件", description="插件描述", required=True)
|
||||
},
|
||||
"components": {
|
||||
"enable_vtb": ConfigField(type=bool, default=True, description="是否启用VTB动作")
|
||||
"description": ConfigField(type=str, default="虚拟主播情感表达插件", description="插件描述", required=True),
|
||||
},
|
||||
"components": {"enable_vtb": ConfigField(type=bool, default=True, description="是否启用VTB动作")},
|
||||
"vtb_action": {
|
||||
"random_activation_probability": ConfigField(
|
||||
type=float,
|
||||
default=0.08,
|
||||
description="Normal模式下,随机触发VTB动作的概率(0.0到1.0)",
|
||||
example=0.1
|
||||
type=float, default=0.08, description="Normal模式下,随机触发VTB动作的概率(0.0到1.0)", example=0.1
|
||||
),
|
||||
"max_text_length": ConfigField(type=int, default=100, description="用于VTB动作的情感描述文本的最大长度"),
|
||||
"default_emotion": ConfigField(type=str, default="平静", description="当没有有效输入时,默认表达的情感")
|
||||
"default_emotion": ConfigField(type=str, default="平静", description="当没有有效输入时,默认表达的情感"),
|
||||
},
|
||||
"logging": {
|
||||
"level": ConfigField(type=str, default="INFO", description="日志级别", choices=["DEBUG", "INFO", "WARNING", "ERROR"]),
|
||||
"prefix": ConfigField(type=str, default="[VTB]", description="日志记录前缀")
|
||||
}
|
||||
"level": ConfigField(
|
||||
type=str, default="INFO", description="日志级别", choices=["DEBUG", "INFO", "WARNING", "ERROR"]
|
||||
),
|
||||
"prefix": ConfigField(type=str, default="[VTB]", description="日志记录前缀"),
|
||||
},
|
||||
}
|
||||
|
||||
def get_plugin_components(self) -> List[Tuple[ComponentInfo, Type]]:
|
||||
|
||||
Reference in New Issue
Block a user