feat: 全新智能体功能
- 基于先进智能体框架,增加智能体编排功能 - 增加智能体聊天,并对接持久化
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package tech.easyflow.agent.config;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Agent 模块自动配置。
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@MapperScan("tech.easyflow.agent.mapper")
|
||||
@EnableConfigurationProperties(AgentRuntimeProperties.class)
|
||||
public class AgentModuleConfig {
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package tech.easyflow.agent.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
/**
|
||||
* Agent 运行态生产化配置。
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "easyflow.agent.runtime")
|
||||
public class AgentRuntimeProperties {
|
||||
|
||||
/**
|
||||
* Redis 热态 session 缓存 TTL。
|
||||
*/
|
||||
private Duration sessionCacheTtl = Duration.ofHours(24);
|
||||
|
||||
/**
|
||||
* HITL pending 默认过期时间。
|
||||
*/
|
||||
private Duration hitlPendingTimeout = Duration.ofMinutes(30);
|
||||
|
||||
/**
|
||||
* 运行锁等待时间。
|
||||
*/
|
||||
private Duration lockWaitTimeout = Duration.ofSeconds(2);
|
||||
|
||||
/**
|
||||
* 运行锁租约时间。
|
||||
*/
|
||||
private Duration lockLeaseTimeout = Duration.ofMinutes(5);
|
||||
|
||||
/**
|
||||
* 运行锁续期间隔。
|
||||
*/
|
||||
private Duration lockRenewInterval = Duration.ofMinutes(1);
|
||||
|
||||
/**
|
||||
* 获取 Redis 热态 session 缓存 TTL。
|
||||
*
|
||||
* @return 缓存 TTL
|
||||
*/
|
||||
public Duration getSessionCacheTtl() {
|
||||
return sessionCacheTtl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 Redis 热态 session 缓存 TTL。
|
||||
*
|
||||
* @param sessionCacheTtl 缓存 TTL
|
||||
*/
|
||||
public void setSessionCacheTtl(Duration sessionCacheTtl) {
|
||||
this.sessionCacheTtl = sessionCacheTtl == null ? Duration.ofHours(24) : sessionCacheTtl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 HITL pending 默认过期时间。
|
||||
*
|
||||
* @return 过期时间
|
||||
*/
|
||||
public Duration getHitlPendingTimeout() {
|
||||
return hitlPendingTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 HITL pending 默认过期时间。
|
||||
*
|
||||
* @param hitlPendingTimeout 过期时间
|
||||
*/
|
||||
public void setHitlPendingTimeout(Duration hitlPendingTimeout) {
|
||||
this.hitlPendingTimeout = hitlPendingTimeout == null ? Duration.ofMinutes(30) : hitlPendingTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取运行锁等待时间。
|
||||
*
|
||||
* @return 等待时间
|
||||
*/
|
||||
public Duration getLockWaitTimeout() {
|
||||
return lockWaitTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置运行锁等待时间。
|
||||
*
|
||||
* @param lockWaitTimeout 等待时间
|
||||
*/
|
||||
public void setLockWaitTimeout(Duration lockWaitTimeout) {
|
||||
this.lockWaitTimeout = lockWaitTimeout == null ? Duration.ofSeconds(2) : lockWaitTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取运行锁租约时间。
|
||||
*
|
||||
* @return 租约时间
|
||||
*/
|
||||
public Duration getLockLeaseTimeout() {
|
||||
return lockLeaseTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置运行锁租约时间。
|
||||
*
|
||||
* @param lockLeaseTimeout 租约时间
|
||||
*/
|
||||
public void setLockLeaseTimeout(Duration lockLeaseTimeout) {
|
||||
this.lockLeaseTimeout = lockLeaseTimeout == null ? Duration.ofMinutes(5) : lockLeaseTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取运行锁续期间隔。
|
||||
*
|
||||
* @return 续期间隔
|
||||
*/
|
||||
public Duration getLockRenewInterval() {
|
||||
return lockRenewInterval;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置运行锁续期间隔。
|
||||
*
|
||||
* @param lockRenewInterval 续期间隔
|
||||
*/
|
||||
public void setLockRenewInterval(Duration lockRenewInterval) {
|
||||
this.lockRenewInterval = lockRenewInterval == null ? Duration.ofMinutes(1) : lockRenewInterval;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user