新增配置加载功能并优化模型设置

- 新增 ConfigLoaderFactory 和 ModelConfigFactory 以及对应的默认实现用于加载模型配置和提示词列表
- 重构 ActivateModel 接口,支持基本提示和特定提示的加载,具体逻辑待实现,可通过ModelConfigFactory加载
- 优化模块注册和能力注入相关逻辑
- 添加了必要注释
This commit is contained in:
2025-07-31 22:13:10 +08:00
parent ade922cbc2
commit 64a7ed261e
35 changed files with 298 additions and 66 deletions

View File

@@ -14,7 +14,7 @@ public class ResourcesUtil {
private static final ClassLoader classloader = Agent.class.getClassLoader();
public static class Prompt {
private static final String SELF_AWARENESS_PATH = "prompt/self_awareness.json";
private static final String SELF_AWARENESS_PATH = "prompt/basic_prompt.json";
private static final String MODULE_PROMPT_PREFIX_PATH = "prompt/module/";
public static List<Message> loadPromptWithSelfAwareness(String modelKey, String promptType) {

View File

@@ -69,7 +69,7 @@ public class CoreModel extends CoreModule implements ActivateModel {
}
@Override
public boolean withAwareness() {
public boolean withBasicPrompt() {
return true;
}

View File

@@ -141,7 +141,7 @@ public class SliceSelectEvaluator extends AgentInteractionSubModule<EvaluatorInp
}
@Override
public boolean withAwareness() {
public boolean withBasicPrompt() {
return false;
}

View File

@@ -114,7 +114,7 @@ public class MemorySelectExtractor extends AgentInteractionSubModule<Interaction
}
@Override
public boolean withAwareness() {
public boolean withBasicPrompt() {
return false;
}

View File

@@ -71,7 +71,7 @@ public class MultiSummarizer extends AgentInteractionSubModule<SummarizeInput, S
}
@Override
public boolean withAwareness() {
public boolean withBasicPrompt() {
return true;
}

View File

@@ -83,7 +83,7 @@ public class SingleSummarizer extends AgentInteractionSubModule<List<Message>,Vo
}
@Override
public boolean withAwareness() {
public boolean withBasicPrompt() {
return false;
}

View File

@@ -49,7 +49,7 @@ public class TotalSummarizer extends AgentInteractionSubModule<HashMap<String, S
}
@Override
public boolean withAwareness() {
public boolean withBasicPrompt() {
return true;
}

View File

@@ -91,7 +91,7 @@ public class RelationExtractor extends AgentInteractionSubModule<InteractionCont
}
@Override
public boolean withAwareness() {
public boolean withBasicPrompt() {
return true;
}

View File

@@ -64,7 +64,7 @@ public class StaticMemoryExtractor extends AgentInteractionSubModule<Interaction
}
@Override
public boolean withAwareness() {
public boolean withBasicPrompt() {
return true;
}