mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 16:53:04 +08:00
进行第二阶段调试修复: 部分InteractionContext相关类没有实现序列化,已修复
This commit is contained in:
@@ -2,11 +2,19 @@ package work.slhaf.agent.core.interaction.data.context.subcontext;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import work.slhaf.agent.common.serialize.PersistableObject;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.HashMap;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class CoreContext {
|
||||
public class CoreContext extends PersistableObject {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String text;
|
||||
private String dateTime;
|
||||
private String userNick;
|
||||
|
||||
@@ -2,13 +2,21 @@ package work.slhaf.agent.core.interaction.data.context.subcontext;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import work.slhaf.agent.common.serialize.PersistableObject;
|
||||
import work.slhaf.agent.module.common.AppendPromptData;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ModuleContext {
|
||||
public class ModuleContext extends PersistableObject {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private List<AppendPromptData> appendedPrompt = new ArrayList<>();
|
||||
private JSONObject extraContext = new JSONObject();
|
||||
private boolean finished = false;
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
package work.slhaf.agent.module.common;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import work.slhaf.agent.common.serialize.PersistableObject;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.HashMap;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class AppendPromptData {
|
||||
public class AppendPromptData extends PersistableObject {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String moduleName;
|
||||
private HashMap<String,String> appendedPrompt;
|
||||
}
|
||||
|
||||
@@ -121,10 +121,9 @@ public class CoreModel extends Model implements InteractionModule {
|
||||
}
|
||||
|
||||
private void activateModule(InteractionContext context) {
|
||||
HashMap<String, Boolean> activeModules = context.getCoreContext().getActiveModules();
|
||||
for (AppendPromptData data : context.getModuleContext().getAppendedPrompt()) {
|
||||
if (data.getAppendedPrompt().isEmpty()) continue;
|
||||
activeModules.put(data.getModuleName(), true);
|
||||
context.getCoreContext().activateModule(data.getModuleName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user