diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/property/agent/AgentConfig.java b/liteflow-core/src/main/java/com/yomahub/liteflow/property/agent/AgentConfig.java index 6990d02d2..4291039c1 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/property/agent/AgentConfig.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/property/agent/AgentConfig.java @@ -29,6 +29,9 @@ public class AgentConfig { /** 日志开关配置,控制 ReAct 内部 reason / act / error 等事件日志是否输出。 */ private LoggingConfig logging = new LoggingConfig(); + /** 技能配置,控制 ReAct Agent 是否启用配置驱动的技能目录与解析策略。 */ + private SkillsConfig skills = new SkillsConfig(); + /** OpenAI 头等平台凭证({@code liteflow.agent.openai.*}),由 {@code OpenAISpec} 解析使用。 */ private PlatformCredential openai = new PlatformCredential(); @@ -93,6 +96,14 @@ public class AgentConfig { this.logging = v; } + public SkillsConfig getSkills() { + return skills; + } + + public void setSkills(SkillsConfig skills) { + this.skills = skills; + } + public PlatformCredential getOpenai() { return openai; } diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/property/agent/SkillsConfig.java b/liteflow-core/src/main/java/com/yomahub/liteflow/property/agent/SkillsConfig.java new file mode 100644 index 000000000..dc8ffd635 --- /dev/null +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/property/agent/SkillsConfig.java @@ -0,0 +1,56 @@ +package com.yomahub.liteflow.property.agent; + +/** + * Agent 技能配置,对应配置段 {@code liteflow.agent.skills.*}。 + * + *
用于控制 ReAct Agent 是否启用配置驱动的技能目录,以及技能配置解析时 + * 是否采用严格模式。 + */ +public class SkillsConfig { + + /** + * 是否启用配置驱动的技能支持。 + * + *
默认关闭,保持现有 agent 行为不变。 + */ + private boolean enabled = false; + + /** + * 技能目录路径。 + * + *
默认读取当前工作目录下的 {@code ./skills},后续技能加载逻辑会基于该路径 + * 查找技能配置文件。 + */ + private String path = "./skills"; + + /** + * 是否使用严格解析模式。 + * + *
默认开启,后续技能解析遇到非法配置时可据此决定是否快速失败。 + */ + private boolean strict = true; + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public boolean isStrict() { + return strict; + } + + public void setStrict(boolean strict) { + this.strict = strict; + } +}