From 264cdb09e51fb3eb08e50804a03d4ea534f41873 Mon Sep 17 00:00:00 2001 From: slhafzjw Date: Tue, 11 Nov 2025 16:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=BF=9B=E8=A1=8C=E5=8A=A8=E5=B9=B2?= =?UTF-8?q?=E9=A2=84=E6=A8=A1=E5=9D=97;=20=E6=8E=A5=E4=B8=8B=E6=9D=A5?= =?UTF-8?q?=E5=B0=86=E8=BF=9B=E4=B8=80=E6=AD=A5=E5=AE=8C=E5=96=84=20Interv?= =?UTF-8?q?entionHandler=20=E7=9A=84=E5=85=B7=E4=BD=93=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整相关目录为 interventor - 调整了某些 ActionInterventor 的子模块用到的数据类结构 - 完善了 InterventionEvaluator 的具体逻辑 - 为 InterventionType 添加了注释,并新增了 CANCEL 干预类型 --- .../evaluator/InterventionEvaluator.java | 28 ------ .../handler/InterventionHandler.java | 16 ---- .../handler/entity/InterventionType.java | 5 - .../ActionInterventor.java | 41 +++++---- .../evaluator/InterventionEvaluator.java | 92 +++++++++++++++++++ .../evaluator/entity/EvaluatorInput.java | 7 +- .../evaluator/entity/EvaluatorResult.java | 7 +- .../handler/InterventionHandler.java | 36 ++++++++ .../handler/entity/HandlerInput.java | 4 +- .../handler/entity/InterventionType.java | 28 ++++++ .../recognizer/InterventionRecognizer.java | 8 +- .../entity/MetaRecognizerResult.java | 2 +- .../recognizer/entity/RecognizerInput.java | 2 +- .../recognizer/entity/RecognizerResult.java | 2 +- 14 files changed, 195 insertions(+), 83 deletions(-) delete mode 100644 Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/evaluator/InterventionEvaluator.java delete mode 100644 Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/handler/InterventionHandler.java delete mode 100644 Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/handler/entity/InterventionType.java rename Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/{identifier => interventor}/ActionInterventor.java (81%) create mode 100644 Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/evaluator/InterventionEvaluator.java rename Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/{identifier => interventor}/evaluator/entity/EvaluatorInput.java (55%) rename Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/{identifier => interventor}/evaluator/entity/EvaluatorResult.java (74%) create mode 100644 Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/handler/InterventionHandler.java rename Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/{identifier => interventor}/handler/entity/HandlerInput.java (70%) create mode 100644 Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/handler/entity/InterventionType.java rename Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/{identifier => interventor}/recognizer/InterventionRecognizer.java (90%) rename Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/{identifier => interventor}/recognizer/entity/MetaRecognizerResult.java (60%) rename Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/{identifier => interventor}/recognizer/entity/RecognizerInput.java (87%) rename Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/{identifier => interventor}/recognizer/entity/RecognizerResult.java (82%) diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/evaluator/InterventionEvaluator.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/evaluator/InterventionEvaluator.java deleted file mode 100644 index abae5166..00000000 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/evaluator/InterventionEvaluator.java +++ /dev/null @@ -1,28 +0,0 @@ -package work.slhaf.partner.module.modules.action.identifier.evaluator; - -import work.slhaf.partner.api.agent.factory.module.annotation.AgentSubModule; -import work.slhaf.partner.api.agent.runtime.interaction.flow.abstracts.ActivateModel; -import work.slhaf.partner.api.agent.runtime.interaction.flow.abstracts.AgentRunningSubModule; -import work.slhaf.partner.module.modules.action.identifier.evaluator.entity.EvaluatorInput; -import work.slhaf.partner.module.modules.action.identifier.evaluator.entity.EvaluatorResult; - -@AgentSubModule -public class InterventionEvaluator extends AgentRunningSubModule implements ActivateModel { - - @Override - public EvaluatorResult execute(EvaluatorInput data) { - //基于干预意图、记忆切片、交互上下文、已有行动程序综合评估,尝试选取出合适的行动程序,对目标行动链做出调整 - - return null; - } - - @Override - public String modelKey() { - return "intervention_evaluator"; - } - - @Override - public boolean withBasicPrompt() { - return true; - } -} diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/handler/InterventionHandler.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/handler/InterventionHandler.java deleted file mode 100644 index 76331573..00000000 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/handler/InterventionHandler.java +++ /dev/null @@ -1,16 +0,0 @@ -package work.slhaf.partner.module.modules.action.identifier.handler; - -import work.slhaf.partner.api.agent.factory.module.annotation.AgentSubModule; -import work.slhaf.partner.api.agent.runtime.interaction.flow.abstracts.AgentRunningSubModule; -import work.slhaf.partner.module.modules.action.identifier.handler.entity.HandlerInput; - -@AgentSubModule -public class InterventionHandler extends AgentRunningSubModule { - - @Override - public Void execute(HandlerInput data) { - - return null; - } - -} diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/handler/entity/InterventionType.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/handler/entity/InterventionType.java deleted file mode 100644 index 821249b5..00000000 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/handler/entity/InterventionType.java +++ /dev/null @@ -1,5 +0,0 @@ -package work.slhaf.partner.module.modules.action.identifier.handler.entity; - -public enum InterventionType { - APPEND, INSERT, REBUILD, DELETE -} diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/ActionInterventor.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/ActionInterventor.java similarity index 81% rename from Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/ActionInterventor.java rename to Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/ActionInterventor.java index 557b1a90..9721e8f8 100644 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/ActionInterventor.java +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/ActionInterventor.java @@ -1,4 +1,4 @@ -package work.slhaf.partner.module.modules.action.identifier; +package work.slhaf.partner.module.modules.action.interventor; import com.alibaba.fastjson2.JSONObject; import work.slhaf.partner.api.agent.factory.capability.annotation.InjectCapability; @@ -10,16 +10,16 @@ import work.slhaf.partner.core.action.ActionCore.PhaserRecord; import work.slhaf.partner.core.cognation.CognationCapability; import work.slhaf.partner.core.memory.MemoryCapability; import work.slhaf.partner.module.common.module.PreRunningModule; -import work.slhaf.partner.module.modules.action.identifier.evaluator.InterventionEvaluator; -import work.slhaf.partner.module.modules.action.identifier.evaluator.entity.EvaluatorInput; -import work.slhaf.partner.module.modules.action.identifier.evaluator.entity.EvaluatorResult; -import work.slhaf.partner.module.modules.action.identifier.evaluator.entity.EvaluatorResult.EvaluatedInterventionData; -import work.slhaf.partner.module.modules.action.identifier.handler.InterventionHandler; -import work.slhaf.partner.module.modules.action.identifier.handler.entity.HandlerInput; -import work.slhaf.partner.module.modules.action.identifier.handler.entity.HandlerInput.HandlerInputData; -import work.slhaf.partner.module.modules.action.identifier.recognizer.InterventionRecognizer; -import work.slhaf.partner.module.modules.action.identifier.recognizer.entity.RecognizerInput; -import work.slhaf.partner.module.modules.action.identifier.recognizer.entity.RecognizerResult; +import work.slhaf.partner.module.modules.action.interventor.evaluator.InterventionEvaluator; +import work.slhaf.partner.module.modules.action.interventor.evaluator.entity.EvaluatorInput; +import work.slhaf.partner.module.modules.action.interventor.evaluator.entity.EvaluatorResult; +import work.slhaf.partner.module.modules.action.interventor.evaluator.entity.EvaluatorResult.EvaluatedInterventionData; +import work.slhaf.partner.module.modules.action.interventor.handler.InterventionHandler; +import work.slhaf.partner.module.modules.action.interventor.handler.entity.HandlerInput; +import work.slhaf.partner.module.modules.action.interventor.handler.entity.HandlerInput.HandlerInputData; +import work.slhaf.partner.module.modules.action.interventor.recognizer.InterventionRecognizer; +import work.slhaf.partner.module.modules.action.interventor.recognizer.entity.RecognizerInput; +import work.slhaf.partner.module.modules.action.interventor.recognizer.entity.RecognizerResult; import work.slhaf.partner.runtime.interaction.data.context.PartnerRunningFlowContext; import java.util.*; @@ -60,23 +60,23 @@ public class ActionInterventor extends PreRunningModule implements ActivateModel String uuid = context.getUuid(); String userId = context.getUserId(); RecognizerResult recognizerResult = interventionRecognizer - .execute(buildRecognizerInput(userId, context.getInput())); + .execute(buildRecognizerInput(userId, context.getInput())); //此处的输入内容携带了所有 PhaserRecord if (!recognizerResult.isOk()) { // 设置相应prompt setupNoInterventionPrompt(uuid); return; } // 存在则进一步评估、评估通过则并直接添加行动程序至对应行动链 - Map recognizedInterventions = recognizerResult.getInterventions(); + Map recognizedInterventions = recognizerResult.getInterventions(); //这里的 PhaserRecord 已包含从 ActionCore 获取到的执行状态下的行动及其Phaser实例 EvaluatorResult evaluatorResult = interventionEvaluator - .execute(buildEvaluatorInput(recognizedInterventions.keySet(), userId)); - List interventions = evaluatorResult.getDataList(); + .execute(buildEvaluatorInput(recognizedInterventions, userId)); + List interventions = evaluatorResult.getDataList(); //这里的 EvaluatedInterventionData 中的 tendency 即为 recognizedInterventions 中的键 if (evaluatorResult.isOk() && isActionKeysExist(interventions)) { setupErrorInterventionPrompt(uuid); } else if (evaluatorResult.isOk()) { - // 同步写入prompt,异步处理干预行为 + // 同步写入prompt,异步处理干预行为,‘异步’在 interventionHandler 中体现 setupInterventionPrompt(uuid, interventions); - interventionHandler.execute(buildHandlerInput(interventions)); + interventionHandler.execute(buildHandlerInput(interventions, recognizedInterventions)); } else { // 同步写入prompt setupInterventionIgnoredPrompt(uuid, interventions); @@ -100,7 +100,7 @@ public class ActionInterventor extends PreRunningModule implements ActivateModel return true; } - private HandlerInput buildHandlerInput(List interventions) { + private HandlerInput buildHandlerInput(List interventions, Map recognizedInterventions) { HandlerInput input = new HandlerInput(); List inputDataList = input.getData(); for (EvaluatedInterventionData interventionData : interventions) { @@ -109,6 +109,7 @@ public class ActionInterventor extends PreRunningModule implements ActivateModel inputData.setDescription(interventionData.getDescription()); inputData.setType(interventionData.getType()); inputData.setActions(interventionData.getActions()); + inputData.setRecord(recognizedInterventions.get(interventionData.getTendency())); inputDataList.add(inputData); } return input; @@ -166,9 +167,9 @@ public class ActionInterventor extends PreRunningModule implements ActivateModel "[干预行动] <将对已存在行动做出的行为>", "无行动")); } - private EvaluatorInput buildEvaluatorInput(Set interventionTendencies, String userId) { + private EvaluatorInput buildEvaluatorInput(Map recognizedInterventions, String userId) { EvaluatorInput input = new EvaluatorInput(); - input.setInterventionTendencies(interventionTendencies); + input.setInterventionTendencies(recognizedInterventions); input.setRecentMessages(cognationCapability.getChatMessages()); input.setActivatedSlices(memoryCapability.getActivatedSlices(userId)); return input; diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/evaluator/InterventionEvaluator.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/evaluator/InterventionEvaluator.java new file mode 100644 index 00000000..562ee755 --- /dev/null +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/evaluator/InterventionEvaluator.java @@ -0,0 +1,92 @@ +package work.slhaf.partner.module.modules.action.interventor.evaluator; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; + +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; + +import lombok.extern.slf4j.Slf4j; +import work.slhaf.partner.api.agent.factory.capability.annotation.InjectCapability; +import work.slhaf.partner.api.agent.factory.module.annotation.AgentSubModule; +import work.slhaf.partner.api.agent.runtime.interaction.flow.abstracts.ActivateModel; +import work.slhaf.partner.api.agent.runtime.interaction.flow.abstracts.AgentRunningSubModule; +import work.slhaf.partner.api.chat.pojo.ChatResponse; +import work.slhaf.partner.api.chat.pojo.Message; +import work.slhaf.partner.core.action.ActionCapability; +import work.slhaf.partner.core.action.ActionCore.ExecutorType; +import work.slhaf.partner.core.action.ActionCore.PhaserRecord; +import work.slhaf.partner.core.memory.pojo.EvaluatedSlice; +import work.slhaf.partner.module.modules.action.interventor.evaluator.entity.EvaluatorInput; +import work.slhaf.partner.module.modules.action.interventor.evaluator.entity.EvaluatorResult; +import work.slhaf.partner.module.modules.action.interventor.evaluator.entity.EvaluatorResult.EvaluatedInterventionData; + +@Slf4j +@AgentSubModule +public class InterventionEvaluator extends AgentRunningSubModule + implements ActivateModel { + + @InjectCapability + private ActionCapability actionCapability; + + @Override + public EvaluatorResult execute(EvaluatorInput data) { + // 基于干预意图、记忆切片、交互上下文、已有行动程序综合评估,尝试评估并选取出合适的行动程序,交付给 ActionInterventor + EvaluatorResult result = new EvaluatorResult(); + List evaluatedDataList = result.getDataList(); + + Map interventionTendencies = data.getInterventionTendencies(); + Set tendencies = interventionTendencies.keySet(); + ExecutorService executor = actionCapability.getExecutor(ExecutorType.VIRTUAL); + + CountDownLatch latch = new CountDownLatch(tendencies.size()); + tendencies.forEach(tendency -> { + executor.execute(() -> { + try { + String input = buildPrompt(data.getRecentMessages(), data.getActivatedSlices(), + interventionTendencies.get(tendency), tendency); + ChatResponse response = singleChat(input); + EvaluatedInterventionData evaluatedData = JSONObject.parseObject(response.getMessage(), + EvaluatedInterventionData.class); + synchronized (evaluatedDataList) { + evaluatedDataList.add(evaluatedData); + } + } catch (Exception e) { + log.error("干预意图评估出错: " + tendency, e); + } finally { + latch.countDown(); + } + }); + }); + try { + latch.await(); + } catch (InterruptedException e) { + log.warn("CountDownLatch阻塞已中断"); + } + + return result; + } + + private String buildPrompt(List recentMessages, List activatedSlices, + PhaserRecord phaserRecord, String tendency) { + JSONObject json = new JSONObject(); + json.put("干预倾向", tendency); + json.putArray("近期对话").addAll(recentMessages); + json.putArray("参考记忆").addAll(activatedSlices); + json.put("将干预的行动", JSONObject.toJSONString(phaserRecord.actionData())); + return json.toJSONString(); + } + + @Override + public String modelKey() { + return "intervention_evaluator"; + } + + @Override + public boolean withBasicPrompt() { + return false; + } +} diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/evaluator/entity/EvaluatorInput.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/evaluator/entity/EvaluatorInput.java similarity index 55% rename from Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/evaluator/entity/EvaluatorInput.java rename to Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/evaluator/entity/EvaluatorInput.java index aa5e1c0d..af01c874 100644 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/evaluator/entity/EvaluatorInput.java +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/evaluator/entity/EvaluatorInput.java @@ -1,15 +1,16 @@ -package work.slhaf.partner.module.modules.action.identifier.evaluator.entity; +package work.slhaf.partner.module.modules.action.interventor.evaluator.entity; import lombok.Data; import work.slhaf.partner.api.chat.pojo.Message; +import work.slhaf.partner.core.action.ActionCore.PhaserRecord; import work.slhaf.partner.core.memory.pojo.EvaluatedSlice; import java.util.List; -import java.util.Set; +import java.util.Map; @Data public class EvaluatorInput { - private Set interventionTendencies; + private Map interventionTendencies; private List activatedSlices; private List recentMessages; } diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/evaluator/entity/EvaluatorResult.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/evaluator/entity/EvaluatorResult.java similarity index 74% rename from Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/evaluator/entity/EvaluatorResult.java rename to Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/evaluator/entity/EvaluatorResult.java index 0b2e6468..eeda3cb6 100644 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/evaluator/entity/EvaluatorResult.java +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/evaluator/entity/EvaluatorResult.java @@ -1,10 +1,11 @@ -package work.slhaf.partner.module.modules.action.identifier.evaluator.entity; +package work.slhaf.partner.module.modules.action.interventor.evaluator.entity; +import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import lombok.Data; -import work.slhaf.partner.module.modules.action.identifier.handler.entity.InterventionType; +import work.slhaf.partner.module.modules.action.interventor.handler.entity.InterventionType; /** * 干预倾向评估结果,包含评估通过的倾向文本、对行动链的行为、指定操作的行动单元key、未通过的原因 @@ -15,7 +16,7 @@ public class EvaluatorResult { * 是否存在通过的干预倾向 */ private boolean ok; - private List dataList; + private List dataList = new ArrayList<>(); @Data public static class EvaluatedInterventionData { diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/handler/InterventionHandler.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/handler/InterventionHandler.java new file mode 100644 index 00000000..ade553f0 --- /dev/null +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/handler/InterventionHandler.java @@ -0,0 +1,36 @@ +package work.slhaf.partner.module.modules.action.interventor.handler; + +import java.util.List; +import java.util.concurrent.ExecutorService; + +import lombok.extern.slf4j.Slf4j; +import work.slhaf.partner.api.agent.factory.capability.annotation.InjectCapability; +import work.slhaf.partner.api.agent.factory.module.annotation.AgentSubModule; +import work.slhaf.partner.api.agent.runtime.interaction.flow.abstracts.AgentRunningSubModule; +import work.slhaf.partner.core.action.ActionCapability; +import work.slhaf.partner.core.action.ActionCore.ExecutorType; +import work.slhaf.partner.module.modules.action.interventor.handler.entity.HandlerInput; +import work.slhaf.partner.module.modules.action.interventor.handler.entity.HandlerInput.HandlerInputData; + +@Slf4j +@AgentSubModule +public class InterventionHandler extends AgentRunningSubModule { + + @InjectCapability + private ActionCapability actionCapability; + + @Override + public Void execute(HandlerInput data) { + ExecutorService executor = actionCapability.getExecutor(ExecutorType.VIRTUAL); + executor.execute(() -> { + log.debug("干预开始执行"); + List dataList = data.getData(); + for (HandlerInputData inputData : dataList) { + log.debug("干预操作: {}, 干预类型: {}",inputData.getTendency(),inputData.getType()); + + } + }); + return null; + } + +} diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/handler/entity/HandlerInput.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/handler/entity/HandlerInput.java similarity index 70% rename from Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/handler/entity/HandlerInput.java rename to Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/handler/entity/HandlerInput.java index d78b8a60..21beb361 100644 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/handler/entity/HandlerInput.java +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/handler/entity/HandlerInput.java @@ -1,10 +1,11 @@ -package work.slhaf.partner.module.modules.action.identifier.handler.entity; +package work.slhaf.partner.module.modules.action.interventor.handler.entity; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import lombok.Data; +import work.slhaf.partner.core.action.ActionCore.PhaserRecord; @Data public class HandlerInput { @@ -17,5 +18,6 @@ public class HandlerInput { private String description; private InterventionType type; private LinkedHashMap actions; + private PhaserRecord record; } } diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/handler/entity/InterventionType.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/handler/entity/InterventionType.java new file mode 100644 index 00000000..ba1de1cc --- /dev/null +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/handler/entity/InterventionType.java @@ -0,0 +1,28 @@ +package work.slhaf.partner.module.modules.action.interventor.handler.entity; + +public enum InterventionType { + /** + * 追加行动: 追加至指定行动链序列之后才执行 + */ + APPEND, + + /** + * 插入行动: 指定行动链序列执行过程中即时新增并执行 + */ + INSERT, + + /** + * 重建行动: 重建指定行动链序列之后的所有行动内容 + */ + REBUILD, + + /** + * 删除行动: 删除指定行动链序列上的指定行动单元 + */ + DELETE, + + /** + * 取消行动链: 中断并取消指定行动链的执行 + */ + CANCEL +} diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/InterventionRecognizer.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/InterventionRecognizer.java similarity index 90% rename from Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/InterventionRecognizer.java rename to Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/InterventionRecognizer.java index 1420ec5b..6cb694d9 100644 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/InterventionRecognizer.java +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/InterventionRecognizer.java @@ -1,4 +1,4 @@ -package work.slhaf.partner.module.modules.action.identifier.recognizer; +package work.slhaf.partner.module.modules.action.interventor.recognizer; import com.alibaba.fastjson2.JSONObject; import lombok.extern.slf4j.Slf4j; @@ -10,9 +10,9 @@ import work.slhaf.partner.api.chat.pojo.ChatResponse; import work.slhaf.partner.core.action.ActionCapability; import work.slhaf.partner.core.action.ActionCore; import work.slhaf.partner.core.action.entity.ActionData; -import work.slhaf.partner.module.modules.action.identifier.recognizer.entity.MetaRecognizerResult; -import work.slhaf.partner.module.modules.action.identifier.recognizer.entity.RecognizerInput; -import work.slhaf.partner.module.modules.action.identifier.recognizer.entity.RecognizerResult; +import work.slhaf.partner.module.modules.action.interventor.recognizer.entity.MetaRecognizerResult; +import work.slhaf.partner.module.modules.action.interventor.recognizer.entity.RecognizerInput; +import work.slhaf.partner.module.modules.action.interventor.recognizer.entity.RecognizerResult; import java.util.List; import java.util.Map; diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/entity/MetaRecognizerResult.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/entity/MetaRecognizerResult.java similarity index 60% rename from Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/entity/MetaRecognizerResult.java rename to Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/entity/MetaRecognizerResult.java index d3d963dd..4c81233b 100644 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/entity/MetaRecognizerResult.java +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/entity/MetaRecognizerResult.java @@ -1,4 +1,4 @@ -package work.slhaf.partner.module.modules.action.identifier.recognizer.entity; +package work.slhaf.partner.module.modules.action.interventor.recognizer.entity; import lombok.Data; diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/entity/RecognizerInput.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/entity/RecognizerInput.java similarity index 87% rename from Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/entity/RecognizerInput.java rename to Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/entity/RecognizerInput.java index f4216adf..4b7c8153 100644 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/entity/RecognizerInput.java +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/entity/RecognizerInput.java @@ -1,4 +1,4 @@ -package work.slhaf.partner.module.modules.action.identifier.recognizer.entity; +package work.slhaf.partner.module.modules.action.interventor.recognizer.entity; import lombok.Data; import work.slhaf.partner.api.chat.pojo.Message; diff --git a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/entity/RecognizerResult.java b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/entity/RecognizerResult.java similarity index 82% rename from Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/entity/RecognizerResult.java rename to Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/entity/RecognizerResult.java index 384d0ed0..db52d39b 100644 --- a/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/identifier/recognizer/entity/RecognizerResult.java +++ b/Partner-Main/src/main/java/work/slhaf/partner/module/modules/action/interventor/recognizer/entity/RecognizerResult.java @@ -1,4 +1,4 @@ -package work.slhaf.partner.module.modules.action.identifier.recognizer.entity; +package work.slhaf.partner.module.modules.action.interventor.recognizer.entity; import lombok.Data; import work.slhaf.partner.core.action.ActionCore;