mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-06-10 03:07:32 +08:00
feat(agent): add skills configuration
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.yomahub.liteflow.property.agent;
|
||||
|
||||
/**
|
||||
* Agent 技能配置,对应配置段 {@code liteflow.agent.skills.*}。
|
||||
*
|
||||
* <p>用于控制 ReAct Agent 是否启用配置驱动的技能目录,以及技能配置解析时
|
||||
* 是否采用严格模式。
|
||||
*/
|
||||
public class SkillsConfig {
|
||||
|
||||
/**
|
||||
* 是否启用配置驱动的技能支持。
|
||||
*
|
||||
* <p>默认关闭,保持现有 agent 行为不变。
|
||||
*/
|
||||
private boolean enabled = false;
|
||||
|
||||
/**
|
||||
* 技能目录路径。
|
||||
*
|
||||
* <p>默认读取当前工作目录下的 {@code ./skills},后续技能加载逻辑会基于该路径
|
||||
* 查找技能配置文件。
|
||||
*/
|
||||
private String path = "./skills";
|
||||
|
||||
/**
|
||||
* 是否使用严格解析模式。
|
||||
*
|
||||
* <p>默认开启,后续技能解析遇到非法配置时可据此决定是否快速失败。
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user