This commit is contained in:
SengokuCola
2025-05-16 17:15:55 +08:00
parent fdd4ac8b4f
commit d19d5fe885
37 changed files with 409 additions and 1388 deletions

View File

@@ -4,15 +4,14 @@ from typing import Tuple
logger = get_logger("test_action")
@register_action
class TestAction(PluginAction):
"""测试动作处理类"""
action_name = "test_action"
action_description = "这是一个测试动作,当有人要求你测试插件系统时使用"
action_parameters = {
"test_param": "测试参数(可选)"
}
action_parameters = {"test_param": "测试参数(可选)"}
action_require = [
"测试情况下使用",
"想测试插件动作加载时使用",
@@ -22,17 +21,17 @@ class TestAction(PluginAction):
async def process(self) -> Tuple[bool, str]:
"""处理测试动作"""
logger.info(f"{self.log_prefix} 执行测试动作: {self.reasoning}")
# 获取聊天类型
chat_type = self.get_chat_type()
logger.info(f"{self.log_prefix} 当前聊天类型: {chat_type}")
# 获取最近消息
recent_messages = self.get_recent_messages(3)
logger.info(f"{self.log_prefix} 最近3条消息: {recent_messages}")
# 发送测试消息
test_param = self.action_data.get("test_param", "默认参数")
await self.send_message_by_expressor(f"测试动作执行成功,参数: {test_param}")
return True, "测试动作执行成功"
return True, "测试动作执行成功"