模块注解机制完成,待测试。

- 调整Api包下的目录结构
- 抽取方法‘递归收集某类的继承链上的所有类’中
- 移除 ModuleFactoryContext、ModuleRegisterFactory 中关于 Init 方法的加载逻辑,将在 ModuleInitHookExecuteFactory 中加载并执行
- 完善了 ActivateModel 接口中prompt通用加载的实现
- 移除原有的框架Demo实现,开始进行测试Demo的编写
This commit is contained in:
2025-08-07 23:33:11 +08:00
parent 35b7dc7cda
commit cf1578fd14
141 changed files with 624 additions and 686 deletions

11
.idea/misc.xml generated
View File

@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="EntryPointsManager"> <component name="EntryPointsManager">
<list size="3"> <list size="6">
<item index="0" class="java.lang.String" itemvalue="work.slhaf.partner.api.capability.annotation.CapabilityMethod" /> <item index="0" class="java.lang.String" itemvalue="work.slhaf.partner.api.agent.factory.capability.annotation.Capability" />
<item index="1" class="java.lang.String" itemvalue="work.slhaf.partner.api.capability.annotation.CoordinateManager" /> <item index="1" class="java.lang.String" itemvalue="work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityCore" />
<item index="2" class="java.lang.String" itemvalue="work.slhaf.partner.api.register.capability.annotation.Capability" /> <item index="2" class="java.lang.String" itemvalue="work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityMethod" />
<item index="3" class="java.lang.String" itemvalue="work.slhaf.partner.api.capability.annotation.CapabilityMethod" />
<item index="4" class="java.lang.String" itemvalue="work.slhaf.partner.api.capability.annotation.CoordinateManager" />
<item index="5" class="java.lang.String" itemvalue="work.slhaf.partner.api.register.capability.annotation.Capability" />
</list> </list>
</component> </component>
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />

View File

@@ -1,4 +1,5 @@
autoDetectedPackages: autoDetectedPackages:
- factory
- module - module
- work.slhaf - work.slhaf
enableAutoDetect: true enableAutoDetect: true

View File

@@ -1,10 +1,10 @@
package work.slhaf.partner.api; package work.slhaf.partner.api.agent;
import work.slhaf.partner.api.exception.AgentLaunchFailedException; import work.slhaf.partner.api.agent.exception.AgentLaunchFailedException;
import work.slhaf.partner.api.factory.AgentRegisterFactory; import work.slhaf.partner.api.agent.factory.AgentRegisterFactory;
import work.slhaf.partner.api.factory.module.pojo.MetaModule; import work.slhaf.partner.api.agent.factory.module.pojo.MetaModule;
import work.slhaf.partner.api.flow.AgentInteraction; import work.slhaf.partner.api.agent.flow.AgentInteraction;
import work.slhaf.partner.api.flow.entity.InteractionFlowContext; import work.slhaf.partner.api.agent.flow.entity.InteractionFlowContext;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@@ -1,7 +1,7 @@
package work.slhaf.partner.api.entity; package work.slhaf.partner.api.agent.entity;
import lombok.Data; import lombok.Data;
import work.slhaf.partner.api.factory.module.pojo.MetaModule; import work.slhaf.partner.api.agent.factory.module.pojo.MetaModule;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.exception; package work.slhaf.partner.api.agent.exception;
public class AgentLaunchFailedException extends RuntimeException { public class AgentLaunchFailedException extends RuntimeException {
public AgentLaunchFailedException(String message, Throwable cause) { public AgentLaunchFailedException(String message, Throwable cause) {

View File

@@ -1,7 +1,7 @@
package work.slhaf.partner.api.factory; package work.slhaf.partner.api.agent.factory;
import work.slhaf.partner.api.factory.capability.exception.CapabilityFactoryExecuteFailedException; import work.slhaf.partner.api.agent.factory.capability.exception.CapabilityFactoryExecuteFailedException;
import work.slhaf.partner.api.factory.context.AgentRegisterContext; import work.slhaf.partner.api.agent.factory.context.AgentRegisterContext;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;

View File

@@ -1,18 +1,18 @@
package work.slhaf.partner.api.factory; package work.slhaf.partner.api.agent.factory;
import org.reflections.util.ClasspathHelper; import org.reflections.util.ClasspathHelper;
import work.slhaf.partner.api.factory.capability.CapabilityCheckFactory; import work.slhaf.partner.api.agent.factory.capability.CapabilityCheckFactory;
import work.slhaf.partner.api.factory.capability.CapabilityInjectFactory; import work.slhaf.partner.api.agent.factory.capability.CapabilityInjectFactory;
import work.slhaf.partner.api.factory.capability.CapabilityRegisterFactory; import work.slhaf.partner.api.agent.factory.capability.CapabilityRegisterFactory;
import work.slhaf.partner.api.factory.config.ConfigLoaderFactory; import work.slhaf.partner.api.agent.factory.config.ConfigLoaderFactory;
import work.slhaf.partner.api.factory.context.AgentRegisterContext; import work.slhaf.partner.api.agent.factory.context.AgentRegisterContext;
import work.slhaf.partner.api.factory.exception.ExternalModuleLoadFailedException; import work.slhaf.partner.api.agent.factory.exception.ExternalModuleLoadFailedException;
import work.slhaf.partner.api.factory.exception.ExternalModulePathNotExistException; import work.slhaf.partner.api.agent.factory.exception.ExternalModulePathNotExistException;
import work.slhaf.partner.api.factory.module.ModuleCheckFactory; import work.slhaf.partner.api.agent.factory.module.ModuleCheckFactory;
import work.slhaf.partner.api.factory.module.ModulePreHookExecuteFactory; import work.slhaf.partner.api.agent.factory.module.ModuleInitHookExecuteFactory;
import work.slhaf.partner.api.factory.module.ModuleProxyFactory; import work.slhaf.partner.api.agent.factory.module.ModuleProxyFactory;
import work.slhaf.partner.api.factory.module.ModuleRegisterFactory; import work.slhaf.partner.api.agent.factory.module.ModuleRegisterFactory;
import work.slhaf.partner.api.factory.module.pojo.MetaModule; import work.slhaf.partner.api.agent.factory.module.pojo.MetaModule;
import java.io.File; import java.io.File;
import java.net.URL; import java.net.URL;
@@ -43,7 +43,7 @@ public class AgentRegisterFactory {
//. 先一步注入Capability,避免因前hook逻辑存在针对能力的引用而报错 //. 先一步注入Capability,避免因前hook逻辑存在针对能力的引用而报错
new CapabilityInjectFactory().execute(registerContext); new CapabilityInjectFactory().execute(registerContext);
//. 执行模块PreHook逻辑 //. 执行模块PreHook逻辑
new ModulePreHookExecuteFactory().execute(registerContext); new ModuleInitHookExecuteFactory().execute(registerContext);
return registerContext.getModuleFactoryContext().getModuleList(); return registerContext.getModuleFactoryContext().getModuleList();
} }

View File

@@ -1,21 +1,21 @@
package work.slhaf.partner.api.factory.capability; package work.slhaf.partner.api.agent.factory.capability;
import org.reflections.Reflections; import org.reflections.Reflections;
import work.slhaf.partner.api.common.util.AgentUtil; import work.slhaf.partner.api.agent.factory.AgentBaseFactory;
import work.slhaf.partner.api.factory.AgentBaseFactory; import work.slhaf.partner.api.agent.factory.capability.annotation.*;
import work.slhaf.partner.api.factory.capability.annotation.*; import work.slhaf.partner.api.agent.factory.capability.exception.DuplicateCapabilityException;
import work.slhaf.partner.api.factory.capability.exception.DuplicateCapabilityException; import work.slhaf.partner.api.agent.factory.capability.exception.UnMatchedCapabilityException;
import work.slhaf.partner.api.factory.capability.exception.UnMatchedCapabilityException; import work.slhaf.partner.api.agent.factory.capability.exception.UnMatchedCapabilityMethodException;
import work.slhaf.partner.api.factory.capability.exception.UnMatchedCapabilityMethodException; import work.slhaf.partner.api.agent.factory.capability.exception.UnMatchedCoordinatedMethodException;
import work.slhaf.partner.api.factory.capability.exception.UnMatchedCoordinatedMethodException; import work.slhaf.partner.api.agent.factory.context.AgentRegisterContext;
import work.slhaf.partner.api.factory.context.AgentRegisterContext; import work.slhaf.partner.api.agent.factory.context.CapabilityFactoryContext;
import work.slhaf.partner.api.factory.context.CapabilityFactoryContext; import work.slhaf.partner.api.agent.util.AgentUtil;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static work.slhaf.partner.api.common.util.AgentUtil.methodSignature; import static work.slhaf.partner.api.agent.util.AgentUtil.methodSignature;
/** /**
* 执行<code>Capability</code>相关检查 * 执行<code>Capability</code>相关检查

View File

@@ -1,13 +1,13 @@
package work.slhaf.partner.api.factory.capability; package work.slhaf.partner.api.agent.factory.capability;
import org.reflections.Reflections; import org.reflections.Reflections;
import work.slhaf.partner.api.factory.AgentBaseFactory; import work.slhaf.partner.api.agent.factory.AgentBaseFactory;
import work.slhaf.partner.api.factory.capability.annotation.Capability; import work.slhaf.partner.api.agent.factory.capability.annotation.Capability;
import work.slhaf.partner.api.factory.capability.annotation.InjectCapability; import work.slhaf.partner.api.agent.factory.capability.annotation.InjectCapability;
import work.slhaf.partner.api.factory.capability.annotation.ToCoordinated; import work.slhaf.partner.api.agent.factory.capability.annotation.ToCoordinated;
import work.slhaf.partner.api.factory.capability.exception.ProxySetFailedExceptionCapability; import work.slhaf.partner.api.agent.factory.capability.exception.ProxySetFailedExceptionCapability;
import work.slhaf.partner.api.factory.context.AgentRegisterContext; import work.slhaf.partner.api.agent.factory.context.AgentRegisterContext;
import work.slhaf.partner.api.factory.context.CapabilityFactoryContext; import work.slhaf.partner.api.agent.factory.context.CapabilityFactoryContext;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Proxy; import java.lang.reflect.Proxy;
@@ -15,7 +15,7 @@ import java.util.HashMap;
import java.util.Set; import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import static work.slhaf.partner.api.common.util.AgentUtil.methodSignature; import static work.slhaf.partner.api.agent.util.AgentUtil.methodSignature;
/** /**
* 负责执行<code>Capability</code>的注入逻辑 * 负责执行<code>Capability</code>的注入逻辑

View File

@@ -1,13 +1,13 @@
package work.slhaf.partner.api.factory.capability; package work.slhaf.partner.api.agent.factory.capability;
import org.reflections.Reflections; import org.reflections.Reflections;
import work.slhaf.partner.api.factory.AgentBaseFactory; import work.slhaf.partner.api.agent.factory.AgentBaseFactory;
import work.slhaf.partner.api.factory.capability.annotation.*; import work.slhaf.partner.api.agent.factory.capability.annotation.*;
import work.slhaf.partner.api.factory.capability.exception.CapabilityFactoryExecuteFailedException; import work.slhaf.partner.api.agent.factory.capability.exception.CapabilityFactoryExecuteFailedException;
import work.slhaf.partner.api.factory.capability.exception.CoreInstancesCreateFailedExceptionCapability; import work.slhaf.partner.api.agent.factory.capability.exception.CoreInstancesCreateFailedExceptionCapability;
import work.slhaf.partner.api.factory.capability.exception.DuplicateMethodException; import work.slhaf.partner.api.agent.factory.capability.exception.DuplicateMethodException;
import work.slhaf.partner.api.factory.context.AgentRegisterContext; import work.slhaf.partner.api.agent.factory.context.AgentRegisterContext;
import work.slhaf.partner.api.factory.context.CapabilityFactoryContext; import work.slhaf.partner.api.agent.factory.context.CapabilityFactoryContext;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
@@ -18,7 +18,7 @@ import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import static cn.hutool.core.util.ClassUtil.isNormalClass; import static cn.hutool.core.util.ClassUtil.isNormalClass;
import static work.slhaf.partner.api.common.util.AgentUtil.methodSignature; import static work.slhaf.partner.api.agent.util.AgentUtil.methodSignature;
/** /**

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.annotation; package work.slhaf.partner.api.agent.factory.capability.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.annotation; package work.slhaf.partner.api.agent.factory.capability.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.annotation; package work.slhaf.partner.api.agent.factory.capability.annotation;
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.annotation; package work.slhaf.partner.api.agent.factory.capability.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.annotation; package work.slhaf.partner.api.agent.factory.capability.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.annotation; package work.slhaf.partner.api.agent.factory.capability.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.annotation; package work.slhaf.partner.api.agent.factory.capability.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.annotation; package work.slhaf.partner.api.agent.factory.capability.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.exception; package work.slhaf.partner.api.agent.factory.capability.exception;
public class CapabilityCheckFailedException extends RuntimeException { public class CapabilityCheckFailedException extends RuntimeException {
public CapabilityCheckFailedException(String message) { public CapabilityCheckFailedException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.exception; package work.slhaf.partner.api.agent.factory.capability.exception;
public class CapabilityFactoryExecuteFailedException extends RuntimeException { public class CapabilityFactoryExecuteFailedException extends RuntimeException {
public CapabilityFactoryExecuteFailedException(String message) { public CapabilityFactoryExecuteFailedException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.exception; package work.slhaf.partner.api.agent.factory.capability.exception;
public class CoreInstancesCreateFailedExceptionCapability extends CapabilityFactoryExecuteFailedException { public class CoreInstancesCreateFailedExceptionCapability extends CapabilityFactoryExecuteFailedException {
public CoreInstancesCreateFailedExceptionCapability(String message) { public CoreInstancesCreateFailedExceptionCapability(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.exception; package work.slhaf.partner.api.agent.factory.capability.exception;
public class DuplicateCapabilityException extends CapabilityCheckFailedException { public class DuplicateCapabilityException extends CapabilityCheckFailedException {
public DuplicateCapabilityException(String message) { public DuplicateCapabilityException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.exception; package work.slhaf.partner.api.agent.factory.capability.exception;
public class DuplicateMethodException extends CapabilityCheckFailedException{ public class DuplicateMethodException extends CapabilityCheckFailedException{
public DuplicateMethodException(String message) { public DuplicateMethodException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.exception; package work.slhaf.partner.api.agent.factory.capability.exception;
public class EmptyCapabilityHolderException extends CapabilityCheckFailedException{ public class EmptyCapabilityHolderException extends CapabilityCheckFailedException{
public EmptyCapabilityHolderException(String message) { public EmptyCapabilityHolderException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.exception; package work.slhaf.partner.api.agent.factory.capability.exception;
public class ProxySetFailedExceptionCapability extends CapabilityFactoryExecuteFailedException { public class ProxySetFailedExceptionCapability extends CapabilityFactoryExecuteFailedException {
public ProxySetFailedExceptionCapability(String message) { public ProxySetFailedExceptionCapability(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.exception; package work.slhaf.partner.api.agent.factory.capability.exception;
public class UnMatchedCapabilityException extends CapabilityCheckFailedException{ public class UnMatchedCapabilityException extends CapabilityCheckFailedException{
public UnMatchedCapabilityException(String message) { public UnMatchedCapabilityException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.exception; package work.slhaf.partner.api.agent.factory.capability.exception;
public class UnMatchedCapabilityMethodException extends CapabilityCheckFailedException { public class UnMatchedCapabilityMethodException extends CapabilityCheckFailedException {
public UnMatchedCapabilityMethodException(String message) { public UnMatchedCapabilityMethodException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.capability.exception; package work.slhaf.partner.api.agent.factory.capability.exception;
public class UnMatchedCoordinatedMethodException extends CapabilityCheckFailedException { public class UnMatchedCoordinatedMethodException extends CapabilityCheckFailedException {
public UnMatchedCoordinatedMethodException(String message) { public UnMatchedCoordinatedMethodException(String message) {

View File

@@ -1,11 +1,11 @@
package work.slhaf.partner.api.factory.config; package work.slhaf.partner.api.agent.factory.config;
import lombok.Setter; import lombok.Setter;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.agent.factory.AgentBaseFactory;
import work.slhaf.partner.api.factory.AgentBaseFactory; import work.slhaf.partner.api.agent.factory.config.pojo.ModelConfig;
import work.slhaf.partner.api.factory.config.pojo.ModelConfig; import work.slhaf.partner.api.agent.factory.context.AgentRegisterContext;
import work.slhaf.partner.api.factory.context.AgentRegisterContext; import work.slhaf.partner.api.agent.factory.context.ConfigFactoryContext;
import work.slhaf.partner.api.factory.context.ConfigFactoryContext; import work.slhaf.partner.api.chat.pojo.Message;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;

View File

@@ -1,14 +1,14 @@
package work.slhaf.partner.api.factory.config; package work.slhaf.partner.api.agent.factory.config;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.agent.factory.config.exception.ModelConfigDirNotExistException;
import work.slhaf.partner.api.factory.config.exception.ModelConfigDirNotExistException; import work.slhaf.partner.api.agent.factory.config.exception.ModelConfigNotExistException;
import work.slhaf.partner.api.factory.config.exception.ModelConfigNotExistException; import work.slhaf.partner.api.agent.factory.config.exception.ModelPromptDirNotExistException;
import work.slhaf.partner.api.factory.config.exception.ModelPromptDirNotExistException; import work.slhaf.partner.api.agent.factory.config.exception.ModelPromptNotExistException;
import work.slhaf.partner.api.factory.config.exception.ModelPromptNotExistException; import work.slhaf.partner.api.agent.factory.config.pojo.ModelConfig;
import work.slhaf.partner.api.factory.config.pojo.ModelConfig; import work.slhaf.partner.api.agent.factory.config.pojo.PrimaryModelConfig;
import work.slhaf.partner.api.factory.config.pojo.PrimaryModelConfig; import work.slhaf.partner.api.agent.factory.config.pojo.PrimaryModelPrompt;
import work.slhaf.partner.api.factory.config.pojo.PrimaryModelPrompt; import work.slhaf.partner.api.chat.pojo.Message;
import java.io.File; import java.io.File;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;

View File

@@ -1,11 +1,11 @@
package work.slhaf.partner.api.factory.config; package work.slhaf.partner.api.agent.factory.config;
import lombok.Getter; import lombok.Getter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.agent.factory.config.exception.ModelConfigNotExistException;
import work.slhaf.partner.api.factory.config.exception.ModelConfigNotExistException; import work.slhaf.partner.api.agent.factory.config.exception.ModelPromptNotExistException;
import work.slhaf.partner.api.factory.config.exception.ModelPromptNotExistException; import work.slhaf.partner.api.agent.factory.config.pojo.ModelConfig;
import work.slhaf.partner.api.factory.config.pojo.ModelConfig; import work.slhaf.partner.api.chat.pojo.Message;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.config.exception; package work.slhaf.partner.api.agent.factory.config.exception;
public class ModelConfigDirNotExistException extends ModelConfigFactoryFailedException{ public class ModelConfigDirNotExistException extends ModelConfigFactoryFailedException{
public ModelConfigDirNotExistException(String message, Throwable cause) { public ModelConfigDirNotExistException(String message, Throwable cause) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.config.exception; package work.slhaf.partner.api.agent.factory.config.exception;
public class ModelConfigFactoryFailedException extends RuntimeException { public class ModelConfigFactoryFailedException extends RuntimeException {
public ModelConfigFactoryFailedException(String message, Throwable cause) { public ModelConfigFactoryFailedException(String message, Throwable cause) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.config.exception; package work.slhaf.partner.api.agent.factory.config.exception;
public class ModelConfigNotExistException extends ModelConfigFactoryFailedException { public class ModelConfigNotExistException extends ModelConfigFactoryFailedException {
public ModelConfigNotExistException(String message, Throwable e) { public ModelConfigNotExistException(String message, Throwable e) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.config.exception; package work.slhaf.partner.api.agent.factory.config.exception;
public class ModelPromptDirNotExistException extends ModelConfigFactoryFailedException{ public class ModelPromptDirNotExistException extends ModelConfigFactoryFailedException{
public ModelPromptDirNotExistException(String message, Throwable cause) { public ModelPromptDirNotExistException(String message, Throwable cause) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.config.exception; package work.slhaf.partner.api.agent.factory.config.exception;
public class ModelPromptNotExistException extends ModelConfigFactoryFailedException{ public class ModelPromptNotExistException extends ModelConfigFactoryFailedException{
public ModelPromptNotExistException(String message) { public ModelPromptNotExistException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.config.pojo; package work.slhaf.partner.api.agent.factory.config.pojo;
import lombok.Data; import lombok.Data;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.config.pojo; package work.slhaf.partner.api.agent.factory.config.pojo;
import lombok.Data; import lombok.Data;

View File

@@ -1,7 +1,7 @@
package work.slhaf.partner.api.factory.config.pojo; package work.slhaf.partner.api.agent.factory.config.pojo;
import lombok.Data; import lombok.Data;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.chat.pojo.Message;
import java.util.List; import java.util.List;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.context; package work.slhaf.partner.api.agent.factory.context;
import lombok.Data; import lombok.Data;
import org.reflections.Reflections; import org.reflections.Reflections;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.context; package work.slhaf.partner.api.agent.factory.context;
import lombok.Data; import lombok.Data;

View File

@@ -1,8 +1,8 @@
package work.slhaf.partner.api.factory.context; package work.slhaf.partner.api.agent.factory.context;
import lombok.Data; import lombok.Data;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.agent.factory.config.pojo.ModelConfig;
import work.slhaf.partner.api.factory.config.pojo.ModelConfig; import work.slhaf.partner.api.chat.pojo.Message;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;

View File

@@ -0,0 +1,12 @@
package work.slhaf.partner.api.agent.factory.context;
import lombok.Data;
import work.slhaf.partner.api.agent.factory.module.pojo.MetaModule;
import java.util.ArrayList;
import java.util.List;
@Data
public class ModuleFactoryContext {
private List<MetaModule> moduleList = new ArrayList<>();
}

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.exception; package work.slhaf.partner.api.agent.factory.exception;
public class AgentRegisterFactoryFailedException extends RuntimeException { public class AgentRegisterFactoryFailedException extends RuntimeException {
public AgentRegisterFactoryFailedException(String message, Throwable cause) { public AgentRegisterFactoryFailedException(String message, Throwable cause) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.exception; package work.slhaf.partner.api.agent.factory.exception;
public class ExternalModuleLoadFailedException extends AgentRegisterFactoryFailedException{ public class ExternalModuleLoadFailedException extends AgentRegisterFactoryFailedException{
public ExternalModuleLoadFailedException(String message, Throwable cause) { public ExternalModuleLoadFailedException(String message, Throwable cause) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.exception; package work.slhaf.partner.api.agent.factory.exception;
public class ExternalModulePathNotExistException extends AgentRegisterFactoryFailedException { public class ExternalModulePathNotExistException extends AgentRegisterFactoryFailedException {
public ExternalModulePathNotExistException(String message) { public ExternalModulePathNotExistException(String message) {

View File

@@ -1,18 +1,18 @@
package work.slhaf.partner.api.factory.module; package work.slhaf.partner.api.agent.factory.module;
import cn.hutool.core.util.ClassUtil; import cn.hutool.core.util.ClassUtil;
import org.reflections.Reflections; import org.reflections.Reflections;
import work.slhaf.partner.api.factory.AgentBaseFactory; import work.slhaf.partner.api.agent.factory.AgentBaseFactory;
import work.slhaf.partner.api.factory.config.ModelConfigManager; import work.slhaf.partner.api.agent.factory.config.ModelConfigManager;
import work.slhaf.partner.api.factory.context.AgentRegisterContext; import work.slhaf.partner.api.agent.factory.context.AgentRegisterContext;
import work.slhaf.partner.api.factory.module.annotation.AfterExecute; import work.slhaf.partner.api.agent.factory.module.annotation.AfterExecute;
import work.slhaf.partner.api.factory.module.annotation.AgentModule; import work.slhaf.partner.api.agent.factory.module.annotation.AgentModule;
import work.slhaf.partner.api.factory.module.annotation.BeforeExecute; import work.slhaf.partner.api.agent.factory.module.annotation.BeforeExecute;
import work.slhaf.partner.api.factory.module.annotation.Init; import work.slhaf.partner.api.agent.factory.module.annotation.Init;
import work.slhaf.partner.api.factory.module.exception.ModuleCheckException; import work.slhaf.partner.api.agent.factory.module.exception.ModuleCheckException;
import work.slhaf.partner.api.flow.abstracts.ActivateModel; import work.slhaf.partner.api.agent.flow.abstracts.ActivateModel;
import work.slhaf.partner.api.flow.abstracts.AgentInteractionModule; import work.slhaf.partner.api.agent.flow.abstracts.AgentInteractionModule;
import work.slhaf.partner.api.flow.abstracts.AgentInteractionSubModule; import work.slhaf.partner.api.agent.flow.abstracts.AgentInteractionSubModule;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.HashSet; import java.util.HashSet;

View File

@@ -0,0 +1,69 @@
package work.slhaf.partner.api.agent.factory.module;
import work.slhaf.partner.api.agent.factory.AgentBaseFactory;
import work.slhaf.partner.api.agent.factory.context.AgentRegisterContext;
import work.slhaf.partner.api.agent.factory.context.ModuleFactoryContext;
import work.slhaf.partner.api.agent.factory.module.annotation.Init;
import work.slhaf.partner.api.agent.factory.module.exception.ModuleInitHookExecuteFailedException;
import work.slhaf.partner.api.agent.factory.module.pojo.MetaMethod;
import work.slhaf.partner.api.agent.factory.module.pojo.MetaModule;
import work.slhaf.partner.api.agent.flow.abstracts.AgentInteractionModule;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import static work.slhaf.partner.api.agent.util.AgentUtil.collectExtendedClasses;
import static work.slhaf.partner.api.agent.util.AgentUtil.methodSignature;
/**
* 负责执行前hook逻辑
*/
public class ModuleInitHookExecuteFactory extends AgentBaseFactory {
private List<MetaModule> moduleList;
@Override
protected void setVariables(AgentRegisterContext context) {
ModuleFactoryContext factoryContext = context.getModuleFactoryContext();
moduleList = factoryContext.getModuleList();
}
@Override
protected void run() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
//遍历模块列表,并向上查找@Init注解
for (MetaModule metaModule : moduleList) {
List<MetaMethod> initHookMethods = collectInitHookMethods(metaModule.getClazz());
proceedInitMethods(metaModule, initHookMethods);
}
}
private void proceedInitMethods(MetaModule metaModule, List<MetaMethod> initHookMethods) {
for (MetaMethod metaMethod : initHookMethods) {
try {
metaMethod.getMethod().invoke(metaModule.getInstance());
} catch (IllegalAccessException | InvocationTargetException e) {
throw new ModuleInitHookExecuteFailedException("模块的init hook方法执行失败! 模块: " + metaModule.getName() + " 方法签名: " + methodSignature(metaMethod.getMethod()), e);
}
}
}
private List<MetaMethod> collectInitHookMethods(Class<?> clazz) {
Set<Class<?>> classes = collectExtendedClasses(clazz, AgentInteractionModule.class);
return classes.stream()
.map(Class::getDeclaredMethods)
.flatMap(Arrays::stream)
.filter(method -> method.isAnnotationPresent(Init.class))
.map(method -> {
MetaMethod metaMethod = new MetaMethod();
metaMethod.setMethod(method);
metaMethod.setOrder(method.getAnnotation(Init.class).order());
return metaMethod;
})
.sorted(Comparator.comparing(MetaMethod::getOrder))
.collect(Collectors.toList());
}
}

View File

@@ -1,19 +1,19 @@
package work.slhaf.partner.api.factory.module; package work.slhaf.partner.api.agent.factory.module;
import net.bytebuddy.ByteBuddy; import net.bytebuddy.ByteBuddy;
import net.bytebuddy.implementation.MethodDelegation; import net.bytebuddy.implementation.MethodDelegation;
import net.bytebuddy.implementation.bind.annotation.*; import net.bytebuddy.implementation.bind.annotation.*;
import net.bytebuddy.matcher.ElementMatchers; import net.bytebuddy.matcher.ElementMatchers;
import work.slhaf.partner.api.factory.AgentBaseFactory; import work.slhaf.partner.api.agent.factory.AgentBaseFactory;
import work.slhaf.partner.api.factory.context.AgentRegisterContext; import work.slhaf.partner.api.agent.factory.context.AgentRegisterContext;
import work.slhaf.partner.api.factory.context.ModuleFactoryContext; import work.slhaf.partner.api.agent.factory.context.ModuleFactoryContext;
import work.slhaf.partner.api.factory.module.annotation.AfterExecute; import work.slhaf.partner.api.agent.factory.module.annotation.AfterExecute;
import work.slhaf.partner.api.factory.module.annotation.BeforeExecute; import work.slhaf.partner.api.agent.factory.module.annotation.BeforeExecute;
import work.slhaf.partner.api.factory.module.exception.ModuleInstanceGenerateFailedException; import work.slhaf.partner.api.agent.factory.module.exception.ModuleInstanceGenerateFailedException;
import work.slhaf.partner.api.factory.module.exception.ModuleProxyGenerateFailedException; import work.slhaf.partner.api.agent.factory.module.exception.ModuleProxyGenerateFailedException;
import work.slhaf.partner.api.factory.module.pojo.MetaMethod; import work.slhaf.partner.api.agent.factory.module.pojo.MetaMethod;
import work.slhaf.partner.api.factory.module.pojo.MetaModule; import work.slhaf.partner.api.agent.factory.module.pojo.MetaModule;
import work.slhaf.partner.api.flow.abstracts.AgentInteractionModule; import work.slhaf.partner.api.agent.flow.abstracts.AgentInteractionModule;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@@ -21,6 +21,8 @@ import java.util.*;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static work.slhaf.partner.api.agent.util.AgentUtil.collectExtendedClasses;
/** /**
* 通过扫描注解<code>@BeforeExecute</code>获取到各个模块的后hook逻辑并通过动态代理添加到执行逻辑之后 * 通过扫描注解<code>@BeforeExecute</code>获取到各个模块的后hook逻辑并通过动态代理添加到执行逻辑之后
*/ */
@@ -45,7 +47,7 @@ public class ModuleProxyFactory extends AgentBaseFactory {
Class<?> clazz = module.getClazz(); Class<?> clazz = module.getClazz();
try { try {
MethodsListRecord record = collectHookMethods(clazz); MethodsListRecord record = collectHookMethods(clazz);
//生成实例 //生成实例
generateProxiedInstances(record, module); generateProxiedInstances(record, module);
} catch (Exception e) { } catch (Exception e) {
throw new ModuleProxyGenerateFailedException("创建代理对象失败: " + clazz.getSimpleName(), e); throw new ModuleProxyGenerateFailedException("创建代理对象失败: " + clazz.getSimpleName(), e);
@@ -75,7 +77,7 @@ public class ModuleProxyFactory extends AgentBaseFactory {
//获取该类本身的hook逻辑 //获取该类本身的hook逻辑
collectHookMethods(post, pre, clazz); collectHookMethods(post, pre, clazz);
//获取它所继承实现的抽象类或接口, 以AgentInteractionModuleActiveModel为终点 //获取它所继承实现的抽象类或接口, 以AgentInteractionModuleActiveModel为终点
Set<Class<?>> classes = collectSuperClasses(clazz); Set<Class<?>> classes = collectExtendedClasses(clazz, AgentInteractionModule.class);
//获取这些类中的hook逻辑 //获取这些类中的hook逻辑
collectHookMethods(post, pre, classes); collectHookMethods(post, pre, classes);
return new MethodsListRecord(post, pre); return new MethodsListRecord(post, pre);
@@ -89,7 +91,7 @@ public class ModuleProxyFactory extends AgentBaseFactory {
} }
private void collectPostHookMethods(List<MetaMethod> post, Class<?> type) { private void collectPostHookMethods(List<MetaMethod> post, Class<?> type) {
Set<MetaMethod> collectedPostHookMethod = Arrays.stream(type.getMethods()) Set<MetaMethod> collectedPostHookMethod = Arrays.stream(type.getDeclaredMethods())
.filter(method -> method.isAnnotationPresent(AfterExecute.class)) .filter(method -> method.isAnnotationPresent(AfterExecute.class))
.map(method -> { .map(method -> {
MetaMethod metaMethod = new MetaMethod(); MetaMethod metaMethod = new MetaMethod();
@@ -102,7 +104,7 @@ public class ModuleProxyFactory extends AgentBaseFactory {
} }
private void collectPreHookMethods(List<MetaMethod> pre, Class<?> type) { private void collectPreHookMethods(List<MetaMethod> pre, Class<?> type) {
Set<MetaMethod> collectedPreHookMethods = Arrays.stream(type.getMethods()) Set<MetaMethod> collectedPreHookMethods = Arrays.stream(type.getDeclaredMethods())
.filter(method -> method.isAnnotationPresent(BeforeExecute.class)) .filter(method -> method.isAnnotationPresent(BeforeExecute.class))
.map(method -> { .map(method -> {
MetaMethod metaMethod = new MetaMethod(); MetaMethod metaMethod = new MetaMethod();
@@ -114,29 +116,6 @@ public class ModuleProxyFactory extends AgentBaseFactory {
pre.addAll(collectedPreHookMethods); pre.addAll(collectedPreHookMethods);
} }
private Set<Class<?>> collectSuperClasses(Class<?> clazz) {
Set<Class<?>> classes = new HashSet<>();
collectSuperClasses(classes, clazz);
return classes;
}
private void collectSuperClasses(Set<Class<?>> classes, Class<?> clazz) {
Class<?> superclass = clazz.getSuperclass();
if (superclass == null || superclass == AgentInteractionModule.class) {
return;
}
collectSuperClasses(classes, superclass);
classes.add(superclass);
collectInterfaces(clazz, classes);
}
private void collectInterfaces(Class<?> clazz, Set<Class<?>> classes) {
for (Class<?> type : clazz.getInterfaces()) {
if (classes.add(type)) {
collectInterfaces(type, classes);
}
}
}
private void collectHookMethods(List<MetaMethod> post, List<MetaMethod> pre, Class<?> clazz) { private void collectHookMethods(List<MetaMethod> post, List<MetaMethod> pre, Class<?> clazz) {
Method[] methods = clazz.getMethods(); Method[] methods = clazz.getMethods();
@@ -167,16 +146,7 @@ public class ModuleProxyFactory extends AgentBaseFactory {
} }
} }
private static class ModuleProxyInterceptor { private record ModuleProxyInterceptor(List<MetaMethod> postHookMethods, List<MetaMethod> preHookMethods) {
private final List<MetaMethod> postHookMethods;
private final List<MetaMethod> preHookMethods;
private ModuleProxyInterceptor(List<MetaMethod> postHookMethods, List<MetaMethod> preHookMethods) {
this.postHookMethods = postHookMethods;
this.preHookMethods = preHookMethods;
}
@RuntimeType @RuntimeType
public Object intercept(@Origin Method method, @AllArguments Object[] allArguments, @SuperCall Callable<?> zuper, @This Object proxy) throws Exception { public Object intercept(@Origin Method method, @AllArguments Object[] allArguments, @SuperCall Callable<?> zuper, @This Object proxy) throws Exception {
for (MetaMethod metaMethod : preHookMethods) { for (MetaMethod metaMethod : preHookMethods) {

View File

@@ -0,0 +1,48 @@
package work.slhaf.partner.api.agent.factory.module;
import org.reflections.Reflections;
import work.slhaf.partner.api.agent.factory.AgentBaseFactory;
import work.slhaf.partner.api.agent.factory.context.AgentRegisterContext;
import work.slhaf.partner.api.agent.factory.context.ModuleFactoryContext;
import work.slhaf.partner.api.agent.factory.module.annotation.AgentModule;
import work.slhaf.partner.api.agent.factory.module.pojo.MetaModule;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
/**
* 负责扫描<code>@Module</code>注解获取模块实例
*/
public class ModuleRegisterFactory extends AgentBaseFactory {
private Reflections reflections;
private List<MetaModule> moduleList;
@Override
protected void setVariables(AgentRegisterContext context) {
ModuleFactoryContext factoryContext = context.getModuleFactoryContext();
reflections = context.getReflections();
moduleList = factoryContext.getModuleList();
}
@Override
protected void run() {
setModuleList();
}
private void setModuleList() {
//反射扫描获取@AgentModule所在类, 该部分为Agent流程执行模块
Set<Class<?>> modules = reflections.getTypesAnnotatedWith(AgentModule.class);
for (Class<?> module : modules) {
AgentModule agentModule = module.getAnnotation(AgentModule.class);
MetaModule metaModule = new MetaModule();
metaModule.setName(agentModule.name());
metaModule.setOrder(agentModule.order());
metaModule.setClazz(module);
moduleList.add(metaModule);
}
moduleList.sort(Comparator.comparing(MetaModule::getOrder));
}
}

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.module.annotation; package work.slhaf.partner.api.agent.factory.module.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.module.annotation; package work.slhaf.partner.api.agent.factory.module.annotation;
import java.lang.annotation.*; import java.lang.annotation.*;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.module.annotation; package work.slhaf.partner.api.agent.factory.module.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.module.annotation; package work.slhaf.partner.api.agent.factory.module.annotation;
@AgentModule(name = "core",order = 5) @AgentModule(name = "core",order = 5)
public @interface CoreModule { public @interface CoreModule {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.module.annotation; package work.slhaf.partner.api.agent.factory.module.annotation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.module.exception; package work.slhaf.partner.api.agent.factory.module.exception;
public class ModuleCheckException extends ModuleFactoryFailedException{ public class ModuleCheckException extends ModuleFactoryFailedException{
public ModuleCheckException(String message) { public ModuleCheckException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.module.exception; package work.slhaf.partner.api.agent.factory.module.exception;
public class ModuleFactoryFailedException extends RuntimeException { public class ModuleFactoryFailedException extends RuntimeException {
public ModuleFactoryFailedException(String message) { public ModuleFactoryFailedException(String message) {

View File

@@ -0,0 +1,11 @@
package work.slhaf.partner.api.agent.factory.module.exception;
public class ModuleInitHookExecuteFailedException extends ModuleFactoryFailedException{
public ModuleInitHookExecuteFailedException(String message) {
super(message);
}
public ModuleInitHookExecuteFailedException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.module.exception; package work.slhaf.partner.api.agent.factory.module.exception;
public class ModuleInstanceGenerateFailedException extends ModuleFactoryFailedException{ public class ModuleInstanceGenerateFailedException extends ModuleFactoryFailedException{
public ModuleInstanceGenerateFailedException(String message) { public ModuleInstanceGenerateFailedException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.module.exception; package work.slhaf.partner.api.agent.factory.module.exception;
public class ModuleProxyGenerateFailedException extends ModuleFactoryFailedException{ public class ModuleProxyGenerateFailedException extends ModuleFactoryFailedException{
public ModuleProxyGenerateFailedException(String message) { public ModuleProxyGenerateFailedException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.module.pojo; package work.slhaf.partner.api.agent.factory.module.pojo;
import lombok.Data; import lombok.Data;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.factory.module.pojo; package work.slhaf.partner.api.agent.factory.module.pojo;
import lombok.Data; import lombok.Data;

View File

@@ -1,7 +1,7 @@
package work.slhaf.partner.api.flow; package work.slhaf.partner.api.agent.flow;
import work.slhaf.partner.api.factory.module.pojo.MetaModule; import work.slhaf.partner.api.agent.factory.module.pojo.MetaModule;
import work.slhaf.partner.api.flow.entity.InteractionFlowContext; import work.slhaf.partner.api.agent.flow.entity.InteractionFlowContext;
import java.util.List; import java.util.List;

View File

@@ -1,20 +1,22 @@
package work.slhaf.partner.api.flow.abstracts; package work.slhaf.partner.api.agent.flow.abstracts;
import work.slhaf.partner.api.common.chat.ChatClient; import work.slhaf.partner.api.agent.factory.config.ModelConfigManager;
import work.slhaf.partner.api.common.chat.Model; import work.slhaf.partner.api.agent.factory.config.pojo.ModelConfig;
import work.slhaf.partner.api.common.chat.constant.ChatConstant; import work.slhaf.partner.api.agent.factory.module.annotation.Init;
import work.slhaf.partner.api.common.chat.pojo.ChatResponse; import work.slhaf.partner.api.agent.flow.entity.Model;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.chat.ChatClient;
import work.slhaf.partner.api.factory.config.ModelConfigManager; import work.slhaf.partner.api.chat.constant.ChatConstant;
import work.slhaf.partner.api.factory.config.pojo.ModelConfig; import work.slhaf.partner.api.chat.pojo.ChatResponse;
import work.slhaf.partner.api.factory.module.annotation.BeforeExecute; import work.slhaf.partner.api.chat.pojo.Message;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public interface ActivateModel { public interface ActivateModel {
@BeforeExecute ModelConfigManager modelConfigManager = ModelConfigManager.INSTANCE;
@Init
default void modelSettings() { default void modelSettings() {
Model model = new Model(); Model model = new Model();
ModelConfig modelConfig = ModelConfigManager.INSTANCE.loadModelConfig(modelKey()); ModelConfig modelConfig = ModelConfigManager.INSTANCE.loadModelConfig(modelKey());
@@ -23,13 +25,14 @@ public interface ActivateModel {
} }
private List<Message> loadSpecificPrompt(String modelKey) { private List<Message> loadSpecificPrompt(String modelKey) {
return modelConfigManager.loadModelPrompt(modelKey);
return null;
} }
private List<Message> loadSpecificPromptAndBasicPrompt(String modelKey) { private List<Message> loadSpecificPromptAndBasicPrompt(String modelKey) {
List<Message> messages = new ArrayList<>();
return null; messages.addAll(modelConfigManager.loadModelPrompt("basic"));
messages.addAll(modelConfigManager.loadModelPrompt(modelKey));
return messages;
} }
default ChatResponse chat() { default ChatResponse chat() {

View File

@@ -1,6 +1,6 @@
package work.slhaf.partner.api.flow.abstracts; package work.slhaf.partner.api.agent.flow.abstracts;
import work.slhaf.partner.api.flow.entity.InteractionFlowContext; import work.slhaf.partner.api.agent.flow.entity.InteractionFlowContext;
/** /**
* 流程执行模块基类 * 流程执行模块基类

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.flow.abstracts; package work.slhaf.partner.api.agent.flow.abstracts;
/** /**

View File

@@ -0,0 +1,18 @@
package work.slhaf.partner.api.agent.flow.abstracts;
import lombok.Getter;
import lombok.Setter;
import work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityHolder;
import work.slhaf.partner.api.agent.flow.entity.Model;
/**
* 模块基类
*/
@CapabilityHolder
public abstract class Module {
@Getter
@Setter
protected Model model = new Model();
}

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.flow.entity; package work.slhaf.partner.api.agent.flow.entity;
import lombok.Data; import lombok.Data;

View File

@@ -1,7 +1,8 @@
package work.slhaf.partner.api.common.chat; package work.slhaf.partner.api.agent.flow.entity;
import lombok.Data; import lombok.Data;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.chat.ChatClient;
import work.slhaf.partner.api.chat.pojo.Message;
import java.util.List; import java.util.List;

View File

@@ -0,0 +1,45 @@
package work.slhaf.partner.api.agent.util;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;
public final class AgentUtil {
public static String methodSignature(Method method) {
StringBuilder sb = new StringBuilder();
sb.append("(");
sb.append(method.getReturnType().getName()).append(" ");
sb.append(method.getName()).append("(");
Class<?>[] paramTypes = method.getParameterTypes();
for (int i = 0; i < paramTypes.length; i++) {
sb.append(paramTypes[i].getName());
if (i < paramTypes.length - 1) sb.append(",");
}
sb.append(")").append(")");
return sb.toString();
}
public static Set<Class<?>> collectExtendedClasses(Class<?> clazz, Class<?> targetClass) {
Set<Class<?>> classes = new HashSet<>();
collectExtendedClasses(classes, clazz, targetClass);
return classes;
}
private static void collectExtendedClasses(Set<Class<?>> classes, Class<?> clazz, Class<?> target) {
Class<?> superclass = clazz.getSuperclass();
if (superclass == null || superclass == target) {
return;
}
collectExtendedClasses(classes, superclass, target);
classes.add(superclass);
collectInterfaces(clazz, classes);
}
private static void collectInterfaces(Class<?> clazz, Set<Class<?>> classes) {
for (Class<?> type : clazz.getInterfaces()) {
if (classes.add(type)) {
collectInterfaces(type, classes);
}
}
}}

View File

@@ -1,15 +1,15 @@
package work.slhaf.partner.api.common.chat; package work.slhaf.partner.api.chat;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import work.slhaf.partner.api.common.chat.constant.ChatConstant; import work.slhaf.partner.api.chat.constant.ChatConstant;
import work.slhaf.partner.api.common.chat.pojo.ChatBody; import work.slhaf.partner.api.chat.pojo.ChatBody;
import work.slhaf.partner.api.common.chat.pojo.ChatResponse; import work.slhaf.partner.api.chat.pojo.ChatResponse;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.chat.pojo.Message;
import work.slhaf.partner.api.common.chat.pojo.PrimaryChatResponse; import work.slhaf.partner.api.chat.pojo.PrimaryChatResponse;
import java.util.List; import java.util.List;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.common.chat.constant; package work.slhaf.partner.api.chat.constant;
public class ChatConstant { public class ChatConstant {

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.common.chat.pojo; package work.slhaf.partner.api.chat.pojo;
import lombok.*; import lombok.*;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.common.chat.pojo; package work.slhaf.partner.api.chat.pojo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.common.chat.pojo; package work.slhaf.partner.api.chat.pojo;
import lombok.*; import lombok.*;
import work.slhaf.partner.api.common.entity.PersistableObject; import work.slhaf.partner.api.common.entity.PersistableObject;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.common.chat.pojo; package work.slhaf.partner.api.chat.pojo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;

View File

@@ -1,4 +1,4 @@
package work.slhaf.partner.api.common.chat.pojo; package work.slhaf.partner.api.chat.pojo;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;

View File

@@ -1,19 +0,0 @@
package work.slhaf.partner.api.common.util;
import java.lang.reflect.Method;
public final class AgentUtil {
public static String methodSignature(Method method) {
StringBuilder sb = new StringBuilder();
sb.append("(");
sb.append(method.getReturnType().getName()).append(" ");
sb.append(method.getName()).append("(");
Class<?>[] paramTypes = method.getParameterTypes();
for (int i = 0; i < paramTypes.length; i++) {
sb.append(paramTypes[i].getName());
if (i < paramTypes.length - 1) sb.append(",");
}
sb.append(")").append(")");
return sb.toString();
}
}

View File

@@ -1,16 +0,0 @@
package work.slhaf.partner.api.factory.context;
import lombok.Data;
import work.slhaf.partner.api.factory.module.pojo.MetaMethod;
import work.slhaf.partner.api.factory.module.pojo.MetaModule;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
@Data
public class ModuleFactoryContext {
private List<MetaModule> moduleList = new ArrayList<>();
private HashMap<Class<?>,Set<MetaMethod>> initHookMethods = new HashMap<>();
}

View File

@@ -1,21 +0,0 @@
package work.slhaf.partner.api.factory.module;
import work.slhaf.partner.api.factory.AgentBaseFactory;
import work.slhaf.partner.api.factory.context.AgentRegisterContext;
import java.lang.reflect.InvocationTargetException;
/**
* 负责执行前hook逻辑
*/
public class ModulePreHookExecuteFactory extends AgentBaseFactory {
@Override
protected void setVariables(AgentRegisterContext context) {
}
@Override
protected void run() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
}
}

View File

@@ -1,75 +0,0 @@
package work.slhaf.partner.api.factory.module;
import org.reflections.Reflections;
import work.slhaf.partner.api.factory.AgentBaseFactory;
import work.slhaf.partner.api.factory.context.AgentRegisterContext;
import work.slhaf.partner.api.factory.context.ModuleFactoryContext;
import work.slhaf.partner.api.factory.module.annotation.AgentModule;
import work.slhaf.partner.api.factory.module.annotation.Init;
import work.slhaf.partner.api.factory.module.pojo.MetaMethod;
import work.slhaf.partner.api.factory.module.pojo.MetaModule;
import java.lang.reflect.Method;
import java.util.*;
/**
* 负责扫描<code>@Module</code>注解获取模块实例
*/
public class ModuleRegisterFactory extends AgentBaseFactory {
private Reflections reflections;
private List<MetaModule> moduleList;
private HashMap<Class<?>, Set<MetaMethod>> initHookMethods;
@Override
protected void setVariables(AgentRegisterContext context) {
ModuleFactoryContext factoryContext = context.getModuleFactoryContext();
reflections = context.getReflections();
moduleList = factoryContext.getModuleList();
initHookMethods = factoryContext.getInitHookMethods();
}
@Override
protected void run() {
setModuleList();
setInitMethods();
}
private void setInitMethods() {
Set<Method> methods = reflections.getMethodsAnnotatedWith(Init.class);
for (Method method : methods) {
MetaMethod metaMethod = new MetaMethod();
metaMethod.setMethod(method);
metaMethod.setOrder(method.getAnnotation(Init.class).order());
addMetaMethod(method, metaMethod, initHookMethods);
}
}
private void addMetaMethod(Method method, MetaMethod metaMethod, HashMap<Class<?>, Set<MetaMethod>> preHookMethods) {
Class<?> clazz = method.getDeclaringClass();
if (preHookMethods.containsKey(clazz)) {
preHookMethods.get(clazz).add(metaMethod);
} else {
HashSet<MetaMethod> metaMethods = new HashSet<>();
metaMethods.add(metaMethod);
preHookMethods.put(clazz, metaMethods);
}
}
private void setModuleList() {
//反射扫描获取@AgentModule所在类, 该部分为Agent流程执行模块
Set<Class<?>> modules = reflections.getTypesAnnotatedWith(AgentModule.class);
for (Class<?> module : modules) {
AgentModule agentModule = module.getAnnotation(AgentModule.class);
MetaModule metaModule = new MetaModule();
metaModule.setName(agentModule.name());
metaModule.setOrder(agentModule.order());
metaModule.setClazz(module);
moduleList.add(metaModule);
}
moduleList.sort(Comparator.comparing(MetaModule::getOrder));
}
}

View File

@@ -1,18 +0,0 @@
package work.slhaf.partner.api.flow.abstracts;
import lombok.Getter;
import lombok.Setter;
import work.slhaf.partner.api.common.chat.Model;
import work.slhaf.partner.api.factory.capability.annotation.CapabilityHolder;
/**
* 模块基类
*/
@CapabilityHolder
public abstract class Module {
@Getter
@Setter
protected Model model = new Model();
}

View File

@@ -1,7 +0,0 @@
import work.slhaf.partner.api.Agent;
public class TestApplication {
public static void main(String[] args) {
Agent.newAgent(TestApplication.class,null).run();
}
}

View File

@@ -0,0 +1,7 @@
package factory;
public class AgentRegisterTest {
public static void main(String[] args) {
}
}

View File

@@ -4,7 +4,7 @@ import net.bytebuddy.ByteBuddy;
import net.bytebuddy.implementation.MethodDelegation; import net.bytebuddy.implementation.MethodDelegation;
import net.bytebuddy.matcher.ElementMatchers; import net.bytebuddy.matcher.ElementMatchers;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import work.slhaf.partner.api.flow.abstracts.AgentInteractionModule; import work.slhaf.partner.api.agent.flow.abstracts.AgentInteractionModule;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;

View File

@@ -1,7 +1,7 @@
package module; package module;
import work.slhaf.partner.api.flow.abstracts.AgentInteractionModule; import work.slhaf.partner.api.agent.flow.abstracts.AgentInteractionModule;
import work.slhaf.partner.api.flow.entity.InteractionFlowContext; import work.slhaf.partner.api.agent.flow.entity.InteractionFlowContext;
public class MyAgentInteractionModule extends AgentInteractionModule { public class MyAgentInteractionModule extends AgentInteractionModule {
@Override @Override

View File

@@ -2,7 +2,7 @@ package work.slhaf.partner.common.util;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import work.slhaf.partner.Agent; import work.slhaf.partner.Agent;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.chat.pojo.Message;
import java.io.InputStream; import java.io.InputStream;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;

View File

@@ -2,9 +2,9 @@ package work.slhaf.partner.core.cognation;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import work.slhaf.partner.api.common.chat.constant.ChatConstant; import work.slhaf.partner.api.agent.factory.capability.annotation.CoordinateManager;
import work.slhaf.partner.api.factory.capability.annotation.CoordinateManager; import work.slhaf.partner.api.agent.factory.capability.annotation.Coordinated;
import work.slhaf.partner.api.factory.capability.annotation.Coordinated; import work.slhaf.partner.api.chat.constant.ChatConstant;
import work.slhaf.partner.common.exception_handler.GlobalExceptionHandler; import work.slhaf.partner.common.exception_handler.GlobalExceptionHandler;
import work.slhaf.partner.common.exception_handler.pojo.GlobalException; import work.slhaf.partner.common.exception_handler.pojo.GlobalException;
import work.slhaf.partner.core.cognation.cognation.CognationCore; import work.slhaf.partner.core.cognation.cognation.CognationCore;

View File

@@ -1,9 +1,9 @@
package work.slhaf.partner.core.cognation.cognation; package work.slhaf.partner.core.cognation.cognation;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.agent.factory.capability.annotation.Capability;
import work.slhaf.partner.api.factory.capability.annotation.Capability; import work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityMethod;
import work.slhaf.partner.api.factory.capability.annotation.CapabilityMethod; import work.slhaf.partner.api.agent.factory.capability.annotation.ToCoordinated;
import work.slhaf.partner.api.factory.capability.annotation.ToCoordinated; import work.slhaf.partner.api.chat.pojo.Message;
import work.slhaf.partner.core.cognation.submodule.memory.pojo.EvaluatedSlice; import work.slhaf.partner.core.cognation.submodule.memory.pojo.EvaluatedSlice;
import java.util.HashMap; import java.util.HashMap;

View File

@@ -4,9 +4,9 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityCore;
import work.slhaf.partner.api.chat.pojo.Message;
import work.slhaf.partner.api.common.entity.PersistableObject; import work.slhaf.partner.api.common.entity.PersistableObject;
import work.slhaf.partner.api.factory.capability.annotation.CapabilityCore;
import work.slhaf.partner.core.cognation.cognation.pojo.ActiveData; import work.slhaf.partner.core.cognation.cognation.pojo.ActiveData;
import work.slhaf.partner.core.cognation.submodule.cache.CacheCore; import work.slhaf.partner.core.cognation.submodule.cache.CacheCore;
import work.slhaf.partner.core.cognation.submodule.memory.MemoryCore; import work.slhaf.partner.core.cognation.submodule.memory.MemoryCore;

View File

@@ -1,6 +1,6 @@
package work.slhaf.partner.core.cognation.submodule.cache; package work.slhaf.partner.core.cognation.submodule.cache;
import work.slhaf.partner.api.factory.capability.annotation.Capability; import work.slhaf.partner.api.agent.factory.capability.annotation.Capability;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap; import java.util.HashMap;

View File

@@ -3,9 +3,9 @@ package work.slhaf.partner.core.cognation.submodule.cache;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityCore;
import work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityMethod;
import work.slhaf.partner.api.common.entity.PersistableObject; import work.slhaf.partner.api.common.entity.PersistableObject;
import work.slhaf.partner.api.factory.capability.annotation.CapabilityCore;
import work.slhaf.partner.api.factory.capability.annotation.CapabilityMethod;
import work.slhaf.partner.core.cognation.common.pojo.MemoryResult; import work.slhaf.partner.core.cognation.common.pojo.MemoryResult;
import work.slhaf.partner.core.cognation.submodule.memory.pojo.MemorySlice; import work.slhaf.partner.core.cognation.submodule.memory.pojo.MemorySlice;

View File

@@ -1,7 +1,7 @@
package work.slhaf.partner.core.cognation.submodule.memory; package work.slhaf.partner.core.cognation.submodule.memory;
import work.slhaf.partner.api.factory.capability.annotation.Capability; import work.slhaf.partner.api.agent.factory.capability.annotation.Capability;
import work.slhaf.partner.api.factory.capability.annotation.ToCoordinated; import work.slhaf.partner.api.agent.factory.capability.annotation.ToCoordinated;
import work.slhaf.partner.core.cognation.common.pojo.MemoryResult; import work.slhaf.partner.core.cognation.common.pojo.MemoryResult;
import work.slhaf.partner.core.cognation.submodule.memory.pojo.MemorySlice; import work.slhaf.partner.core.cognation.submodule.memory.pojo.MemorySlice;

View File

@@ -2,9 +2,9 @@ package work.slhaf.partner.core.cognation.submodule.memory;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityCore;
import work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityMethod;
import work.slhaf.partner.api.common.entity.PersistableObject; import work.slhaf.partner.api.common.entity.PersistableObject;
import work.slhaf.partner.api.factory.capability.annotation.CapabilityCore;
import work.slhaf.partner.api.factory.capability.annotation.CapabilityMethod;
import work.slhaf.partner.core.cognation.common.pojo.MemoryResult; import work.slhaf.partner.core.cognation.common.pojo.MemoryResult;
import work.slhaf.partner.core.cognation.common.pojo.MemorySliceResult; import work.slhaf.partner.core.cognation.common.pojo.MemorySliceResult;
import work.slhaf.partner.core.cognation.submodule.memory.exception.UnExistedDateIndexException; import work.slhaf.partner.core.cognation.submodule.memory.exception.UnExistedDateIndexException;

View File

@@ -3,7 +3,7 @@ package work.slhaf.partner.core.cognation.submodule.memory.pojo;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.chat.pojo.Message;
import work.slhaf.partner.api.common.entity.PersistableObject; import work.slhaf.partner.api.common.entity.PersistableObject;
import java.io.Serial; import java.io.Serial;

View File

@@ -1,6 +1,6 @@
package work.slhaf.partner.core.cognation.submodule.perceive; package work.slhaf.partner.core.cognation.submodule.perceive;
import work.slhaf.partner.api.factory.capability.annotation.Capability; import work.slhaf.partner.api.agent.factory.capability.annotation.Capability;
import work.slhaf.partner.core.cognation.submodule.perceive.pojo.User; import work.slhaf.partner.core.cognation.submodule.perceive.pojo.User;
@Capability(value = "perceive") @Capability(value = "perceive")

View File

@@ -2,9 +2,9 @@ package work.slhaf.partner.core.cognation.submodule.perceive;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityCore;
import work.slhaf.partner.api.agent.factory.capability.annotation.CapabilityMethod;
import work.slhaf.partner.api.common.entity.PersistableObject; import work.slhaf.partner.api.common.entity.PersistableObject;
import work.slhaf.partner.api.factory.capability.annotation.CapabilityCore;
import work.slhaf.partner.api.factory.capability.annotation.CapabilityMethod;
import work.slhaf.partner.core.cognation.cognation.exception.UserNotExistsException; import work.slhaf.partner.core.cognation.cognation.exception.UserNotExistsException;
import work.slhaf.partner.core.cognation.submodule.perceive.pojo.User; import work.slhaf.partner.core.cognation.submodule.perceive.pojo.User;

View File

@@ -4,8 +4,8 @@ import com.alibaba.fastjson2.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.chat.pojo.Message;
import work.slhaf.partner.api.common.chat.pojo.MetaMessage; import work.slhaf.partner.api.chat.pojo.MetaMessage;
import work.slhaf.partner.api.common.entity.PersistableObject; import work.slhaf.partner.api.common.entity.PersistableObject;
import work.slhaf.partner.common.config.Config; import work.slhaf.partner.common.config.Config;

View File

@@ -4,12 +4,12 @@ import com.alibaba.fastjson2.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import work.slhaf.partner.api.common.chat.constant.ChatConstant; import work.slhaf.partner.api.agent.factory.capability.annotation.InjectCapability;
import work.slhaf.partner.api.common.chat.pojo.ChatResponse; import work.slhaf.partner.api.agent.flow.abstracts.ActivateModel;
import work.slhaf.partner.api.common.chat.pojo.Message; import work.slhaf.partner.api.chat.constant.ChatConstant;
import work.slhaf.partner.api.common.chat.pojo.MetaMessage; import work.slhaf.partner.api.chat.pojo.ChatResponse;
import work.slhaf.partner.api.factory.capability.annotation.InjectCapability; import work.slhaf.partner.api.chat.pojo.Message;
import work.slhaf.partner.api.flow.abstracts.ActivateModel; import work.slhaf.partner.api.chat.pojo.MetaMessage;
import work.slhaf.partner.core.cognation.cognation.CognationCapability; import work.slhaf.partner.core.cognation.cognation.CognationCapability;
import work.slhaf.partner.core.interaction.data.context.InteractionContext; import work.slhaf.partner.core.interaction.data.context.InteractionContext;
import work.slhaf.partner.core.session.SessionManager; import work.slhaf.partner.core.session.SessionManager;

View File

@@ -4,7 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import work.slhaf.partner.api.factory.capability.annotation.InjectCapability; import work.slhaf.partner.api.agent.factory.capability.annotation.InjectCapability;
import work.slhaf.partner.core.cognation.cognation.CognationCapability; import work.slhaf.partner.core.cognation.cognation.CognationCapability;
import work.slhaf.partner.core.cognation.common.pojo.MemoryResult; import work.slhaf.partner.core.cognation.common.pojo.MemoryResult;
import work.slhaf.partner.core.cognation.submodule.cache.CacheCapability; import work.slhaf.partner.core.cognation.submodule.cache.CacheCapability;

Some files were not shown because too many files have changed in this diff Show More