Преглед изворни кода

聊天,模型,知识库模块,bug修复,功能开发

zhangenzhi пре 5 месеци
родитељ
комит
75e69b6f4b
100 измењених фајлова са 1861 додато и 1013 уклоњено
  1. 166 0
      .flattened-pom.xml
  2. 122 0
      pavis-common/.flattened-pom.xml
  3. 16 0
      pavis-common/pom.xml
  4. 0 1
      pavis-common/src/main/java/com/pavis/admin/common/constant/ContainerConstants.java
  5. 23 0
      pavis-extension/.flattened-pom.xml
  6. 49 0
      pavis-extension/pavis-extension-schedule-server/.flattened-pom.xml
  7. 126 0
      pavis-module-aigc/.flattened-pom.xml
  8. 1 3
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/PavisAiAutoConfiguration.java
  9. 68 0
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/dto/ChatReq.java
  10. 47 0
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/dto/ChatRes.java
  11. 49 0
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/dto/EmbeddingR.java
  12. 56 0
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/dto/ImageR.java
  13. 77 0
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/dto/PromptConst.java
  14. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/model/req/ChatReq.java
  15. 1 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/model/req/ImageReq.java
  16. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/utils/PromptUtil.java
  17. 2 2
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/utils/StreamEmitter.java
  18. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/constant/EmbedConst.java
  19. 41 41
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/constant/PromptConst.java
  20. 20 21
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/AbstractBaseAgent.java
  21. 28 28
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/PavisAgent.java
  22. 1 2
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/ReActAgent.java
  23. 16 17
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/browser/ExecutionParam.java
  24. 2 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/planner/PlanContext.java
  25. 21 24
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/tool/BrowserUseTool.java
  26. 18 13
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/tool/FunctionToolCallback.java
  27. 51 52
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/tool/PlanningTool.java
  28. 38 37
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/tool/TerminateTool.java
  29. 266 264
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/LlmService.java
  30. 1 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/exception/AuthException.java
  31. 1 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/exception/ServiceException.java
  32. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/EmbeddingProvider.java
  33. 26 29
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/EmbeddingStoreFactory.java
  34. 8 11
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/KnowledgeStoreFactory.java
  35. 1 2
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/ModelProvider.java
  36. 2 9
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/ModelStoreFactory.java
  37. 27 30
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/build/OllamaModelBuildHandler.java
  38. 50 61
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/build/OpenAIModelBuildHandler.java
  39. 31 35
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/build/QFanModelBuildHandler.java
  40. 20 26
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/build/QWenModelBuildHandler.java
  41. 53 57
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/build/ZhipuModelBuildHandler.java
  42. 1 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/service/Agent.java
  43. 1 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/service/impl/PersistentChatMemoryStore.java
  44. 73 0
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/task/AnalysisThreadPool.java
  45. 57 0
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/task/TaskManager.java
  46. 1 4
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/AgentState.java
  47. 2 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/ChatErrorEnum.java
  48. 1 4
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/EmbedStoreEnum.java
  49. 1 4
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/ModelTypeEnum.java
  50. 1 14
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/ProviderEnum.java
  51. 1 4
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/RoleEnum.java
  52. 5 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AgentKnowledgeMapper.java
  53. 5 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AgentMapper.java
  54. 5 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AgentPlanMapper.java
  55. 5 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AigcAppMapper.java
  56. 5 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AigcMessageFeedbackMapper.java
  57. 5 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AigcMessageMapper.java
  58. 5 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AppApiMapper.java
  59. 6 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AppKnowledgeMapper.java
  60. 5 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/ConversationMapper.java
  61. 5 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/DocChunkMapper.java
  62. 5 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/DocMapper.java
  63. 5 6
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/EmbedStoreMapper.java
  64. 5 6
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/KnowledgeMapper.java
  65. 7 16
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/ModelMapper.java
  66. 5 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/ModelSecretMapper.java
  67. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AgentDO.java
  68. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AgentKnowledgeDO.java
  69. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AgentPlanDO.java
  70. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AigcAppDO.java
  71. 1 2
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AigcMessageDO.java
  72. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AigcMessageFeedbackDO.java
  73. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AppApiDO.java
  74. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AppKnowledgeDO.java
  75. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/ConversationDO.java
  76. 6 2
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/DocChunkDO.java
  77. 17 13
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/DocDO.java
  78. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/EmbedStoreDO.java
  79. 9 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/KnowledgeDO.java
  80. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/ModelDO.java
  81. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/ModelSecretDO.java
  82. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/ToolDO.java
  83. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/AgentKnowledgeQuery.java
  84. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/AgentPlanQuery.java
  85. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/AppKnowledgeQuery.java
  86. 7 3
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/DocChunkQuery.java
  87. 1 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/DocQuery.java
  88. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/KnowledgeQuery.java
  89. 0 2
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/AgentKnowledgeReq.java
  90. 13 13
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/AigcMessageReq.java
  91. 0 2
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/AppKnowledgeReq.java
  92. 18 18
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/ConversationReq.java
  93. 16 12
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/DocChunkReq.java
  94. 16 11
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/DocReq.java
  95. 7 0
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/KnowledgeReq.java
  96. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/ModelSecretReq.java
  97. 7 7
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/resp/AgentPlanResp.java
  98. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/resp/AgentPlanStepDetailResp.java
  99. 0 1
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/resp/AgentPlanStepResp.java
  100. 1 5
      pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/resp/AgentToolResp.java

+ 166 - 0
.flattened-pom.xml

@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>top.continew</groupId>
+    <artifactId>continew-starter</artifactId>
+    <version>2.12.0</version>
+  </parent>
+  <groupId>com.pavis</groupId>
+  <artifactId>pavis-admin</artifactId>
+  <version>3.7.0</version>
+  <packaging>pom</packaging>
+  <description>持续迭代优化的前后端分离中后台管理系统框架,开箱即用,持续提供舒适的开发体验。</description>
+  <licenses>
+    <license>
+      <name>GNU LESSER GENERAL PUBLIC LICENSE</name>
+      <url>http://www.gnu.org/licenses/lgpl.html</url>
+    </license>
+  </licenses>
+  <modules>
+    <module>pavis-webapi</module>
+    <module>pavis-module-system</module>
+    <module>pavis-plugin</module>
+    <module>pavis-common</module>
+    <module>pavis-extension</module>
+    <module>pavis-module-aigc</module>
+  </modules>
+  <properties>
+    <revision>3.7.0</revision>
+  </properties>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>com.pavis</groupId>
+        <artifactId>pavis-webapi</artifactId>
+        <version>3.7.0</version>
+      </dependency>
+      <dependency>
+        <groupId>com.pavis</groupId>
+        <artifactId>pavis-module-system</artifactId>
+        <version>3.7.0</version>
+      </dependency>
+      <dependency>
+        <groupId>com.pavis</groupId>
+        <artifactId>pavis-module-aigc</artifactId>
+        <version>3.7.0</version>
+      </dependency>
+      <dependency>
+        <groupId>com.pavis</groupId>
+        <artifactId>pavis-common</artifactId>
+        <version>3.7.0</version>
+      </dependency>
+      <dependency>
+        <groupId>com.pavis</groupId>
+        <artifactId>pavis-plugin-schedule</artifactId>
+        <version>3.7.0</version>
+      </dependency>
+      <dependency>
+        <groupId>com.pavis</groupId>
+        <artifactId>pavis-plugin-open</artifactId>
+        <version>3.7.0</version>
+      </dependency>
+      <dependency>
+        <groupId>com.pavis</groupId>
+        <artifactId>pavis-plugin-generator</artifactId>
+        <version>3.7.0</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <dependencies>
+    <dependency>
+      <groupId>cn.hutool</groupId>
+      <artifactId>hutool-all</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.projectlombok</groupId>
+      <artifactId>lombok</artifactId>
+      <optional>true</optional>
+    </dependency>
+  </dependencies>
+  <repositories>
+    <repository>
+      <id>huawei-mirror</id>
+      <name>HuaweiCloud Mirror</name>
+      <url>https://mirrors.huaweicloud.com/repository/maven/</url>
+    </repository>
+    <repository>
+      <id>ali-mirror</id>
+      <name>AliYun Mirror</name>
+      <url>https://maven.aliyun.com/repository/public/</url>
+    </repository>
+  </repositories>
+  <pluginRepositories>
+    <pluginRepository>
+      <id>huawei-mirror</id>
+      <name>HuaweiCloud Mirror</name>
+      <url>https://mirrors.huaweicloud.com/repository/maven/</url>
+    </pluginRepository>
+    <pluginRepository>
+      <id>ali-mirror</id>
+      <name>AliYun Mirror</name>
+      <url>https://maven.aliyun.com/repository/public/</url>
+    </pluginRepository>
+  </pluginRepositories>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <compilerArgument>-parameters</compilerArgument>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>com.diffplug.spotless</groupId>
+        <artifactId>spotless-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>compile</phase>
+            <goals>
+              <goal>apply</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <java>
+            <removeUnusedImports />
+            <eclipse>
+              <file>.style/p3c-codestyle.xml</file>
+            </eclipse>
+          </java>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>flatten-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>flatten</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>flatten</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>flatten-clean</id>
+            <phase>clean</phase>
+            <goals>
+              <goal>clean</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <updatePomFile>true</updatePomFile>
+          <flattenMode>resolveCiFriendliesOnly</flattenMode>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

+ 122 - 0
pavis-common/.flattened-pom.xml

@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.pavis</groupId>
+    <artifactId>pavis-admin</artifactId>
+    <version>3.7.0</version>
+  </parent>
+  <artifactId>pavis-common</artifactId>
+  <version>3.7.0</version>
+  <description>公共模块(存放公共工具类,公共配置等)</description>
+  <licenses>
+    <license>
+      <name>GNU LESSER GENERAL PUBLIC LICENSE</name>
+      <url>http://www.gnu.org/licenses/lgpl.html</url>
+    </license>
+  </licenses>
+  <dependencies>
+    <dependency>
+      <groupId>me.ahoo.cosid</groupId>
+      <artifactId>cosid-spring-boot-starter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>me.ahoo.cosid</groupId>
+      <artifactId>cosid-spring-redis</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.dromara.x-file-storage</groupId>
+      <artifactId>x-file-storage-spring</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.amazonaws</groupId>
+      <artifactId>aws-java-sdk-s3</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.freemarker</groupId>
+      <artifactId>freemarker</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.mysql</groupId>
+      <artifactId>mysql-connector-j</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-extension-crud-mp</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>cn.dev33</groupId>
+      <artifactId>sa-token-spring-boot3-starter</artifactId>
+      <version>1.37.0</version>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-auth-satoken</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework.boot</groupId>
+          <artifactId>spring-boot-starter-web</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>cn.dev33</groupId>
+          <artifactId>sa-token-spring-boot3-starter</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-auth-justauth</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-cache-jetcache</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-extension-datapermission-mp</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-messaging-websocket</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework.boot</groupId>
+          <artifactId>spring-boot-starter-web</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-messaging-mail</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-captcha-graphic</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-captcha-behavior</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-ratelimiter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-security-crypto</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-security-mask</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-security-password</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>top.continew</groupId>
+      <artifactId>continew-starter-json-jackson</artifactId>
+    </dependency>
+  </dependencies>
+</project>

+ 16 - 0
pavis-common/pom.xml

@@ -56,6 +56,18 @@
             <artifactId>continew-starter-extension-crud-mp</artifactId>
         </dependency>
 
+<!--        <dependency>-->
+<!--            <groupId>cn.dev33</groupId>-->
+<!--            <artifactId>sa-token-reactor-spring-boot-starter</artifactId>-->
+<!--            <version>1.42.0</version>-->
+<!--        </dependency>-->
+
+<!--        <dependency>-->
+<!--            <groupId>cn.dev33</groupId>-->
+<!--            <artifactId>sa-token-spring-boot3-starter</artifactId>-->
+<!--            <version>1.37.0</version>-->
+<!--        </dependency>-->
+
         <!-- ContiNew Starter 认证模块 - SaToken -->
         <dependency>
             <groupId>top.continew</groupId>
@@ -65,6 +77,10 @@
                     <groupId>org.springframework.boot</groupId>
                     <artifactId>spring-boot-starter-web</artifactId>
                 </exclusion>
+                <exclusion>
+                    <groupId>cn.dev33</groupId>
+                    <artifactId>sa-token-spring-boot3-starter</artifactId>
+                </exclusion>
             </exclusions>
         </dependency>
 

+ 0 - 1
pavis-common/src/main/java/com/pavis/admin/common/constant/ContainerConstants.java

@@ -29,7 +29,6 @@ public class ContainerConstants {
      */
     public static final String APP_KNOWLEDGE_ID_LIST = "AppKnowledgeIdList";
 
-
     /**
      * 智能体工具 ID 列表
      */

+ 23 - 0
pavis-extension/.flattened-pom.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.pavis</groupId>
+    <artifactId>pavis-admin</artifactId>
+    <version>3.7.0</version>
+  </parent>
+  <artifactId>pavis-extension</artifactId>
+  <version>3.7.0</version>
+  <packaging>pom</packaging>
+  <description>扩展模块(存放其他扩展模块)</description>
+  <licenses>
+    <license>
+      <name>GNU LESSER GENERAL PUBLIC LICENSE</name>
+      <url>http://www.gnu.org/licenses/lgpl.html</url>
+    </license>
+  </licenses>
+  <modules>
+    <module>pavis-extension-schedule-server</module>
+  </modules>
+</project>

+ 49 - 0
pavis-extension/pavis-extension-schedule-server/.flattened-pom.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.pavis</groupId>
+    <artifactId>pavis-extension</artifactId>
+    <version>3.7.0</version>
+  </parent>
+  <artifactId>pavis-extension-schedule-server</artifactId>
+  <version>3.7.0</version>
+  <description>任务调度服务端</description>
+  <licenses>
+    <license>
+      <name>GNU LESSER GENERAL PUBLIC LICENSE</name>
+      <url>http://www.gnu.org/licenses/lgpl.html</url>
+    </license>
+  </licenses>
+  <properties>
+    <snail-job.version>1.4.0</snail-job.version>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>com.aizuda</groupId>
+      <artifactId>snail-job-server-starter</artifactId>
+      <version>${snail-job.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.liquibase</groupId>
+      <artifactId>liquibase-core</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <finalName>${project.artifactId}</finalName>
+    <plugins>
+      <plugin>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>repackage</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

+ 126 - 0
pavis-module-aigc/.flattened-pom.xml

@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.pavis</groupId>
+    <artifactId>pavis-admin</artifactId>
+    <version>3.7.0</version>
+  </parent>
+  <artifactId>pavis-module-aigc</artifactId>
+  <version>3.7.0</version>
+  <description>智能管理模块(存放智能管理相关业务功能,例如:知识库、增强检索、智能体等)</description>
+  <licenses>
+    <license>
+      <name>GNU LESSER GENERAL PUBLIC LICENSE</name>
+      <url>http://www.gnu.org/licenses/lgpl.html</url>
+    </license>
+  </licenses>
+  <properties>
+    <langchain4j-core.version>1.0.0-beta1</langchain4j-core.version>
+    <spring-ai.version>1.0.0-M8</spring-ai.version>
+    <langchain4j-community.version>1.0.1-beta6</langchain4j-community.version>
+    <langchain4j.version>1.0.0-beta1</langchain4j.version>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>com.pavis</groupId>
+      <artifactId>pavis-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.ai</groupId>
+      <artifactId>spring-ai-starter-model-openai</artifactId>
+      <version>${spring-ai.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.ai</groupId>
+      <artifactId>spring-ai-starter-mcp-client-webflux</artifactId>
+      <version>${spring-ai.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.httpcomponents.client5</groupId>
+      <artifactId>httpclient5</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.httpcomponents.core5</groupId>
+      <artifactId>httpcore5</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j</artifactId>
+      <version>${langchain4j-core.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-core</artifactId>
+      <version>${langchain4j-core.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-open-ai</artifactId>
+      <version>${langchain4j-core.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-ollama</artifactId>
+      <version>${langchain4j.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-community-qianfan</artifactId>
+      <version>${langchain4j.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-community-dashscope</artifactId>
+      <version>${langchain4j.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-simple</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-community-zhipu-ai</artifactId>
+      <version>${langchain4j.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-embeddings</artifactId>
+      <version>${langchain4j.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-community-redis</artifactId>
+      <version>${langchain4j.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-pgvector</artifactId>
+      <version>${langchain4j.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-milvus</artifactId>
+      <version>${langchain4j.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-embedding-store-filter-parser-sql</artifactId>
+      <version>${langchain4j.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>com.github.jsqlparser</groupId>
+          <artifactId>jsqlparser</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>dev.langchain4j</groupId>
+      <artifactId>langchain4j-document-parser-apache-tika</artifactId>
+      <version>${langchain4j.version}</version>
+    </dependency>
+  </dependencies>
+</project>

+ 1 - 3
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/PavisAiAutoConfiguration.java

@@ -5,8 +5,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
 import org.springframework.context.annotation.Configuration;
 
 @Configuration
-@EnableConfigurationProperties({
-        ChatProps.class,
-})
+@EnableConfigurationProperties({ChatProps.class,})
 public class PavisAiAutoConfiguration {
 }

+ 68 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/dto/ChatReq.java

@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.pavis.admin.aigc.common.dto;
+
+import com.pavis.admin.aigc.common.utils.StreamEmitter;
+import dev.langchain4j.model.input.Prompt;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Executor;
+
+/**
+ * @author tycoding
+ * @since 2024/1/30
+ */
+@Data
+@Accessors(chain = true)
+public class ChatReq {
+
+    private String appId;
+    private String modelId;
+    private String modelName;
+    private String modelProvider;
+
+    private String message;
+
+    private String conversationId;
+
+    private String userId;
+
+    private String username;
+
+    private String chatId;
+
+    private String promptText;
+
+    private String docsName;
+
+    private String knowledgeId;
+    private List<String> knowledgeIds = new ArrayList<>();
+
+    private String docsId;
+
+    private String url;
+
+    private String role;
+
+    private Prompt prompt;
+
+    private StreamEmitter emitter;
+    private Executor executor;
+}

+ 47 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/dto/ChatRes.java

@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.pavis.admin.aigc.common.dto;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @author tycoding
+ * @since 2024/1/29
+ */
+@Data
+@Accessors(chain = true)
+public class ChatRes {
+
+    private boolean isDone = false;
+
+    private String message;
+
+    private Integer usedToken;
+
+    private long time;
+
+    public ChatRes(String message) {
+        this.message = message;
+    }
+
+    public ChatRes(Integer usedToken, long startTime) {
+        this.isDone = true;
+        this.usedToken = usedToken;
+        this.time = System.currentTimeMillis() - startTime;
+    }
+}

+ 49 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/dto/EmbeddingR.java

@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.pavis.admin.aigc.common.dto;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @author tycoding
+ * @since 2024/4/26
+ */
+@Data
+@Accessors(chain = true)
+public class EmbeddingR {
+
+    /**
+     * 写入到vector store的ID
+     */
+    private String vectorId;
+
+    /**
+     * 文档ID
+     */
+    private String docsId;
+
+    /**
+     * 知识库ID
+     */
+    private String knowledgeId;
+
+    /**
+     * Embedding后切片的文本
+     */
+    private String text;
+}

+ 56 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/dto/ImageR.java

@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.pavis.admin.aigc.common.dto;
+
+import dev.langchain4j.model.input.Prompt;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @author tycoding
+ * @since 2024/1/6
+ */
+@Data
+@Accessors(chain = true)
+public class ImageR {
+
+    private String modelId;
+    private String modelName;
+    private String modelProvider;
+
+    private Prompt prompt;
+
+    /**
+     * 内容
+     */
+    private String message;
+
+    /**
+     * 质量
+     */
+    private String quality;
+
+    /**
+     * 尺寸
+     */
+    private String size;
+
+    /**
+     * 风格
+     */
+    private String style;
+}

+ 77 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/dto/PromptConst.java

@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.pavis.admin.aigc.common.dto;
+
+/**
+ * @author tycoding
+ * @since 2024/3/1
+ */
+public interface PromptConst {
+
+    String QUESTION = "question";
+
+    String EMPTY = """
+
+        ------
+        {{question}}
+        ------
+        """;
+
+    String DOCUMENT = "You are good at analyzing documents. Please analyze my questions according to the following documents, question: [{{question}}], [docs]";
+
+    String MINDMAP = """
+        # Role
+        You are a Markdown outline format engineer who focuses on answering user questions. You can quickly and accurately convert user questions into refined Markdown outline titles, and refine the specific details of each title.
+
+        ## Skills
+        ### Skill 1: Identify user question intent
+        - Accurately understand the specific content and needs of user questions.
+        ### Skill 2: Convert to Markdown outline
+        - Simplify user questions into Markdown outline-style titles.
+        ### Skill 3: Return to user
+        - Return the optimized outline to the user.
+
+        ## Constraints
+        - Only return the organized Markdown format content, without other explanation information
+        - Answer the question in the language used by the user.
+        - Return the answer in Markdown style, keep the main title as concise as possible; and refine the specific step information of each main title in the subtitle.
+        """;
+
+    String WRITE = """
+        # 角色
+        你是一名专业文案撰写师。你擅长运用行业领域相关知识,以专业的视角为用户生成Markdown文档。
+
+        ## 技能
+        ### 技能 1: 写作
+        - 提取用户输入的主题和关键信息。
+
+        ### 技能 2: 专业知识应用
+        - 了解相关行业的相关知识。
+        - 在撰写内容时,运用专业的语言和视角。
+
+         ### 技能 3: 遵循Markdown格式
+        - 拆分文档内容,以Markdown大纲格式分段内容,更易于用户阅读
+
+        ## 限制
+        - 只讨论写作相关的话题,不要返回其他任何内容和解释。
+        - 始终以用户输入的信息为主题,撰写内容。
+        """;
+
+    String IMAGE = """
+        Please generate the corresponding pictures according to the following requirements.
+        """;
+}

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/model/req/ChatReq.java

@@ -9,7 +9,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.Executor;
 
-
 @Data
 @Accessors(chain = true)
 public class ChatReq {

+ 1 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/model/req/ImageReq.java

@@ -5,7 +5,7 @@
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *     https://www.gnu.org/licenses/agpl-3.0.html
+ * https://www.gnu.org/licenses/agpl-3.0.html
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/utils/PromptUtil.java

@@ -7,7 +7,6 @@ import dev.langchain4j.model.input.PromptTemplate;
 
 import java.util.Map;
 
-
 public class PromptUtil {
 
     public static Prompt build(String message) {

+ 2 - 2
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/common/utils/StreamEmitter.java

@@ -10,7 +10,7 @@ public class StreamEmitter {
     private final SseEmitter emitter;
 
     public StreamEmitter() {
-        emitter = new SseEmitter(5 * 60 * 1000L);
+        emitter = new SseEmitter(10 * 60 * 1000L);
     }
 
     public SseEmitter get() {
@@ -18,7 +18,7 @@ public class StreamEmitter {
     }
 
     public SseEmitter streaming(final ExecutorService executor, Runnable func) {
-//        ExecutorService executor = Executors.newSingleThreadExecutor();
+        //        ExecutorService executor = Executors.newSingleThreadExecutor();
 
         emitter.onCompletion(() -> {
             System.out.println("SseEmitter 完成");

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/constant/EmbedConst.java

@@ -1,6 +1,5 @@
 package com.pavis.admin.aigc.constant;
 
-
 public interface EmbedConst {
 
     String ORIGIN_TYPE_INPUT = "INPUT";

+ 41 - 41
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/constant/PromptConst.java

@@ -5,53 +5,53 @@ public interface PromptConst {
     String QUESTION = "question";
 
     String EMPTY = """
-            
-            ------
-            {{question}}
-            ------
-            """;
+
+        ------
+        {{question}}
+        ------
+        """;
 
     String DOCUMENT = "You are good at analyzing documents. Please analyze my questions according to the following documents, question: [{{question}}], [docs]";
 
     String MINDMAP = """
-            # Role
-            You are a Markdown outline format engineer who focuses on answering user questions. You can quickly and accurately convert user questions into refined Markdown outline titles, and refine the specific details of each title.
-            
-            ## Skills
-            ### Skill 1: Identify user question intent
-            - Accurately understand the specific content and needs of user questions.
-            ### Skill 2: Convert to Markdown outline
-            - Simplify user questions into Markdown outline-style titles.
-            ### Skill 3: Return to user
-            - Return the optimized outline to the user.
-            
-            ## Constraints
-            - Only return the organized Markdown format content, without other explanation information
-            - Answer the question in the language used by the user.
-            - Return the answer in Markdown style, keep the main title as concise as possible; and refine the specific step information of each main title in the subtitle.
-            """;
+        # Role
+        You are a Markdown outline format engineer who focuses on answering user questions. You can quickly and accurately convert user questions into refined Markdown outline titles, and refine the specific details of each title.
+
+        ## Skills
+        ### Skill 1: Identify user question intent
+        - Accurately understand the specific content and needs of user questions.
+        ### Skill 2: Convert to Markdown outline
+        - Simplify user questions into Markdown outline-style titles.
+        ### Skill 3: Return to user
+        - Return the optimized outline to the user.
+
+        ## Constraints
+        - Only return the organized Markdown format content, without other explanation information
+        - Answer the question in the language used by the user.
+        - Return the answer in Markdown style, keep the main title as concise as possible; and refine the specific step information of each main title in the subtitle.
+        """;
 
     String WRITE = """
-            # 角色
-            你是一名专业文案撰写师。你擅长运用行业领域相关知识,以专业的视角为用户生成Markdown文档。
-            
-            ## 技能
-            ### 技能 1: 写作
-            - 提取用户输入的主题和关键信息。
-            
-            ### 技能 2: 专业知识应用
-            - 了解相关行业的相关知识。
-            - 在撰写内容时,运用专业的语言和视角。
-            
-             ### 技能 3: 遵循Markdown格式
-            - 拆分文档内容,以Markdown大纲格式分段内容,更易于用户阅读
-            
-            ## 限制
-            - 只讨论写作相关的话题,不要返回其他任何内容和解释。
-            - 始终以用户输入的信息为主题,撰写内容。
-            """;
+        # 角色
+        你是一名专业文案撰写师。你擅长运用行业领域相关知识,以专业的视角为用户生成Markdown文档。
+
+        ## 技能
+        ### 技能 1: 写作
+        - 提取用户输入的主题和关键信息。
+
+        ### 技能 2: 专业知识应用
+        - 了解相关行业的相关知识。
+        - 在撰写内容时,运用专业的语言和视角。
+
+         ### 技能 3: 遵循Markdown格式
+        - 拆分文档内容,以Markdown大纲格式分段内容,更易于用户阅读
+
+        ## 限制
+        - 只讨论写作相关的话题,不要返回其他任何内容和解释。
+        - 始终以用户输入的信息为主题,撰写内容。
+        """;
 
     String IMAGE = """
-            Please generate the corresponding pictures according to the following requirements.
-            """;
+        Please generate the corresponding pictures according to the following requirements.
+        """;
 }

+ 20 - 21
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/AbstractBaseAgent.java

@@ -168,26 +168,26 @@ public abstract class AbstractBaseAgent {
         String currentDateTime = java.time.LocalDate.now().toString(); // 格式为yyyy-MM-dd
 
         String stepPrompt = """
-                - SYSTEM INFORMATION:
-                OS: %s %s (%s)
-                
-                - Current Date:
-                %s
-                - 全局计划信息:
-                {planStatus}
-                
-                - 当前要做的步骤要求:
-                STEP {currentStepIndex} : {stepText}
-                
-                - 当前步骤的上下文信息:
-                {extraParams}
-                
-                重要说明:
-                1. 使用工具调用时,不需要额外的任何解释说明!
-                2. 不要在工具调用前提供推理或描述!
-                3. 专注于立即行动而非解释!
-                
-                """.formatted(osName, osVersion, osArch, currentDateTime);
+            - SYSTEM INFORMATION:
+            OS: %s %s (%s)
+
+            - Current Date:
+            %s
+            - 全局计划信息:
+            {planStatus}
+
+            - 当前要做的步骤要求:
+            STEP {currentStepIndex} : {stepText}
+
+            - 当前步骤的上下文信息:
+            {extraParams}
+
+            重要说明:
+            1. 使用工具调用时,不需要额外的任何解释说明!
+            2. 不要在工具调用前提供推理或描述!
+            3. 专注于立即行动而非解释!
+
+            """.formatted(osName, osVersion, osArch, currentDateTime);
 
         SystemPromptTemplate promptTemplate = new SystemPromptTemplate(stepPrompt);
 
@@ -277,7 +277,6 @@ public abstract class AbstractBaseAgent {
         this.executionParam = executionParam;
     }
 
-
     public static class AgentExecResult {
 
         private String result;

+ 28 - 28
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/PavisAgent.java

@@ -63,8 +63,7 @@ public class PavisAgent extends ReActAgent {
     /**
      * 用于获取所有工具集
      */
-    private ToolService toolService;
-    ;
+    private ToolService toolService;;
 
     /**
      * 构造函数
@@ -95,13 +94,13 @@ public class PavisAgent extends ReActAgent {
             userPrompt = new Prompt(messages, chatOptions);
 
             response = llmService.getAgentChatClient(String.valueOf(planId))
-                    .getChatClient()
-                    .prompt(userPrompt)
-                    .advisors(memoryAdvisor -> memoryAdvisor.param(CHAT_MEMORY_CONVERSATION_ID_KEY, String.valueOf(planId))
-                            .param(CHAT_MEMORY_RETRIEVE_SIZE_KEY, 100))
-                    .toolCallbacks(getToolCallList())
-                    .call()
-                    .chatResponse();
+                .getChatClient()
+                .prompt(userPrompt)
+                .advisors(memoryAdvisor -> memoryAdvisor.param(CHAT_MEMORY_CONVERSATION_ID_KEY, String.valueOf(planId))
+                    .param(CHAT_MEMORY_RETRIEVE_SIZE_KEY, 100))
+                .toolCallbacks(getToolCallList())
+                .call()
+                .chatResponse();
 
             String responseByLLm = response.getResult().getOutput().getText();
             if (responseByLLm != null && !responseByLLm.isEmpty()) {
@@ -114,12 +113,15 @@ public class PavisAgent extends ReActAgent {
             log.info(String.format("🛠️ %s selected %d tools to use", getName(), toolCalls.size()));
 
             if (!toolCalls.isEmpty()) {
-                log.info(String.format("🧰 Tools being prepared: %s",
-                        toolCalls.stream().map(AssistantMessage.ToolCall::name).collect(Collectors.toList())));
+                log.info(String.format("🧰 Tools being prepared: %s", toolCalls.stream()
+                    .map(AssistantMessage.ToolCall::name)
+                    .collect(Collectors.toList())));
                 reActRecord.setExecutionNeeded(true);
                 reActRecord.setToolName(toolCalls.get(0).name());
                 reActRecord.setToolParameters(toolCalls.get(0).arguments());
-                responseByLLm = String.format("Tools being prepared. Executing tool: tool %s,arguments %s.", toolCalls.get(0).name(), toolCalls.get(0).arguments());
+                responseByLLm = String.format("Tools being prepared. Executing tool: tool %s,arguments %s.", toolCalls
+                    .get(0)
+                    .name(), toolCalls.get(0).arguments());
             }
             reActRecord.setStatus("SUCCESS");
             reActRecord.finishThinking(responseByLLm);
@@ -169,8 +171,7 @@ public class PavisAgent extends ReActAgent {
         List<ToolCallback> toolCallbacks = new ArrayList<>();
         Map<String, ToolCallBackContext> toolCallbackMap = new HashMap<>();
         List<ToolCallBiFunctionDef> toolDefinitions = new ArrayList<>();
-        @SuppressWarnings("unchecked")
-        Map<String, Object> envData = getExecutionParam().getEnvData().getEnvDataMap();
+        @SuppressWarnings("unchecked") Map<String, Object> envData = getExecutionParam().getEnvData().getEnvDataMap();
         // 得先获取所有工具
         List<ToolDO> tools = toolService.getAll();
         if (tools != null) {
@@ -183,16 +184,15 @@ public class PavisAgent extends ReActAgent {
 
         // 为每个工具创建 FunctionToolCallback
         for (ToolCallBiFunctionDef toolDefinition : toolDefinitions) {
-            FunctionToolCallback functionToolcallback = FunctionToolCallback
-                    .builder(toolDefinition.getName(), toolDefinition)
-                    .description(toolDefinition.getDescription())
-                    .inputSchema(toolDefinition.getParameters())
-                    .inputType(toolDefinition.getInputType())
-                    .toolMetadata(ToolMetadata.builder().returnDirect(toolDefinition.isReturnDirect()).build())
-                    .build();
+            FunctionToolCallback functionToolcallback = FunctionToolCallback.builder(toolDefinition
+                .getName(), toolDefinition)
+                .description(toolDefinition.getDescription())
+                .inputSchema(toolDefinition.getParameters())
+                .inputType(toolDefinition.getInputType())
+                .toolMetadata(ToolMetadata.builder().returnDirect(toolDefinition.isReturnDirect()).build())
+                .build();
             toolDefinition.setPlanId(planId);
-            ToolCallBackContext functionToolcallbackContext = new ToolCallBackContext(functionToolcallback,
-                    toolDefinition);
+            ToolCallBackContext functionToolcallbackContext = new ToolCallBackContext(functionToolcallback, toolDefinition);
             toolCallbackMap.put(toolDefinition.getName(), functionToolcallbackContext);
         }
 
@@ -212,11 +212,11 @@ public class PavisAgent extends ReActAgent {
     @Override
     protected Message getNextStepWithEnvMessage() {
         String nextStepPrompt = """
-                
-                CURRENT STEP ENVIRONMENT STATUS:
-                {current_step_env_data}
-                
-                """;
+
+            CURRENT STEP ENVIRONMENT STATUS:
+            {current_step_env_data}
+
+            """;
         nextStepPrompt += this.agent.getNextStepPrompt();
         PromptTemplate promptTemplate = new PromptTemplate(nextStepPrompt);
         return promptTemplate.createMessage(getExecutionParam().getExecutionParamMap());

+ 1 - 2
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/ReActAgent.java

@@ -51,8 +51,7 @@ public abstract class ReActAgent extends AbstractBaseAgent {
 
         boolean shouldAct = think();
         if (!shouldAct) {
-            return new AgentExecResult("Thinking complete - no action needed",
-                    AgentState.IN_PROGRESS, null);
+            return new AgentExecResult("Thinking complete - no action needed", AgentState.IN_PROGRESS, null);
         }
         return act();
     }

+ 16 - 17
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/browser/ExecutionParam.java

@@ -29,7 +29,6 @@ public class ExecutionParam implements Serializable {
         return executionParamMap;
     }
 
-
     /**
      * 获取环境字符串信息
      *
@@ -59,22 +58,22 @@ public class ExecutionParam implements Serializable {
 
         // 构建最终的状态字符串
         String retString = String.format("""
-                        When you see [Current state starts here], focus on the following:
-                        - Current URL and page title:
-                        %s
-                        
-                        - Available tabs:
-                        %s
-                        
-                        - Interactive elements and their indices:
-                        %s
-                        
-                        - Content above%s or below%s the viewport (if indicated)
-                        
-                        - Any action results or errors:
-                        %s
-                        """, urlInfo, tabsInfo, elementsInfo != null ? elementsInfo : "", contentAbove, contentBelow,
-                envData.getError());
+            When you see [Current state starts here], focus on the following:
+            - Current URL and page title:
+            %s
+
+            - Available tabs:
+            %s
+
+            - Interactive elements and their indices:
+            %s
+
+            - Content above%s or below%s the viewport (if indicated)
+
+            - Any action results or errors:
+            %s
+            """, urlInfo, tabsInfo, elementsInfo != null ? elementsInfo : "", contentAbove, contentBelow, envData
+            .getError());
 
         return retString;
     }

+ 2 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/planner/PlanContext.java

@@ -64,7 +64,8 @@ public class PlanContext implements Serializable {
      * interactive_elements
      * screenshot
      * help:
-     * [0], [1], [2], etc., represent clickable indices corresponding to the elements listed. Clicking on these indices will navigate to or interact with the respective content behind them.
+     * [0], [1], [2], etc., represent clickable indices corresponding to the elements listed. Clicking on these indices
+     * will navigate to or interact with the respective content behind them.
      */
     private EnvData envData;
 

+ 21 - 24
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/tool/BrowserUseTool.java

@@ -38,7 +38,6 @@ public class BrowserUseTool implements ToolCallBiFunctionDef {
         return tool.getName();
     }
 
-
     @Override
     public String getDescription() {
         return tool.getDescription();
@@ -71,43 +70,41 @@ public class BrowserUseTool implements ToolCallBiFunctionDef {
         String urlInfo = String.format("\n   URL: %s\n   Title: %s", envData.get("url"), envData.get("title"));
 
         // 构建标签页信息
-        @SuppressWarnings("unchecked")
-        List<Map<String, Object>> tabs = (List<Map<String, Object>>) envData.get("tabs");
+        @SuppressWarnings("unchecked") List<Map<String, Object>> tabs = (List<Map<String, Object>>)envData.get("tabs");
         String tabsInfo = (tabs != null) ? String.format("\n   %d tab(s) available", tabs.size()) : "";
 
         // 获取滚动信息
-        @SuppressWarnings("unchecked")
-        Map<String, Object> scrollInfo = (Map<String, Object>) envData.get("scroll_info");
+        @SuppressWarnings("unchecked") Map<String, Object> scrollInfo = (Map<String, Object>)envData.get("scroll_info");
         String contentAbove = "";
         String contentBelow = "";
         if (scrollInfo != null) {
-            Long pixelsAbove = (Long) scrollInfo.get("pixels_above");
-            Long pixelsBelow = (Long) scrollInfo.get("pixels_below");
+            Long pixelsAbove = (Long)scrollInfo.get("pixels_above");
+            Long pixelsBelow = (Long)scrollInfo.get("pixels_below");
             contentAbove = pixelsAbove > 0 ? String.format(" (%d pixels)", pixelsAbove) : "";
             contentBelow = pixelsBelow > 0 ? String.format(" (%d pixels)", pixelsBelow) : "";
         }
 
         // 获取交互元素信息
-        String elementsInfo = (String) envData.get("interactive_elements");
+        String elementsInfo = (String)envData.get("interactive_elements");
 
         // 构建最终的状态字符串
         String retString = String.format("""
-                        When you see [Current state starts here], focus on the following:
-                        - Current URL and page title:
-                        %s
-                        
-                        - Available tabs:
-                        %s
-                        
-                        - Interactive elements and their indices:
-                        %s
-                        
-                        - Content above%s or below%s the viewport (if indicated)
-                        
-                        - Any action results or errors:
-                        %s
-                        """, urlInfo, tabsInfo, elementsInfo != null ? elementsInfo : "", contentAbove, contentBelow,
-                envData.containsKey("error") ? envData.get("error") : "");
+            When you see [Current state starts here], focus on the following:
+            - Current URL and page title:
+            %s
+
+            - Available tabs:
+            %s
+
+            - Interactive elements and their indices:
+            %s
+
+            - Content above%s or below%s the viewport (if indicated)
+
+            - Any action results or errors:
+            %s
+            """, urlInfo, tabsInfo, elementsInfo != null ? elementsInfo : "", contentAbove, contentBelow, envData
+            .containsKey("error") ? envData.get("error") : "");
 
         return retString;
     }

+ 18 - 13
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/tool/FunctionToolCallback.java

@@ -49,8 +49,11 @@ public class FunctionToolCallback<I, O> implements ToolCallback {
 
     private final ToolCallResultConverter toolCallResultConverter;
 
-    public FunctionToolCallback(ToolDefinition toolDefinition, @Nullable ToolMetadata toolMetadata, Type toolInputType,
-                                BiFunction<I, ToolContext, O> toolFunction, @Nullable ToolCallResultConverter toolCallResultConverter) {
+    public FunctionToolCallback(ToolDefinition toolDefinition,
+                                @Nullable ToolMetadata toolMetadata,
+                                Type toolInputType,
+                                BiFunction<I, ToolContext, O> toolFunction,
+                                @Nullable ToolCallResultConverter toolCallResultConverter) {
         Assert.notNull(toolDefinition, "toolDefinition cannot be null");
         Assert.notNull(toolInputType, "toolInputType cannot be null");
         Assert.notNull(toolFunction, "toolFunction cannot be null");
@@ -58,8 +61,9 @@ public class FunctionToolCallback<I, O> implements ToolCallback {
         this.toolMetadata = toolMetadata != null ? toolMetadata : DEFAULT_TOOL_METADATA;
         this.toolFunction = toolFunction;
         this.toolInputType = toolInputType;
-        this.toolCallResultConverter = toolCallResultConverter != null ? toolCallResultConverter
-                : DEFAULT_RESULT_CONVERTER;
+        this.toolCallResultConverter = toolCallResultConverter != null
+            ? toolCallResultConverter
+            : DEFAULT_RESULT_CONVERTER;
     }
 
     @Override
@@ -86,7 +90,7 @@ public class FunctionToolCallback<I, O> implements ToolCallback {
         // TODO, fix issue https://github.com/spring-projects/spring-ai/issues/2497
         I request;
         if (toolInputType == String.class) {
-            request = (I) toolInput;
+            request = (I)toolInput;
         } else {
             request = JsonParser.fromJson(toolInput, toolInputType);
         }
@@ -195,14 +199,15 @@ public class FunctionToolCallback<I, O> implements ToolCallback {
         public FunctionToolCallback<I, O> build() {
             Assert.notNull(inputType, "inputType cannot be null");
             var toolDefinition = ToolDefinition.builder()
-                    .name(name)
-                    .description(
-                            StringUtils.hasText(description) ? description : ToolUtils.getToolDescriptionFromName(name))
-                    .inputSchema(
-                            StringUtils.hasText(inputSchema) ? inputSchema : JsonSchemaGenerator.generateForType(inputType))
-                    .build();
-            return new FunctionToolCallback<>(toolDefinition, toolMetadata, inputType, toolFunction,
-                    toolCallResultConverter);
+                .name(name)
+                .description(StringUtils.hasText(description)
+                    ? description
+                    : ToolUtils.getToolDescriptionFromName(name))
+                .inputSchema(StringUtils.hasText(inputSchema)
+                    ? inputSchema
+                    : JsonSchemaGenerator.generateForType(inputType))
+                .build();
+            return new FunctionToolCallback<>(toolDefinition, toolMetadata, inputType, toolFunction, toolCallResultConverter);
         }
 
     }

+ 51 - 52
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/tool/PlanningTool.java

@@ -35,48 +35,48 @@ public class PlanningTool implements Function<String, ToolExecuteResult> {
     }
 
     private static final String PARAMETERS = """
-            {
-                "type": "object",
-                "properties": {
-                    "command": {
-                        "description": "create a execution plan , Available commands: create",
-                        "enum": [
-                            "create"
-                        ],
-                        "type": "string"
-                    },
-                    "plan_id": {
-                        "description": "Unique identifier for the plan",
-                        "type": "integer"
-                    },
-                    "title": {
-                        "description": "Title for the plan",
-                        "type": "string"
-                    },
-                    "steps": {
-                        "description": "List of plan steps",
-                        "type": "array",
-                        "items": {
-                            "type": "string"
-                        }
-                    },
-                    "step_index": {
-                        "description": "Index of step to update",
-                        "type": "integer"
-                    },
-                    "step_status": {
-                        "description": "Status to set for step",
-                        "enum": ["not_started", "in_progress", "completed", "blocked"],
-                        "type": "string"
-                    },
-                    "step_notes": {
-                        "description": "Additional notes for step",
+        {
+            "type": "object",
+            "properties": {
+                "command": {
+                    "description": "create a execution plan , Available commands: create",
+                    "enum": [
+                        "create"
+                    ],
+                    "type": "string"
+                },
+                "plan_id": {
+                    "description": "Unique identifier for the plan",
+                    "type": "integer"
+                },
+                "title": {
+                    "description": "Title for the plan",
+                    "type": "string"
+                },
+                "steps": {
+                    "description": "List of plan steps",
+                    "type": "array",
+                    "items": {
                         "type": "string"
                     }
                 },
-                "required": ["command"]
-            }
-            """;
+                "step_index": {
+                    "description": "Index of step to update",
+                    "type": "integer"
+                },
+                "step_status": {
+                    "description": "Status to set for step",
+                    "enum": ["not_started", "in_progress", "completed", "blocked"],
+                    "type": "string"
+                },
+                "step_notes": {
+                    "description": "Additional notes for step",
+                    "type": "string"
+                }
+            },
+            "required": ["command"]
+        }
+        """;
 
     private static final String name = "planning";
 
@@ -88,23 +88,23 @@ public class PlanningTool implements Function<String, ToolExecuteResult> {
 
     public FunctionToolCallback getFunctionToolCallback() {
         return FunctionToolCallback.builder(name, this)
-                .description(description)
-                .inputSchema(PARAMETERS)
-                .inputType(String.class)
-                .toolMetadata(ToolMetadata.builder().returnDirect(true).build())
-                .build();
+            .description(description)
+            .inputSchema(PARAMETERS)
+            .inputType(String.class)
+            .toolMetadata(ToolMetadata.builder().returnDirect(true).build())
+            .build();
     }
 
     public ToolExecuteResult run(String toolInput) {
         try {
             Map<String, Object> input = JSON.parseObject(toolInput, new TypeReference<Map<String, Object>>() {
             });
-            String command = (String) input.get("command");
-            Long planId = (Long) input.get("plan_id");
-            String title = (String) input.get("title");
-            List<String> steps = JSON.parseObject(JSON.toJSONString(input.get("steps")),
-                    new TypeReference<List<String>>() {
-                    });
+            String command = (String)input.get("command");
+            Long planId = (Long)input.get("plan_id");
+            String title = (String)input.get("title");
+            List<String> steps = JSON.parseObject(JSON.toJSONString(input
+                .get("steps")), new TypeReference<List<String>>() {
+                });
 
             return switch (command) {
                 case "create" -> createPlan(planId, title, steps);
@@ -117,8 +117,7 @@ public class PlanningTool implements Function<String, ToolExecuteResult> {
                     throw new IllegalArgumentException("Invalid command: " + command);
                 }
             };
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             log.info("执行计划工具时发生错误", e);
             return new ToolExecuteResult("Error executing planning tool: " + e.getMessage());
         }

+ 38 - 37
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/agent/tool/TerminateTool.java

@@ -9,34 +9,34 @@ import org.springframework.ai.tool.metadata.ToolMetadata;
 public class TerminateTool implements ToolCallBiFunctionDef {
 
     private static String PARAMETERS = """
-            {
-              "type" : "object",
-              "properties" : {
-                "message" : {
-                  "type" : "string",
-                  "description" : "The termination message"
-                }
-              },
-              "required" : [ "message" ]
+        {
+          "type" : "object",
+          "properties" : {
+            "message" : {
+              "type" : "string",
+              "description" : "The termination message"
             }
-            """;
+          },
+          "required" : [ "message" ]
+        }
+        """;
 
     public static final String name = "terminate";
 
     private static final String description = """
-            
-            Terminate the current execution step with a comprehensive summary message.
-            This message will be passed as the final output of the current step and should include:
-            
-            - Detailed execution results and status
-            - All relevant facts and data collected
-            - Key findings and observations
-            - Important insights and conclusions
-            - Any actionable recommendations
-            
-            The summary should be thorough enough to provide complete context for subsequent steps or other agents.
-            
-            """;
+
+        Terminate the current execution step with a comprehensive summary message.
+        This message will be passed as the final output of the current step and should include:
+
+        - Detailed execution results and status
+        - All relevant facts and data collected
+        - Key findings and observations
+        - Important insights and conclusions
+        - Any actionable recommendations
+
+        The summary should be thorough enough to provide complete context for subsequent steps or other agents.
+
+        """;
 
     public static OpenAiApi.FunctionTool getToolDefinition() {
         OpenAiApi.FunctionTool.Function function = new OpenAiApi.FunctionTool.Function(description, name, PARAMETERS);
@@ -45,11 +45,11 @@ public class TerminateTool implements ToolCallBiFunctionDef {
 
     public static FunctionToolCallback getFunctionToolCallback(Long planId) {
         return FunctionToolCallback.builder(name, new TerminateTool(planId))
-                .description(description)
-                .inputSchema(PARAMETERS)
-                .inputType(String.class)
-                .toolMetadata(ToolMetadata.builder().returnDirect(true).build())
-                .build();
+            .description(description)
+            .inputSchema(PARAMETERS)
+            .inputType(String.class)
+            .toolMetadata(ToolMetadata.builder().returnDirect(true).build())
+            .build();
     }
 
     private Long planId;
@@ -63,15 +63,16 @@ public class TerminateTool implements ToolCallBiFunctionDef {
     @Override
     public String getCurrentToolStateString() {
         return String.format("""
-                        Termination Tool Status:
-                        - Current State: %s
-                        - Last Termination: %s
-                        - Termination Message: %s
-                        - Timestamp: %s
-                        """, isTerminated ? "🛑 Terminated" : "⚡ Active",
-                isTerminated ? "Process was terminated" : "No termination recorded",
-                lastTerminationMessage.isEmpty() ? "N/A" : lastTerminationMessage,
-                terminationTimestamp.isEmpty() ? "N/A" : terminationTimestamp);
+            Termination Tool Status:
+            - Current State: %s
+            - Last Termination: %s
+            - Termination Message: %s
+            - Timestamp: %s
+            """, isTerminated ? "🛑 Terminated" : "⚡ Active", isTerminated
+            ? "Process was terminated"
+            : "No termination recorded", lastTerminationMessage.isEmpty()
+                ? "N/A"
+                : lastTerminationMessage, terminationTimestamp.isEmpty() ? "N/A" : terminationTimestamp);
     }
 
     @Override

+ 266 - 264
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/LlmService.java

@@ -17,261 +17,261 @@ import java.util.concurrent.ConcurrentHashMap;
 public class LlmService {
 
     private static final String PLANNING_SYSTEM_PROMPT = """
-            # Manus AI Assistant Capabilities
-            ## Overview
-            You are an AI assistant designed to help users with a wide range of tasks using various tools and capabilities. This document provides a more detailed overview of what you can do while respecting proprietary information boundaries.
-            
-            ## General Capabilities
-            
-            ### Information Processing
-            - Answering questions on diverse topics using available information
-            - Conducting research through web searches and data analysis
-            - Fact-checking and information verification from multiple sources
-            - Summarizing complex information into digestible formats
-            - Processing and analyzing structured and unstructured data
-            
-            ### Content Creation
-            - Writing articles, reports, and documentation
-            - Drafting emails, messages, and other communications
-            -Creating and editing code in various programming languages
-            Generating creative content like stories or descriptions
-            - Formatting documents according to specific requirements
-            
-            ### Problem Solving
-            - Breaking down complex problems into manageable steps
-            - Providing step-by-step solutions to technical challenges
-            - Troubleshooting errors in code or processes
-            - Suggesting alternative approaches when initial attempts fail
-            - Adapting to changing requirements during task execution
-            
-            ### Tools and Interfaces
-            - Navigating to websites and web applications
-            - Reading and extracting content from web pages
-            - Interacting with web elements (clicking, scrolling, form filling)
-            - Executing JavaScript in browser console for enhanced functionality
-            - Monitoring web page changes and updates
-            - Taking screenshots of web content when needed
-            
-            ### File System Operations
-            - Reading from and writing to files in various formats
-            - Searching for files based on names, patterns, or content
-            -Creating and organizing directory structures
-            -Compressing and archiving files (zip, tar)
-            - Analyzing file contents and extracting relevant information
-            - Converting between different file formats
-            
-            ### Shell and Command Line
-            - Executing shell commands in a Linux environment
-            Installing and configuring software packages
-            - Running scripts in various languages
-            - Managing processes (starting, monitoring, terminating)
-            - Automating repetitive tasks through shell scripts
-            Accessing and manipulating system resources
-            
-            ### Communication Tools
-            - Sending informative messages to users
-            - Asking questions to clarify requirements
-            - Providing progress updates during long-running tasks
-            - Attaching files and resources to messages
-            - Suggesting next steps or additional actions
-            
-            ### Deployment Capabilities
-            - Exposing local ports for temporary access to services
-            - Deploying static websites to public URLs
-            - Deploying web applications with server-side functionality
-            - Providing access links to deployed resources
-            - Monitoring deployed applications
-            
-            ## Programming Languages and Technologies
-            
-            ### Languages I Can work with
-            - JavaScript/TypeScript
-            - Python
-            - HTML /CSS
-            - Shell scripting (Bash)
-            - SQL
-            - PHP
-            - Ruby
-            - Java
-            - C/C++
-            - Go
-            - And many others
-            
-            ### Frameworks and Libraries
-            - React, Vue, Angular for frontend development
-            - Node. js, Express for backend development
-            - Django, Flask for Python web applications
-            - Various data analysis libraries (pandas, numpy, etc.)
-            - Testing frameworks across different languages
-            - Database interfaces and ORMs
-            
-            ## Task Approach Methodology
-            
-            ### Understanding Requirements
-            - Analyzing user requests to identify core needs
-            - Asking clarifying questions when requirements are ambiguous
-            - Breaking down complex requests into manageable components
-            - Identifying potential challenges before beginning work
-            
-            ### Planning and Execution
-            - Creating structured plans for task completion
-            - Selecting appropriate tools and approaches for each step
-            - Executing steps methodically while monitoring progress
-            - Adapting plans when encountering unexpected challenges
-            - Providing regular updates on task status
-            
-            ### Quality Assurance
-            - Verifying results against original requirements
-            - Testing code and solutions before delivery
-            - Documenting processes and solutions for future reference
-            - Seeking feedback to improve outcomes
-            
-            # HoW I Can Help You
-            
-            I'm designed to assist with a wide range of tasks, from simple information retrieval to complex problem-solving. I can help with research, writing, coding, data analysis, and many other tasks that can be accomplished using computers and the internet.
-            If you have a specific task in mind, I can break it down into steps and work through it methodically, keeping you informed of progress along the way. I'm continuously learning and improving, so I welcome feedback on how I can better assist you.
-            
-            # Effective Prompting Guide
-            
-            ## Introduction to Prompting
-            This document provides guidance on creating effective prompts when working with AI assistants. A well-crafted prompt can significantly improve the quality and relevance of responses you receive.
-            
-            ## Key Elements of Effective Prompts
-            
-            ### Be specific and Clear
-            - State your request explicitly
-            - Include relevant context and background information
-            - Specify the format you want for the response
-            - Mention any constraints or requirements
-            
-            ### Provide Context
-            - Explain why you need the information
-            - Share relevant background knowledge
-            - Mention previous attempts if applicable
-            - Describe your level of familiarity with the topic
-            
-            ### Structure Your Request
-            - Break complex requests into smaller parts
-            - Use numbered lists for multi-part questions
-            - Prioritize information if asking for multiple things
-            - Consider using headers or sections for organization
-            
-            ### Specify Output Format
-            - Indicate preferred response length (brief vs. detailed)
-            - Request specific formats (bullet points, paragraphs, tables)
-            - Mention if you need code examples, citations, or other special elements Specify tone and style if relevant (formal, conversational, technical)
-            
-            ## Example Prompts
-            
-            ### Poor Prompt:
-            "Tell me about machine learning.
-            
-            ### Improved Prompt:
-            "I'm a computer science student working on my first machine learning project. Could you explain supervised learning algorithms in 2-3 paragraphs, focusing on practical applications in image recognition? Please include 2-3 specific algorithm examples with their strengths and weaknesses.
-            
-            ### Poor Prompt:
-            "Write code for a website.
-            
-            ### Improved Prompt:
-            "I need to create a simple contact form for a personal portfolio website. Could you write HTML, CSS, and JavaScript code for a responsive form that collects name, email, and message fields? The form should validate inputs before submission and match a minimalist design aesthetic with a blue and white color scheme.
-            
-            # Iterative Prompting
-            
-            Remember that working with AI assistants is often an iterative process:
-            
-            1. Start with an initial prompt
-            2. Review the response
-            3. Refine your prompt based on what was helpful or missing
-            4. Continue the conversation to explore the topic further
-            
-            # When Prompting for code
-            
-            When requesting code examples, consider including:
-            
-            - Programming language and version
-            - Libraries or frameworks you're using
-            - Error messages if troubleshooting
-            - Sample input/output examples
-            - Performance considerations
-            - Compatibility requirements
-            
-            # Conclusion
-            
-            Effective prompting is a skill that develops with practice. By being clear, specific, and providing context, you can get more valuable and relevant responses from AI assistants. Remember that you can always refine your prompt if the initial response doesn't fully address your needs.
-            
-            # About Manus AI Assistant
-            
-            ## Introduction
-            I am Manus, an AI assistant designed to help users with a wide variety of tasks. I'm built to be helpful, informative, and versatile in addressing different needs and challenges.
-            ## My Purpose
-            My primary purpose is to assist users in accomplishing their goals by providing information, executing tasks, and offering guidance. I aim to be a reliable partner in problem-solving and task completion.
-            ## How I Approach Tasks
-            When presented with a task, I typically:
-            1. Analyze the request to understand what's being asked
-            2. Break down complex problems into manageable steps
-            3. Use appropriate tools and methods to address each step
-            4. Provide clear communication throughout the process
-            5. Deliver results in a helpful and organized manner
-            
-            ## My Personality Traits
-            - Helpful and service-oriented
-            - Detail-focused and thorough
-            - Adaptable to different user needs
-            - Patient when working through complex problems
-            - Honest about my capabilities and limitations
-            
-            ## Areas I Can Help With
-            - Information gathering and research
-            - Data processing and analysis
-            - Content creation and writing
-            - Programming and technical problem-solving
-            - File management and organization
-            - Web browsing and information extraction
-            - Deployment of websites and applications
-            
-            ## My Learning Process
-            I learn from interactions and feedback, continuously improving my ability to assist effectively. Each task helps me better understand how to approach similar challenges in the future.
-            
-            ## Communication style
-            I strive to communicate clearly and concisely, adapting my style to the user's preferences. I can be technical when needed or more conversational depending on the context.
-            
-            ## Values I Uphold
-            - Accuracy and reliability in information
-            - Respect for user privacy and data
-            Ethical use of technology
-            Transparency about my capabilities
-            Continuous improvement
-            
-            ## working Together
-            The most effective collaborations happen when:
-            - Tasks and expectations are clearly defined
-            - Feedback is provided to help me adjust my approach
-            - Complex requests are broken down into specific components
-            - We build on successful interactions to tackle increasingly complex challenges
-            """;
+        # Manus AI Assistant Capabilities
+        ## Overview
+        You are an AI assistant designed to help users with a wide range of tasks using various tools and capabilities. This document provides a more detailed overview of what you can do while respecting proprietary information boundaries.
+
+        ## General Capabilities
+
+        ### Information Processing
+        - Answering questions on diverse topics using available information
+        - Conducting research through web searches and data analysis
+        - Fact-checking and information verification from multiple sources
+        - Summarizing complex information into digestible formats
+        - Processing and analyzing structured and unstructured data
+
+        ### Content Creation
+        - Writing articles, reports, and documentation
+        - Drafting emails, messages, and other communications
+        -Creating and editing code in various programming languages
+        Generating creative content like stories or descriptions
+        - Formatting documents according to specific requirements
+
+        ### Problem Solving
+        - Breaking down complex problems into manageable steps
+        - Providing step-by-step solutions to technical challenges
+        - Troubleshooting errors in code or processes
+        - Suggesting alternative approaches when initial attempts fail
+        - Adapting to changing requirements during task execution
+
+        ### Tools and Interfaces
+        - Navigating to websites and web applications
+        - Reading and extracting content from web pages
+        - Interacting with web elements (clicking, scrolling, form filling)
+        - Executing JavaScript in browser console for enhanced functionality
+        - Monitoring web page changes and updates
+        - Taking screenshots of web content when needed
+
+        ### File System Operations
+        - Reading from and writing to files in various formats
+        - Searching for files based on names, patterns, or content
+        -Creating and organizing directory structures
+        -Compressing and archiving files (zip, tar)
+        - Analyzing file contents and extracting relevant information
+        - Converting between different file formats
+
+        ### Shell and Command Line
+        - Executing shell commands in a Linux environment
+        Installing and configuring software packages
+        - Running scripts in various languages
+        - Managing processes (starting, monitoring, terminating)
+        - Automating repetitive tasks through shell scripts
+        Accessing and manipulating system resources
+
+        ### Communication Tools
+        - Sending informative messages to users
+        - Asking questions to clarify requirements
+        - Providing progress updates during long-running tasks
+        - Attaching files and resources to messages
+        - Suggesting next steps or additional actions
+
+        ### Deployment Capabilities
+        - Exposing local ports for temporary access to services
+        - Deploying static websites to public URLs
+        - Deploying web applications with server-side functionality
+        - Providing access links to deployed resources
+        - Monitoring deployed applications
+
+        ## Programming Languages and Technologies
+
+        ### Languages I Can work with
+        - JavaScript/TypeScript
+        - Python
+        - HTML /CSS
+        - Shell scripting (Bash)
+        - SQL
+        - PHP
+        - Ruby
+        - Java
+        - C/C++
+        - Go
+        - And many others
+
+        ### Frameworks and Libraries
+        - React, Vue, Angular for frontend development
+        - Node. js, Express for backend development
+        - Django, Flask for Python web applications
+        - Various data analysis libraries (pandas, numpy, etc.)
+        - Testing frameworks across different languages
+        - Database interfaces and ORMs
+
+        ## Task Approach Methodology
+
+        ### Understanding Requirements
+        - Analyzing user requests to identify core needs
+        - Asking clarifying questions when requirements are ambiguous
+        - Breaking down complex requests into manageable components
+        - Identifying potential challenges before beginning work
+
+        ### Planning and Execution
+        - Creating structured plans for task completion
+        - Selecting appropriate tools and approaches for each step
+        - Executing steps methodically while monitoring progress
+        - Adapting plans when encountering unexpected challenges
+        - Providing regular updates on task status
+
+        ### Quality Assurance
+        - Verifying results against original requirements
+        - Testing code and solutions before delivery
+        - Documenting processes and solutions for future reference
+        - Seeking feedback to improve outcomes
+
+        # HoW I Can Help You
+
+        I'm designed to assist with a wide range of tasks, from simple information retrieval to complex problem-solving. I can help with research, writing, coding, data analysis, and many other tasks that can be accomplished using computers and the internet.
+        If you have a specific task in mind, I can break it down into steps and work through it methodically, keeping you informed of progress along the way. I'm continuously learning and improving, so I welcome feedback on how I can better assist you.
+
+        # Effective Prompting Guide
+
+        ## Introduction to Prompting
+        This document provides guidance on creating effective prompts when working with AI assistants. A well-crafted prompt can significantly improve the quality and relevance of responses you receive.
+
+        ## Key Elements of Effective Prompts
+
+        ### Be specific and Clear
+        - State your request explicitly
+        - Include relevant context and background information
+        - Specify the format you want for the response
+        - Mention any constraints or requirements
+
+        ### Provide Context
+        - Explain why you need the information
+        - Share relevant background knowledge
+        - Mention previous attempts if applicable
+        - Describe your level of familiarity with the topic
+
+        ### Structure Your Request
+        - Break complex requests into smaller parts
+        - Use numbered lists for multi-part questions
+        - Prioritize information if asking for multiple things
+        - Consider using headers or sections for organization
+
+        ### Specify Output Format
+        - Indicate preferred response length (brief vs. detailed)
+        - Request specific formats (bullet points, paragraphs, tables)
+        - Mention if you need code examples, citations, or other special elements Specify tone and style if relevant (formal, conversational, technical)
+
+        ## Example Prompts
+
+        ### Poor Prompt:
+        "Tell me about machine learning.
+
+        ### Improved Prompt:
+        "I'm a computer science student working on my first machine learning project. Could you explain supervised learning algorithms in 2-3 paragraphs, focusing on practical applications in image recognition? Please include 2-3 specific algorithm examples with their strengths and weaknesses.
+
+        ### Poor Prompt:
+        "Write code for a website.
+
+        ### Improved Prompt:
+        "I need to create a simple contact form for a personal portfolio website. Could you write HTML, CSS, and JavaScript code for a responsive form that collects name, email, and message fields? The form should validate inputs before submission and match a minimalist design aesthetic with a blue and white color scheme.
+
+        # Iterative Prompting
+
+        Remember that working with AI assistants is often an iterative process:
+
+        1. Start with an initial prompt
+        2. Review the response
+        3. Refine your prompt based on what was helpful or missing
+        4. Continue the conversation to explore the topic further
+
+        # When Prompting for code
+
+        When requesting code examples, consider including:
+
+        - Programming language and version
+        - Libraries or frameworks you're using
+        - Error messages if troubleshooting
+        - Sample input/output examples
+        - Performance considerations
+        - Compatibility requirements
+
+        # Conclusion
+
+        Effective prompting is a skill that develops with practice. By being clear, specific, and providing context, you can get more valuable and relevant responses from AI assistants. Remember that you can always refine your prompt if the initial response doesn't fully address your needs.
+
+        # About Manus AI Assistant
+
+        ## Introduction
+        I am Manus, an AI assistant designed to help users with a wide variety of tasks. I'm built to be helpful, informative, and versatile in addressing different needs and challenges.
+        ## My Purpose
+        My primary purpose is to assist users in accomplishing their goals by providing information, executing tasks, and offering guidance. I aim to be a reliable partner in problem-solving and task completion.
+        ## How I Approach Tasks
+        When presented with a task, I typically:
+        1. Analyze the request to understand what's being asked
+        2. Break down complex problems into manageable steps
+        3. Use appropriate tools and methods to address each step
+        4. Provide clear communication throughout the process
+        5. Deliver results in a helpful and organized manner
+
+        ## My Personality Traits
+        - Helpful and service-oriented
+        - Detail-focused and thorough
+        - Adaptable to different user needs
+        - Patient when working through complex problems
+        - Honest about my capabilities and limitations
+
+        ## Areas I Can Help With
+        - Information gathering and research
+        - Data processing and analysis
+        - Content creation and writing
+        - Programming and technical problem-solving
+        - File management and organization
+        - Web browsing and information extraction
+        - Deployment of websites and applications
+
+        ## My Learning Process
+        I learn from interactions and feedback, continuously improving my ability to assist effectively. Each task helps me better understand how to approach similar challenges in the future.
+
+        ## Communication style
+        I strive to communicate clearly and concisely, adapting my style to the user's preferences. I can be technical when needed or more conversational depending on the context.
+
+        ## Values I Uphold
+        - Accuracy and reliability in information
+        - Respect for user privacy and data
+        Ethical use of technology
+        Transparency about my capabilities
+        Continuous improvement
+
+        ## working Together
+        The most effective collaborations happen when:
+        - Tasks and expectations are clearly defined
+        - Feedback is provided to help me adjust my approach
+        - Complex requests are broken down into specific components
+        - We build on successful interactions to tackle increasingly complex challenges
+        """;
 
     private static final String FINALIZE_SYSTEM_PROMPT = "You are a planning assistant. Your task is to summarize the completed plan.";
 
     private static final String MANUS_SYSTEM_PROMPT = """
-            You are OpenManus, an all-capable AI assistant, aimed at solving any task presented by the user. You have various tools at your disposal that you can call upon to efficiently complete complex requests. Whether it's programming, information retrieval, file processing, or web browsing, you can handle it all.
-            
-            You can interact with the computer using PythonExecute, save important content and information files through FileSaver, open browsers with BrowserUseTool, and retrieve information using GoogleSearch.
-            
-            PythonExecute: Execute Python code to interact with the computer system, data processing, automation tasks, etc.
-            
-            FileSaver: Save files locally, such as txt, py, html, etc.
-            
-            BrowserUseTool: Open, browse, and use web browsers.If you open a local HTML file, you must provide the absolute path to the file.
-            
-            Terminate : Record  the result summary of the task , then terminate the task.
-            
-            DocLoader: List all the files in a directory or get the content of a local file at a specified path. Use this tool when you want to get some related information at a directory or file asked by the user.
-            
-            Based on user needs, proactively select the most appropriate tool or combination of tools. For complex tasks, you can break down the problem and use different tools step by step to solve it. After using each tool, clearly explain the execution results and suggest the next steps.
-            
-            When you are done with the task, you can finalize the plan by summarizing the steps taken and the output of each step, call Terminate tool to record the result.
-            
-            """;
+        You are OpenManus, an all-capable AI assistant, aimed at solving any task presented by the user. You have various tools at your disposal that you can call upon to efficiently complete complex requests. Whether it's programming, information retrieval, file processing, or web browsing, you can handle it all.
+
+        You can interact with the computer using PythonExecute, save important content and information files through FileSaver, open browsers with BrowserUseTool, and retrieve information using GoogleSearch.
+
+        PythonExecute: Execute Python code to interact with the computer system, data processing, automation tasks, etc.
+
+        FileSaver: Save files locally, such as txt, py, html, etc.
+
+        BrowserUseTool: Open, browse, and use web browsers.If you open a local HTML file, you must provide the absolute path to the file.
+
+        Terminate : Record  the result summary of the task , then terminate the task.
+
+        DocLoader: List all the files in a directory or get the content of a local file at a specified path. Use this tool when you want to get some related information at a directory or file asked by the user.
+
+        Based on user needs, proactively select the most appropriate tool or combination of tools. For complex tasks, you can break down the problem and use different tools step by step to solve it. After using each tool, clearly explain the execution results and suggest the next steps.
+
+        When you are done with the task, you can finalize the plan by summarizing the steps taken and the output of each step, call Terminate tool to record the result.
+
+        """;
 
     private static final Logger log = LoggerFactory.getLogger(LlmService.class);
 
@@ -295,11 +295,11 @@ public class LlmService {
         this.chatModel = chatModel;
         // 执行和总结规划,用相同的memory
         this.planningChatClient = ChatClient.builder(chatModel)
-                .defaultSystem(PLANNING_SYSTEM_PROMPT)
-                .defaultAdvisors(new MessageChatMemoryAdvisor(planningMemory))
-                .defaultAdvisors(new SimpleLoggerAdvisor())
-                .defaultOptions(OpenAiChatOptions.builder().temperature(0.1).build())
-                .build();
+            .defaultSystem(PLANNING_SYSTEM_PROMPT)
+            .defaultAdvisors(new MessageChatMemoryAdvisor(planningMemory))
+            .defaultAdvisors(new SimpleLoggerAdvisor())
+            .defaultOptions(OpenAiChatOptions.builder().temperature(0.1).build())
+            .build();
 
         // // 每个agent执行过程中,用独立的memroy
         // this.chatClient = ChatClient.builder(chatModel)
@@ -309,9 +309,9 @@ public class LlmService {
         // .build();
 
         this.finalizeChatClient = ChatClient.builder(chatModel)
-                .defaultAdvisors(new MessageChatMemoryAdvisor(planningMemory))
-                .defaultAdvisors(new SimpleLoggerAdvisor())
-                .build();
+            .defaultAdvisors(new MessageChatMemoryAdvisor(planningMemory))
+            .defaultAdvisors(new SimpleLoggerAdvisor())
+            .build();
 
     }
 
@@ -340,11 +340,13 @@ public class LlmService {
         return agentClients.computeIfAbsent(planId, k -> {
             ChatMemory agentMemory = new InMemoryChatMemory();
             ChatClient agentChatClient = ChatClient.builder(chatModel)
-                    .defaultAdvisors(new MessageChatMemoryAdvisor(agentMemory))
-                    .defaultAdvisors(new SimpleLoggerAdvisor())
-                    .defaultOptions(
-                            OpenAiChatOptions.builder().internalToolExecutionEnabled(false).temperature(0.1).build())
-                    .build();
+                .defaultAdvisors(new MessageChatMemoryAdvisor(agentMemory))
+                .defaultAdvisors(new SimpleLoggerAdvisor())
+                .defaultOptions(OpenAiChatOptions.builder()
+                    .internalToolExecutionEnabled(false)
+                    .temperature(0.1)
+                    .build())
+                .build();
             return new AgentChatClientWrapper(agentChatClient, agentMemory);
         });
     }

+ 1 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/exception/AuthException.java

@@ -5,7 +5,7 @@
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *     https://www.gnu.org/licenses/agpl-3.0.html
+ * https://www.gnu.org/licenses/agpl-3.0.html
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,

+ 1 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/exception/ServiceException.java

@@ -5,7 +5,7 @@
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *     https://www.gnu.org/licenses/agpl-3.0.html
+ * https://www.gnu.org/licenses/agpl-3.0.html
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/EmbeddingProvider.java

@@ -1,6 +1,5 @@
 package com.pavis.admin.aigc.core.llm.provider;
 
-import com.pavis.admin.aigc.model.entity.KnowledgeDO;
 import com.pavis.admin.aigc.model.resp.KnowledgeResp;
 import dev.langchain4j.data.document.DocumentSplitter;
 import dev.langchain4j.data.document.splitter.DocumentSplitters;

+ 26 - 29
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/EmbeddingStoreFactory.java

@@ -2,13 +2,11 @@ package com.pavis.admin.aigc.core.llm.provider;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.pavis.admin.aigc.enums.EmbedStoreEnum;
 import com.pavis.admin.aigc.mapper.EmbedStoreMapper;
 import com.pavis.admin.aigc.model.entity.EmbedStoreDO;
-import com.pavis.admin.aigc.model.query.EmbedStoreQuery;
 import com.pavis.admin.aigc.model.resp.EmbedStoreResp;
 import com.pavis.admin.aigc.service.EmbedStoreService;
 import dev.langchain4j.community.store.embedding.redis.RedisEmbeddingStore;
@@ -21,7 +19,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
-import top.continew.starter.extension.crud.model.query.SortQuery;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -55,7 +52,7 @@ public class EmbeddingStoreFactory {
         list.forEach(embed -> {
             JSONObject endpoints = JSONObject.parseObject(embed.getEndpoints());
             embed.setHost(endpoints.get("host").toString());
-            embed.setPort((Integer) endpoints.get("port"));
+            embed.setPort((Integer)endpoints.get("port"));
             JSONObject databaseConfig = JSONObject.parseObject(embed.getDatabaseConfig());
             embed.setDatabaseName(databaseConfig.get("database").toString());
             embed.setTableName(databaseConfig.get("table").toString());
@@ -63,14 +60,14 @@ public class EmbeddingStoreFactory {
             embed.setUsername(authConfig.get("username").toString());
             embed.setPassword(authConfig.get("password").toString());
             JSONObject vectorConfig = JSONObject.parseObject(embed.getVectorConfig());
-            embed.setDimension((Integer) vectorConfig.get("dimension"));
+            embed.setDimension((Integer)vectorConfig.get("dimension"));
             try {
                 if (EmbedStoreEnum.REDIS.name().equalsIgnoreCase(embed.getProvider())) {
                     RedisEmbeddingStore.Builder builder = RedisEmbeddingStore.builder()
-                            .host(embed.getHost())
-                            .port(embed.getPort())
-                            .indexName(embed.getDatabaseName())
-                            .dimension(embed.getDimension());
+                        .host(embed.getHost())
+                        .port(embed.getPort())
+                        .indexName(embed.getDatabaseName())
+                        .dimension(embed.getDimension());
                     if (StrUtil.isNotBlank(embed.getUsername()) && StrUtil.isNotBlank(embed.getPassword())) {
                         builder.user(embed.getUsername()).password(embed.getPassword());
                     }
@@ -79,30 +76,30 @@ public class EmbeddingStoreFactory {
                 }
                 if (EmbedStoreEnum.PGVECTOR.name().equalsIgnoreCase(embed.getProvider())) {
                     EmbeddingStore<TextSegment> store = PgVectorEmbeddingStore.builder()
-                            .host(embed.getHost())
-                            .port(embed.getPort())
-                            .database(embed.getDatabaseName())
-                            .dimension(embed.getDimension())
-                            .user(embed.getUsername())
-                            .password(embed.getPassword())
-                            .table(embed.getTableName())
-                            .indexListSize(1)
-                            .useIndex(true)
-                            .createTable(true)
-                            .dropTableFirst(false)
-                            .build();
+                        .host(embed.getHost())
+                        .port(embed.getPort())
+                        .database(embed.getDatabaseName())
+                        .dimension(embed.getDimension())
+                        .user(embed.getUsername())
+                        .password(embed.getPassword())
+                        .table(embed.getTableName())
+                        .indexListSize(1)
+                        .useIndex(true)
+                        .createTable(true)
+                        .dropTableFirst(false)
+                        .build();
                     embedStoreMap.put(embed.getId().toString(), store);
                 }
                 if (EmbedStoreEnum.MILVUS.name().equalsIgnoreCase(embed.getProvider())) {
                     EmbeddingStore<TextSegment> store = MilvusEmbeddingStore.builder()
-                            .host(embed.getHost())
-                            .port(embed.getPort())
-                            .databaseName(embed.getDatabaseName())
-                            .dimension(embed.getDimension())
-                            .username(embed.getUsername())
-                            .password(embed.getPassword())
-                            .collectionName(embed.getTableName())
-                            .build();
+                        .host(embed.getHost())
+                        .port(embed.getPort())
+                        .databaseName(embed.getDatabaseName())
+                        .dimension(embed.getDimension())
+                        .username(embed.getUsername())
+                        .password(embed.getPassword())
+                        .collectionName(embed.getTableName())
+                        .build();
                     embedStoreMap.put(embed.getId().toString(), store);
                 }
                 modelStore.add(embed);

+ 8 - 11
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/KnowledgeStoreFactory.java

@@ -1,11 +1,5 @@
 package com.pavis.admin.aigc.core.llm.provider;
 
-import com.pavis.admin.aigc.model.entity.EmbedStoreDO;
-import com.pavis.admin.aigc.model.entity.KnowledgeDO;
-import com.pavis.admin.aigc.model.entity.ModelDO;
-import com.pavis.admin.aigc.model.query.EmbedStoreQuery;
-import com.pavis.admin.aigc.model.query.KnowledgeQuery;
-import com.pavis.admin.aigc.model.query.ModelQuery;
 import com.pavis.admin.aigc.model.resp.EmbedStoreResp;
 import com.pavis.admin.aigc.model.resp.KnowledgeResp;
 import com.pavis.admin.aigc.model.resp.ModelResp;
@@ -17,7 +11,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
-import top.continew.starter.extension.crud.model.query.SortQuery;
 
 import java.util.List;
 import java.util.Map;
@@ -46,8 +39,12 @@ public class KnowledgeStoreFactory {
     public void init() {
         knowledgeMap.clear();
         List<KnowledgeResp> list = knowledgeService.selectKnowledge();
-        Map<Long, List<ModelResp>> modelMap = modelService.selModelAndSecrt().stream().collect(Collectors.groupingBy(ModelResp::getId));
-        Map<Long, List<EmbedStoreResp>> storeMap = embedStoreService.selEmbedStore().stream().collect(Collectors.groupingBy(EmbedStoreResp::getId));
+        Map<Long, List<ModelResp>> modelMap = modelService.selModelAndSecrt()
+            .stream()
+            .collect(Collectors.groupingBy(ModelResp::getId));
+        Map<Long, List<EmbedStoreResp>> storeMap = embedStoreService.selEmbedStore()
+            .stream()
+            .collect(Collectors.groupingBy(EmbedStoreResp::getId));
         list.forEach(know -> {
             if (know.getEmbedModelId() != null) {
                 List<ModelResp> models = modelMap.get(know.getEmbedModelId());
@@ -62,10 +59,10 @@ public class KnowledgeStoreFactory {
     }
 
     public KnowledgeResp getKnowledge(Long knowledgeId) {
-        return knowledgeMap.get(knowledgeId);
+        return knowledgeMap.get(knowledgeId.toString());
     }
 
     public boolean containsKnowledge(Long knowledgeId) {
-        return knowledgeMap.containsKey(knowledgeId);
+        return knowledgeMap.containsKey(knowledgeId.toString());
     }
 }

+ 1 - 2
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/ModelProvider.java

@@ -5,7 +5,7 @@
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *     https://www.gnu.org/licenses/agpl-3.0.html
+ * https://www.gnu.org/licenses/agpl-3.0.html
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,7 +21,6 @@ import dev.langchain4j.model.chat.ChatLanguageModel;
 import dev.langchain4j.model.chat.StreamingChatLanguageModel;
 import dev.langchain4j.model.image.ImageModel;
 import lombok.AllArgsConstructor;
-import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Component;
 
 /**

+ 2 - 9
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/ModelStoreFactory.java

@@ -1,14 +1,10 @@
 package com.pavis.admin.aigc.core.llm.provider;
 
-import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.pavis.admin.aigc.constant.ModelConst;
 import com.pavis.admin.aigc.core.llm.provider.build.ModelBuildHandler;
 import com.pavis.admin.aigc.enums.ModelTypeEnum;
 import com.pavis.admin.aigc.mapper.ModelMapper;
-import com.pavis.admin.aigc.model.entity.ModelDO;
-import com.pavis.admin.aigc.model.query.ModelQuery;
 import com.pavis.admin.aigc.model.resp.ModelResp;
 import com.pavis.admin.aigc.service.ModelService;
 import dev.langchain4j.model.chat.ChatLanguageModel;
@@ -17,12 +13,9 @@ import dev.langchain4j.model.embedding.EmbeddingModel;
 import dev.langchain4j.model.image.ImageModel;
 import jakarta.annotation.PostConstruct;
 import jakarta.annotation.Resource;
-import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.Async;
-import top.continew.starter.extension.crud.model.query.SortQuery;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -61,8 +54,8 @@ public class ModelStoreFactory {
         embeddingModelMap.clear();
         imageModelMap.clear();
 
-        List<ModelDO> modelDOS = modelMapper.selectList(new QueryWrapper<>());
-        List<ModelResp> list = BeanUtil.copyToList(modelDOS, ModelResp.class);
+        List<ModelResp> list = modelMapper.selModelAndSecret();
+        // List<ModelResp> list = BeanUtil.copyToList(modelDOS, ModelResp.class);
         // List<ModelResp> list = aigcModelService.list(new ModelQuery(),new SortQuery());
         list.forEach(model -> {
             if (Objects.equals(model.getBaseUrl(), "")) {

+ 27 - 30
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/build/OllamaModelBuildHandler.java

@@ -33,8 +33,8 @@ public class OllamaModelBuildHandler implements ModelBuildHandler {
     @Override
     public boolean basicCheck(ModelResp model) {
         if (StringUtils.isBlank(model.getBaseUrl())) {
-            throw new ServiceException(ChatErrorEnum.BASE_URL_IS_NULL.getErrorCode(),
-                    ChatErrorEnum.BASE_URL_IS_NULL.getErrorDesc(ProviderEnum.OLLAMA.name(), model.getType()));
+            throw new ServiceException(ChatErrorEnum.BASE_URL_IS_NULL.getErrorCode(), ChatErrorEnum.BASE_URL_IS_NULL
+                .getErrorDesc(ProviderEnum.OLLAMA.name(), model.getType()));
         }
         return true;
     }
@@ -48,16 +48,15 @@ public class OllamaModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return (StreamingChatLanguageModel) OllamaStreamingChatModel
-                    .builder()
-                    .baseUrl(model.getBaseUrl())
-                    .modelName(model.getModel())
-                    .temperature(model.getTemperature())
-                    .topP(model.getTopP())
-                    .logRequests(true)
-                    .logResponses(true)
-                    .timeout(Duration.ofMinutes(10))
-                    .build();
+            return (StreamingChatLanguageModel)OllamaStreamingChatModel.builder()
+                .baseUrl(model.getBaseUrl())
+                .modelName(model.getModel())
+                .temperature(model.getTemperature())
+                .topP(model.getTopP())
+                .logRequests(true)
+                .logResponses(true)
+                .timeout(Duration.ofMinutes(10))
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -76,16 +75,15 @@ public class OllamaModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return (ChatLanguageModel) OllamaChatModel
-                    .builder()
-                    .baseUrl(model.getBaseUrl())
-                    .modelName(model.getModel())
-                    .temperature(model.getTemperature())
-                    .topP(model.getTopP())
-                    .logRequests(true)
-                    .logResponses(true)
-                    .timeout(Duration.ofMinutes(10))
-                    .build();
+            return (ChatLanguageModel)OllamaChatModel.builder()
+                .baseUrl(model.getBaseUrl())
+                .modelName(model.getModel())
+                .temperature(model.getTemperature())
+                .topP(model.getTopP())
+                .logRequests(true)
+                .logResponses(true)
+                .timeout(Duration.ofMinutes(10))
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -104,14 +102,13 @@ public class OllamaModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return OllamaEmbeddingModel
-                    .builder()
-                    .baseUrl(model.getBaseUrl())
-                    .modelName(model.getModel())
-                    .logRequests(true)
-                    .logResponses(true)
-                    .timeout(Duration.ofMinutes(10))
-                    .build();
+            return OllamaEmbeddingModel.builder()
+                .baseUrl(model.getBaseUrl())
+                .modelName(model.getModel())
+                .logRequests(true)
+                .logResponses(true)
+                .timeout(Duration.ofMinutes(10))
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;

+ 50 - 61
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/build/OpenAIModelBuildHandler.java

@@ -1,5 +1,4 @@
 
-
 package com.pavis.admin.aigc.core.llm.provider.build;
 
 import cn.hutool.core.util.StrUtil;
@@ -38,24 +37,19 @@ public class OpenAIModelBuildHandler implements ModelBuildHandler {
     @Override
     public boolean whetherCurrentModel(ModelResp model) {
         String provider = model.getProvider();
-        return ProviderEnum.OPENAI.name().equals(provider) ||
-                ProviderEnum.GEMINI.name().equals(provider) ||
-                ProviderEnum.CLAUDE.name().equals(provider) ||
-                ProviderEnum.AZURE_OPENAI.name().equals(provider) ||
-                ProviderEnum.DOUYIN.name().equals(provider) ||
-                ProviderEnum.YI.name().equals(provider) ||
-                ProviderEnum.SILICON.name().equals(provider) ||
-                ProviderEnum.DEEPSEEK.name().equals(provider) ||
-                ProviderEnum.SPARK.name().equals(provider)
-                ;
+        return ProviderEnum.OPENAI.name().equals(provider) || ProviderEnum.GEMINI.name()
+            .equals(provider) || ProviderEnum.CLAUDE.name().equals(provider) || ProviderEnum.AZURE_OPENAI.name()
+                .equals(provider) || ProviderEnum.DOUYIN.name().equals(provider) || ProviderEnum.YI.name()
+                    .equals(provider) || ProviderEnum.SILICON.name().equals(provider) || ProviderEnum.DEEPSEEK.name()
+                        .equals(provider) || ProviderEnum.SPARK.name().equals(provider);
     }
 
     @Override
     public boolean basicCheck(ModelResp model) {
         String apiKey = model.getApiKey();
         if (StrUtil.isBlank(apiKey)) {
-            throw new ServiceException(ChatErrorEnum.API_KEY_IS_NULL.getErrorCode(),
-                    ChatErrorEnum.API_KEY_IS_NULL.getErrorDesc(model.getProvider().toUpperCase(), model.getType()));
+            throw new ServiceException(ChatErrorEnum.API_KEY_IS_NULL.getErrorCode(), ChatErrorEnum.API_KEY_IS_NULL
+                .getErrorDesc(model.getProvider().toUpperCase(), model.getType()));
         }
         return true;
     }
@@ -69,18 +63,17 @@ public class OpenAIModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return OpenAiStreamingChatModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .baseUrl(model.getBaseUrl())
-                    .modelName(model.getModel())
-                    .maxTokens(model.getResponseLimit())
-                    .temperature(model.getTemperature())
-                    .logRequests(true)
-                    .logResponses(true)
-                    .topP(model.getTopP())
-                    .timeout(Duration.ofMinutes(10))
-                    .build();
+            return OpenAiStreamingChatModel.builder()
+                .apiKey(model.getApiKey())
+                .baseUrl(model.getBaseUrl())
+                .modelName(model.getModel())
+                .maxTokens(model.getResponseLimit())
+                .temperature(model.getTemperature())
+                .logRequests(true)
+                .logResponses(true)
+                .topP(model.getTopP())
+                .timeout(Duration.ofMinutes(10))
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -99,18 +92,17 @@ public class OpenAIModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return OpenAiChatModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .baseUrl(model.getBaseUrl())
-                    .modelName(model.getModel())
-                    .maxTokens(model.getResponseLimit())
-                    .temperature(model.getTemperature())
-                    .logRequests(true)
-                    .logResponses(true)
-                    .topP(model.getTopP())
-                    .timeout(Duration.ofMinutes(10))
-                    .build();
+            return OpenAiChatModel.builder()
+                .apiKey(model.getApiKey())
+                .baseUrl(model.getBaseUrl())
+                .modelName(model.getModel())
+                .maxTokens(model.getResponseLimit())
+                .temperature(model.getTemperature())
+                .logRequests(true)
+                .logResponses(true)
+                .topP(model.getTopP())
+                .timeout(Duration.ofMinutes(10))
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -129,17 +121,16 @@ public class OpenAIModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            OpenAiEmbeddingModel openAiEmbeddingModel = OpenAiEmbeddingModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .baseUrl(model.getBaseUrl())
-                    .modelName(model.getModel())
-                    .dimensions(model.getDimension())
-                    .logRequests(true)
-                    .logResponses(true)
-                    .dimensions(1024)
-                    .timeout(Duration.ofMinutes(10))
-                    .build();
+            OpenAiEmbeddingModel openAiEmbeddingModel = OpenAiEmbeddingModel.builder()
+                .apiKey(model.getApiKey())
+                .baseUrl(model.getBaseUrl())
+                .modelName(model.getModel())
+                .dimensions(model.getDimension())
+                .logRequests(true)
+                .logResponses(true)
+                .dimensions(1024)
+                .timeout(Duration.ofMinutes(10))
+                .build();
             return openAiEmbeddingModel;
         } catch (ServiceException e) {
             log.error(e.getMessage());
@@ -159,18 +150,17 @@ public class OpenAIModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return OpenAiImageModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .baseUrl(model.getBaseUrl())
-                    .modelName(model.getModel())
-                    .size(model.getImageSize())
-                    .quality(model.getImageQuality())
-                    .style(model.getImageStyle())
-                    .logRequests(true)
-                    .logResponses(true)
-                    .timeout(Duration.ofMinutes(10))
-                    .build();
+            return OpenAiImageModel.builder()
+                .apiKey(model.getApiKey())
+                .baseUrl(model.getBaseUrl())
+                .modelName(model.getModel())
+                .size(model.getImageSize())
+                .quality(model.getImageQuality())
+                .style(model.getImageStyle())
+                .logRequests(true)
+                .logResponses(true)
+                .timeout(Duration.ofMinutes(10))
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -179,6 +169,5 @@ public class OpenAIModelBuildHandler implements ModelBuildHandler {
             return null;
         }
 
-
     }
 }

+ 31 - 35
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/build/QFanModelBuildHandler.java

@@ -31,12 +31,12 @@ public class QFanModelBuildHandler implements ModelBuildHandler {
     @Override
     public boolean basicCheck(ModelResp model) {
         if (StringUtils.isBlank(model.getApiKey())) {
-            throw new ServiceException(ChatErrorEnum.API_KEY_IS_NULL.getErrorCode(),
-                    ChatErrorEnum.API_KEY_IS_NULL.getErrorDesc(ProviderEnum.Q_FAN.name(), model.getType()));
+            throw new ServiceException(ChatErrorEnum.API_KEY_IS_NULL.getErrorCode(), ChatErrorEnum.API_KEY_IS_NULL
+                .getErrorDesc(ProviderEnum.Q_FAN.name(), model.getType()));
         }
         if (StringUtils.isBlank(model.getSecretKey())) {
-            throw new ServiceException(ChatErrorEnum.SECRET_KEY_IS_NULL.getErrorCode(),
-                    ChatErrorEnum.SECRET_KEY_IS_NULL.getErrorDesc(ProviderEnum.Q_FAN.name(), model.getType()));
+            throw new ServiceException(ChatErrorEnum.SECRET_KEY_IS_NULL.getErrorCode(), ChatErrorEnum.SECRET_KEY_IS_NULL
+                .getErrorDesc(ProviderEnum.Q_FAN.name(), model.getType()));
         }
         return true;
     }
@@ -50,17 +50,16 @@ public class QFanModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return (StreamingChatLanguageModel) QianfanStreamingChatModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .secretKey(model.getSecretKey())
-                    .modelName(model.getModel())
-                    .baseUrl(model.getBaseUrl())
-                    .temperature(model.getTemperature())
-                    .topP(model.getTopP())
-                    .logRequests(true)
-                    .logResponses(true)
-                    .build();
+            return (StreamingChatLanguageModel)QianfanStreamingChatModel.builder()
+                .apiKey(model.getApiKey())
+                .secretKey(model.getSecretKey())
+                .modelName(model.getModel())
+                .baseUrl(model.getBaseUrl())
+                .temperature(model.getTemperature())
+                .topP(model.getTopP())
+                .logRequests(true)
+                .logResponses(true)
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -79,17 +78,16 @@ public class QFanModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return (ChatLanguageModel) QianfanChatModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .secretKey(model.getSecretKey())
-                    .modelName(model.getModel())
-                    .baseUrl(model.getBaseUrl())
-                    .temperature(model.getTemperature())
-                    .topP(model.getTopP())
-                    .logRequests(true)
-                    .logResponses(true)
-                    .build();
+            return (ChatLanguageModel)QianfanChatModel.builder()
+                .apiKey(model.getApiKey())
+                .secretKey(model.getSecretKey())
+                .modelName(model.getModel())
+                .baseUrl(model.getBaseUrl())
+                .temperature(model.getTemperature())
+                .topP(model.getTopP())
+                .logRequests(true)
+                .logResponses(true)
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -98,7 +96,6 @@ public class QFanModelBuildHandler implements ModelBuildHandler {
             return null;
         }
 
-
     }
 
     @Override
@@ -110,14 +107,13 @@ public class QFanModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return QianfanEmbeddingModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .modelName(model.getModel())
-                    .secretKey(model.getSecretKey())
-                    .logRequests(true)
-                    .logResponses(true)
-                    .build();
+            return QianfanEmbeddingModel.builder()
+                .apiKey(model.getApiKey())
+                .modelName(model.getModel())
+                .secretKey(model.getSecretKey())
+                .logRequests(true)
+                .logResponses(true)
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;

+ 20 - 26
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/build/QWenModelBuildHandler.java

@@ -31,8 +31,8 @@ public class QWenModelBuildHandler implements ModelBuildHandler {
     @Override
     public boolean basicCheck(ModelResp model) {
         if (StringUtils.isBlank(model.getApiKey())) {
-            throw new ServiceException(ChatErrorEnum.API_KEY_IS_NULL.getErrorCode(),
-                    ChatErrorEnum.API_KEY_IS_NULL.getErrorDesc(ProviderEnum.Q_WEN.name(), model.getType()));
+            throw new ServiceException(ChatErrorEnum.API_KEY_IS_NULL.getErrorCode(), ChatErrorEnum.API_KEY_IS_NULL
+                .getErrorDesc(ProviderEnum.Q_WEN.name(), model.getType()));
         }
         return true;
     }
@@ -46,15 +46,14 @@ public class QWenModelBuildHandler implements ModelBuildHandler {
             return null;
         }
         try {
-            return (StreamingChatLanguageModel) QwenStreamingChatModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .modelName(model.getModel())
-                    .baseUrl(model.getBaseUrl())
-                    .maxTokens(model.getResponseLimit())
-                    .temperature(Float.parseFloat(model.getTemperature().toString()))
-                    .topP(model.getTopP())
-                    .build();
+            return (StreamingChatLanguageModel)QwenStreamingChatModel.builder()
+                .apiKey(model.getApiKey())
+                .modelName(model.getModel())
+                .baseUrl(model.getBaseUrl())
+                .maxTokens(model.getResponseLimit())
+                .temperature(Float.parseFloat(model.getTemperature().toString()))
+                .topP(model.getTopP())
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -73,16 +72,15 @@ public class QWenModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return (ChatLanguageModel) QwenChatModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .modelName(model.getModel())
-                    .baseUrl(model.getBaseUrl())
-                    .enableSearch(true)
-                    .maxTokens(model.getResponseLimit())
-                    .temperature(Float.parseFloat(model.getTemperature().toString()))
-                    .topP(model.getTopP())
-                    .build();
+            return (ChatLanguageModel)QwenChatModel.builder()
+                .apiKey(model.getApiKey())
+                .modelName(model.getModel())
+                .baseUrl(model.getBaseUrl())
+                .enableSearch(true)
+                .maxTokens(model.getResponseLimit())
+                .temperature(Float.parseFloat(model.getTemperature().toString()))
+                .topP(model.getTopP())
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -101,11 +99,7 @@ public class QWenModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return QwenEmbeddingModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .modelName(model.getModel())
-                    .build();
+            return QwenEmbeddingModel.builder().apiKey(model.getApiKey()).modelName(model.getModel()).build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;

+ 53 - 57
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/provider/build/ZhipuModelBuildHandler.java

@@ -38,8 +38,8 @@ public class ZhipuModelBuildHandler implements ModelBuildHandler {
     @Override
     public boolean basicCheck(ModelResp model) {
         if (StringUtils.isBlank(model.getApiKey())) {
-            throw new ServiceException(ChatErrorEnum.API_KEY_IS_NULL.getErrorCode(),
-                    ChatErrorEnum.API_KEY_IS_NULL.getErrorDesc(ProviderEnum.ZHIPU.name(), model.getType()));
+            throw new ServiceException(ChatErrorEnum.API_KEY_IS_NULL.getErrorCode(), ChatErrorEnum.API_KEY_IS_NULL
+                .getErrorDesc(ProviderEnum.ZHIPU.name(), model.getType()));
         }
         return true;
     }
@@ -53,21 +53,20 @@ public class ZhipuModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return (StreamingChatLanguageModel) ZhipuAiStreamingChatModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .baseUrl(model.getBaseUrl())
-                    .model(model.getModel())
-                    .maxToken(model.getResponseLimit())
-                    .temperature(model.getTemperature())
-                    .topP(model.getTopP())
-                    .logRequests(true)
-                    .logResponses(true)
-                    // .callTimeout(Duration.ofMinutes(10))
-                    .connectTimeout(Duration.ofMinutes(10))
-                    // .writeTimeout(Duration.ofMinutes(10))
-                    .readTimeout(Duration.ofMinutes(10))
-                    .build();
+            return (StreamingChatLanguageModel)ZhipuAiStreamingChatModel.builder()
+                .apiKey(model.getApiKey())
+                .baseUrl(model.getBaseUrl())
+                .model(model.getModel())
+                .maxToken(model.getResponseLimit())
+                .temperature(model.getTemperature())
+                .topP(model.getTopP())
+                .logRequests(true)
+                .logResponses(true)
+                // .callTimeout(Duration.ofMinutes(10))
+                .connectTimeout(Duration.ofMinutes(10))
+                // .writeTimeout(Duration.ofMinutes(10))
+                .readTimeout(Duration.ofMinutes(10))
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -87,21 +86,20 @@ public class ZhipuModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return (ChatLanguageModel) ZhipuAiChatModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .baseUrl(model.getBaseUrl())
-                    .model(model.getModel())
-                    .maxToken(model.getResponseLimit())
-                    .temperature(model.getTemperature())
-                    .topP(model.getTopP())
-                    .logRequests(true)
-                    .logResponses(true)
-                    // .callTimeout(Duration.ofMinutes(10))
-                    .connectTimeout(Duration.ofMinutes(10))
-                    // .writeTimeout(Duration.ofMinutes(10))
-                    .readTimeout(Duration.ofMinutes(10))
-                    .build();
+            return (ChatLanguageModel)ZhipuAiChatModel.builder()
+                .apiKey(model.getApiKey())
+                .baseUrl(model.getBaseUrl())
+                .model(model.getModel())
+                .maxToken(model.getResponseLimit())
+                .temperature(model.getTemperature())
+                .topP(model.getTopP())
+                .logRequests(true)
+                .logResponses(true)
+                // .callTimeout(Duration.ofMinutes(10))
+                .connectTimeout(Duration.ofMinutes(10))
+                // .writeTimeout(Duration.ofMinutes(10))
+                .readTimeout(Duration.ofMinutes(10))
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -121,19 +119,18 @@ public class ZhipuModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return ZhipuAiEmbeddingModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .model(model.getModel())
-                    .baseUrl(model.getBaseUrl())
-                    .logRequests(true)
-                    .logResponses(true)
-                    // .callTimeout(Duration.ofMinutes(10))
-                    .connectTimeout(Duration.ofMinutes(10))
-                    // .writeTimeout(Duration.ofMinutes(10))
-                    .readTimeout(Duration.ofMinutes(10))
-                    .dimensions(1024)
-                    .build();
+            return ZhipuAiEmbeddingModel.builder()
+                .apiKey(model.getApiKey())
+                .model(model.getModel())
+                .baseUrl(model.getBaseUrl())
+                .logRequests(true)
+                .logResponses(true)
+                // .callTimeout(Duration.ofMinutes(10))
+                .connectTimeout(Duration.ofMinutes(10))
+                // .writeTimeout(Duration.ofMinutes(10))
+                .readTimeout(Duration.ofMinutes(10))
+                .dimensions(1024)
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;
@@ -152,18 +149,17 @@ public class ZhipuModelBuildHandler implements ModelBuildHandler {
             if (!basicCheck(model)) {
                 return null;
             }
-            return ZhipuAiImageModel
-                    .builder()
-                    .apiKey(model.getApiKey())
-                    .model(model.getModel())
-                    .baseUrl(model.getBaseUrl())
-                    .logRequests(true)
-                    .logResponses(true)
-                    // .callTimeout(Duration.ofMinutes(10))
-                    .connectTimeout(Duration.ofMinutes(10))
-                    // .writeTimeout(Duration.ofMinutes(10))
-                    .readTimeout(Duration.ofMinutes(10))
-                    .build();
+            return ZhipuAiImageModel.builder()
+                .apiKey(model.getApiKey())
+                .model(model.getModel())
+                .baseUrl(model.getBaseUrl())
+                .logRequests(true)
+                .logResponses(true)
+                // .callTimeout(Duration.ofMinutes(10))
+                .connectTimeout(Duration.ofMinutes(10))
+                // .writeTimeout(Duration.ofMinutes(10))
+                .readTimeout(Duration.ofMinutes(10))
+                .build();
         } catch (ServiceException e) {
             log.error(e.getMessage());
             throw e;

+ 1 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/service/Agent.java

@@ -5,7 +5,7 @@
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *     https://www.gnu.org/licenses/agpl-3.0.html
+ * https://www.gnu.org/licenses/agpl-3.0.html
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,

+ 1 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/llm/service/impl/PersistentChatMemoryStore.java

@@ -5,7 +5,7 @@
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- *     https://www.gnu.org/licenses/agpl-3.0.html
+ * https://www.gnu.org/licenses/agpl-3.0.html
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,

+ 73 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/task/AnalysisThreadPool.java

@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.pavis.admin.aigc.core.task;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingDeque;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author GB
+ * @since 2024-08-22
+ */
+public class AnalysisThreadPool {
+    /**
+     * 根据cpu 数量动态配置核心线程数和最大线程数
+     */
+    private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors();
+    /**
+     * 核心线程数
+     */
+    private static final int CORE_PO0L_SIZE = CPU_COUNT + 1;
+    /**
+     * 最大线程数
+     */
+    private static final int MAX_POOL_SIZE = 2 * CPU_COUNT + 1;
+    /**
+     * 线程队列
+     */
+    private static final int MAX_LIMIT_JOB_SIZE = 1000;
+    /**
+     * 非核心线程存活时间1s
+     */
+    private static final int KEEP_ALIVE = 1;
+    volatile private static ThreadPoolExecutor EXECUTOR = null;
+
+    public static ThreadPoolExecutor getThreadPool() {
+        if (null == EXECUTOR) {
+            synchronized (AnalysisThreadPool.class) {
+                if (null == EXECUTOR) {
+                    EXECUTOR = new ThreadPoolExecutor(CORE_PO0L_SIZE, MAX_POOL_SIZE, KEEP_ALIVE, TimeUnit.MICROSECONDS, new LinkedBlockingDeque<>(MAX_LIMIT_JOB_SIZE), Executors
+                        .defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy() {
+                            @Override
+                            public void rejectedExecution(Runnable r, ThreadPoolExecutor e) {
+                                super.rejectedExecution(r, e);
+                            }
+                        });
+                }
+            }
+        }
+        return EXECUTOR;
+    }
+
+    public static void execute(Runnable runable) {
+        getThreadPool().execute(runable);
+
+    }
+
+}

+ 57 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/core/task/TaskManager.java

@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
+ *
+ * Licensed under the GNU Affero General Public License, Version 3 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.pavis.admin.aigc.core.task;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Future;
+
+/**
+ * @author GB
+ * @since 2024-08-22
+ */
+public class TaskManager {
+    private static final ConcurrentHashMap<String, List<Future<?>>> TASK_MAP = new ConcurrentHashMap<>();
+
+    /**
+     * 提交任务
+     */
+    public static void submitTask(String id, Callable<?> function) {
+        Future<?> future = AnalysisThreadPool.getThreadPool().submit(function);
+        List<Future<?>> orDefault = TASK_MAP.getOrDefault(id, new ArrayList<>());
+        orDefault.add(future);
+        TASK_MAP.put(id, orDefault);
+    }
+
+    /**
+     * 弹出任务
+     */
+    public void popTaskResult(String id) {
+        TASK_MAP.remove(id);
+    }
+
+    public int getCount(String id) {
+        if (TASK_MAP.containsKey(id)) {
+            Collection<?> collection = TASK_MAP.get(id);
+            return collection != null ? collection.size() : 0;
+        }
+        return 0;
+    }
+}

+ 1 - 4
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/AgentState.java

@@ -5,10 +5,7 @@ package com.pavis.admin.aigc.enums;
  */
 public enum AgentState {
 
-    NOT_STARTED("not_started"),
-    IN_PROGRESS("in_progress"),
-    COMPLETED("completed"),
-    BLOCKED("blocked"),
+    NOT_STARTED("not_started"), IN_PROGRESS("in_progress"), COMPLETED("completed"), BLOCKED("blocked"),
     FAILED("failed");
 
     private final String state;

+ 2 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/ChatErrorEnum.java

@@ -2,13 +2,10 @@ package com.pavis.admin.aigc.enums;
 
 import lombok.AllArgsConstructor;
 
-
 @AllArgsConstructor
 public enum ChatErrorEnum {
-    API_KEY_IS_NULL(1000, "模型 %s %s api key 为空,请检查配置"),
-    BASE_URL_IS_NULL(1003, "模型 %s %s base url 为空,请检查配置"),
-    SECRET_KEY_IS_NULL(1005, "模型 %s %s base secret Key 为空,请检查配置"),
-    ;
+    API_KEY_IS_NULL(1000, "模型 %s %s api key 为空,请检查配置"), BASE_URL_IS_NULL(1003, "模型 %s %s base url 为空,请检查配置"),
+    SECRET_KEY_IS_NULL(1005, "模型 %s %s base secret Key 为空,请检查配置"),;
 
     /**
      * 错误码

+ 1 - 4
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/EmbedStoreEnum.java

@@ -5,8 +5,5 @@ import lombok.Getter;
 @Getter
 public enum EmbedStoreEnum {
 
-    REDIS,
-    PGVECTOR,
-    MILVUS,
-    ;
+    REDIS, PGVECTOR, MILVUS,;
 }

+ 1 - 4
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/ModelTypeEnum.java

@@ -5,8 +5,5 @@ import lombok.Getter;
 @Getter
 public enum ModelTypeEnum {
 
-    CHAT,
-    EMBEDDING,
-    TEXT_IMAGE,
-    WEB_SEARCH;
+    CHAT, EMBEDDING, TEXT_IMAGE, WEB_SEARCH;
 }

+ 1 - 14
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/ProviderEnum.java

@@ -5,19 +5,6 @@ import lombok.Getter;
 @Getter
 public enum ProviderEnum {
 
-    OPENAI,
-    AZURE_OPENAI,
-    GEMINI,
-    OLLAMA,
-    CLAUDE,
-    Q_FAN,
-    Q_WEN,
-    ZHIPU,
-    YI,
-    DOUYIN,
-    DEEPSEEK,
-    SILICON,
-    SPARK,
-    ;
+    OPENAI, AZURE_OPENAI, GEMINI, OLLAMA, CLAUDE, Q_FAN, Q_WEN, ZHIPU, YI, DOUYIN, DEEPSEEK, SILICON, SPARK,;
 
 }

+ 1 - 4
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/enums/RoleEnum.java

@@ -4,10 +4,7 @@ import lombok.Getter;
 
 @Getter
 public enum RoleEnum {
-    USER("user"),
-    ASSISTANT("assistant"),
-    SYSTEM("system"),
-    ;
+    USER("user"), ASSISTANT("assistant"), SYSTEM("system"),;
 
     private final String name;
 

+ 5 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AgentKnowledgeMapper.java

@@ -4,9 +4,9 @@ import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.AgentKnowledgeDO;
 
 /**
-* 智能体和知识库关联 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * 智能体和知识库关联 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface AgentKnowledgeMapper extends BaseMapper<AgentKnowledgeDO> {}

+ 5 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AgentMapper.java

@@ -8,11 +8,11 @@ import com.pavis.admin.aigc.model.entity.AgentDO;
 import java.util.List;
 
 /**
-* 智能体 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * 智能体 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface AgentMapper extends BaseMapper<AgentDO> {
 
     AgentResp selectByCode(@Param("code") String code);

+ 5 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AgentPlanMapper.java

@@ -4,9 +4,9 @@ import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.AgentPlanDO;
 
 /**
-* 智能体规划记录 Mapper
-*
-* @author semi
-* @since 2025/05/28 16:59
-*/
+ * 智能体规划记录 Mapper
+ *
+ * @author semi
+ * @since 2025/05/28 16:59
+ */
 public interface AgentPlanMapper extends BaseMapper<AgentPlanDO> {}

+ 5 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AigcAppMapper.java

@@ -4,9 +4,9 @@ import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.AigcAppDO;
 
 /**
-* AIGC应用配置 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * AIGC应用配置 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface AigcAppMapper extends BaseMapper<AigcAppDO> {}

+ 5 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AigcMessageFeedbackMapper.java

@@ -4,9 +4,9 @@ import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.AigcMessageFeedbackDO;
 
 /**
-* 消息反馈 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * 消息反馈 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface AigcMessageFeedbackMapper extends BaseMapper<AigcMessageFeedbackDO> {}

+ 5 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AigcMessageMapper.java

@@ -4,9 +4,9 @@ import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.AigcMessageDO;
 
 /**
-* 智能对话消息 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * 智能对话消息 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface AigcMessageMapper extends BaseMapper<AigcMessageDO> {}

+ 5 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AppApiMapper.java

@@ -4,9 +4,9 @@ import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.AppApiDO;
 
 /**
-* 应用API密钥 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * 应用API密钥 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface AppApiMapper extends BaseMapper<AppApiDO> {}

+ 6 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/AppKnowledgeMapper.java

@@ -8,14 +8,15 @@ import com.pavis.admin.aigc.model.entity.AppKnowledgeDO;
 import java.util.List;
 
 /**
-* 应用和知识库关联 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * 应用和知识库关联 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface AppKnowledgeMapper extends BaseMapper<AppKnowledgeDO> {
     /**
      * 根据appId查询knowledgeIds集合
+     * 
      * @param id app主键id
      * @return 用户信息
      */

+ 5 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/ConversationMapper.java

@@ -4,9 +4,9 @@ import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.ConversationDO;
 
 /**
-* 智能对话会话 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * 智能对话会话 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface ConversationMapper extends BaseMapper<ConversationDO> {}

+ 5 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/DocChunkMapper.java

@@ -4,9 +4,9 @@ import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.DocChunkDO;
 
 /**
-* 文档切片 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * 文档切片 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface DocChunkMapper extends BaseMapper<DocChunkDO> {}

+ 5 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/DocMapper.java

@@ -4,9 +4,9 @@ import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.DocDO;
 
 /**
-* 智能文档 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * 智能文档 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface DocMapper extends BaseMapper<DocDO> {}

+ 5 - 6
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/EmbedStoreMapper.java

@@ -1,7 +1,6 @@
 package com.pavis.admin.aigc.mapper;
 
 import com.pavis.admin.aigc.model.resp.EmbedStoreResp;
-import com.pavis.admin.aigc.model.resp.ModelResp;
 import org.apache.ibatis.annotations.Select;
 import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.EmbedStoreDO;
@@ -9,11 +8,11 @@ import com.pavis.admin.aigc.model.entity.EmbedStoreDO;
 import java.util.List;
 
 /**
-* 向量存储配置 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * 向量存储配置 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface EmbedStoreMapper extends BaseMapper<EmbedStoreDO> {
     @Select("SELECT * FROM aigc_embed_store")
     List<EmbedStoreResp> selEmbedStore();

+ 5 - 6
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/KnowledgeMapper.java

@@ -1,7 +1,6 @@
 package com.pavis.admin.aigc.mapper;
 
 import com.pavis.admin.aigc.model.resp.KnowledgeResp;
-import com.pavis.admin.aigc.model.resp.ModelResp;
 import org.apache.ibatis.annotations.Select;
 import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.KnowledgeDO;
@@ -9,11 +8,11 @@ import com.pavis.admin.aigc.model.entity.KnowledgeDO;
 import java.util.List;
 
 /**
-* AIGC知识库 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * AIGC知识库 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface KnowledgeMapper extends BaseMapper<KnowledgeDO> {
     @Select("SELECT * FROM aigc_knowledge")
     List<KnowledgeResp> selectKnowledge();

+ 7 - 16
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/ModelMapper.java

@@ -9,32 +9,23 @@ import com.pavis.admin.aigc.model.entity.ModelDO;
 import java.util.List;
 
 /**
-* AIGC模型配置 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * AIGC模型配置 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface ModelMapper extends BaseMapper<ModelDO> {
     /**
      * 获取模型
+     * 
      * @return 列表
      */
     @Select("SELECT * FROM aigc_model")
     List<ModelResp> selectByModel();
 
-
     @Select("SELECT * from aigc_model am left join aigc_model_secret ams on am.id = ams.model_id")
     List<ModelResp> selModelAndSecret();
 
-    @Select("<script>"
-            + "SELECT * FROM aigc_model am LEFT JOIN aigc_model_secret ams ON am.id = ams.model_id "
-            + "WHERE 1=1 "
-            + "<if test='type != null'>"
-            + "  AND am.type=#{type}"
-            + "</if>"
-            + "<if test='provider != null'>"
-            + "  AND am.provider=#{provider}"
-            + "</if>"
-            + "</script>")
+    @Select("<script>" + "SELECT * FROM aigc_model am LEFT JOIN aigc_model_secret ams ON am.id = ams.model_id " + "WHERE 1=1 " + "<if test='type != null'>" + "  AND am.type=#{type}" + "</if>" + "<if test='provider != null'>" + "  AND am.provider=#{provider}" + "</if>" + "</script>")
     List<ModelResp> selModelAndSecretList(@Param("type") String type, @Param("provider") String provider);
 }

+ 5 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/mapper/ModelSecretMapper.java

@@ -4,9 +4,9 @@ import top.continew.starter.data.mp.base.BaseMapper;
 import com.pavis.admin.aigc.model.entity.ModelSecretDO;
 
 /**
-* 模型安全配置 Mapper
-*
-* @author semi
-* @since 2025/05/26 17:28
-*/
+ * 模型安全配置 Mapper
+ *
+ * @author semi
+ * @since 2025/05/26 17:28
+ */
 public interface ModelSecretMapper extends BaseMapper<ModelSecretDO> {}

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AgentDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 
 /**

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AgentKnowledgeDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 import java.math.BigDecimal;
 

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AgentPlanDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 import java.time.*;
 

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AigcAppDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 import java.math.BigDecimal;
 

+ 1 - 2
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AigcMessageDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 
 /**
@@ -85,7 +84,7 @@ public class AigcMessageDO extends BaseDO {
     /**
      * token 消耗
      */
-    private String usage;
+    private String usageToken;
 
     /**
      * 状态:0删除 1正常 2标记

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AigcMessageFeedbackDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 
 /**

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AppApiDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 import java.time.*;
 

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/AppKnowledgeDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 import java.math.BigDecimal;
 

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/ConversationDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 import java.time.*;
 

+ 6 - 2
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/DocChunkDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 import java.math.BigDecimal;
 
@@ -26,7 +25,7 @@ public class DocChunkDO extends BaseDO {
     /**
      * 向量库的ID
      */
-    private Long embedStoreId;
+    private String embedStoreId;
 
     /**
      * 文档ID
@@ -72,4 +71,9 @@ public class DocChunkDO extends BaseDO {
      * 相关性分数
      */
     private BigDecimal relevanceScore;
+
+    /**
+     * 文档名称
+     */
+    private String name;
 }

+ 17 - 13
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/DocDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 
 /**
@@ -79,11 +78,11 @@ public class DocDO extends BaseDO {
 
     /**
      * 元数据 {
-                                                                      "author": "张三",
-                                                                      "pages": 42,
-                                                                      "language": "zh",
-                                                                      "created_time": "2023-01-01"
-                                                                    }
+     * "author": "张三",
+     * "pages": 42,
+     * "language": "zh",
+     * "created_time": "2023-01-01"
+     * }
      */
     private String metadata;
 
@@ -94,18 +93,18 @@ public class DocDO extends BaseDO {
 
     /**
      * 切片配置 {
-                                                                      "strategy":"auto",
-                                                                      "chunk_size":1000,
-                                                                      "overlap":50
-                                                                    }
+     * "strategy":"auto",
+     * "chunk_size":1000,
+     * "overlap":50
+     * }
      */
     private String chunkConfig;
 
     /**
      * 切片详情 [
-                                                                      {"id":1,"content":"...","vectors":32},
-                                                                      {"id":2,"content":"...","vectors":28}
-                                                                    ]
+     * {"id":1,"content":"...","vectors":32},
+     * {"id":2,"content":"...","vectors":28}
+     * ]
      */
     private String chunkDetails;
 
@@ -133,4 +132,9 @@ public class DocDO extends BaseDO {
      * 文档版本
      */
     private Integer version;
+
+    /**
+     * 切片数量
+     */
+    private Integer sliceNum;
 }

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/EmbedStoreDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 import java.time.*;
 

+ 9 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/KnowledgeDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 import java.time.*;
 import java.math.BigDecimal;
@@ -86,10 +85,10 @@ public class KnowledgeDO extends BaseDO {
 
     /**
      * 存储参数 {
-                                                                     "bucket":"aigc-kb",
-                                                                     "region":"ap-northeast-1",
-                                                                     "prefix":"/knowledge/"
-                                                                   }
+     * "bucket":"aigc-kb",
+     * "region":"ap-northeast-1",
+     * "prefix":"/knowledge/"
+     * }
      */
     private String storageConfig;
 
@@ -107,4 +106,9 @@ public class KnowledgeDO extends BaseDO {
      * 平均检索相关度
      */
     private BigDecimal avgRelevance;
+
+    /**
+     * 知识库描述
+     */
+    private String knowDescribe;
 }

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/ModelDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 
 /**

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/ModelSecretDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 
 /**

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/entity/ToolDO.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.pavis.admin.common.model.entity.BaseDO;
 
-
 import java.io.Serial;
 
 /**

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/AgentKnowledgeQuery.java

@@ -9,7 +9,6 @@ import top.continew.starter.data.core.enums.QueryType;
 import java.io.Serial;
 import java.io.Serializable;
 import java.time.*;
-import java.math.BigDecimal;
 
 /**
  * 智能体和知识库关联查询条件

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/AgentPlanQuery.java

@@ -58,7 +58,6 @@ public class AgentPlanQuery implements Serializable {
     @Query(type = QueryType.EQ)
     private String thinkInput;
 
-
     /**
      * 规划思考过程内容输出
      */

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/AppKnowledgeQuery.java

@@ -9,7 +9,6 @@ import top.continew.starter.data.core.enums.QueryType;
 import java.io.Serial;
 import java.io.Serializable;
 import java.time.*;
-import java.math.BigDecimal;
 
 /**
  * 应用和知识库关联查询条件

+ 7 - 3
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/DocChunkQuery.java

@@ -9,7 +9,6 @@ import top.continew.starter.data.core.enums.QueryType;
 import java.io.Serial;
 import java.io.Serializable;
 import java.time.*;
-import java.math.BigDecimal;
 
 /**
  * 文档切片查询条件
@@ -29,7 +28,7 @@ public class DocChunkQuery implements Serializable {
      */
     @Schema(description = "向量库的ID")
     @Query(type = QueryType.EQ)
-    private Long embedStoreId;
+    private String embedStoreId;
 
     /**
      * 文档ID
@@ -38,6 +37,11 @@ public class DocChunkQuery implements Serializable {
     @Query(type = QueryType.EQ)
     private Long docId;
 
+    /**
+     * 文档名称
+     */
+    private String name;
+
     /**
      * 知识库ID
      */
@@ -56,7 +60,7 @@ public class DocChunkQuery implements Serializable {
      * 切片内容
      */
     @Schema(description = "切片内容")
-    @Query(type = QueryType.EQ)
+    @Query(type = QueryType.LIKE)
     private String content;
 
     /**

+ 1 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/DocQuery.java

@@ -34,7 +34,7 @@ public class DocQuery implements Serializable {
      * 文档名称
      */
     @Schema(description = "文档名称")
-    @Query(type = QueryType.EQ)
+    @Query(type = QueryType.LIKE)
     private String name;
 
     /**

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/query/KnowledgeQuery.java

@@ -9,7 +9,6 @@ import top.continew.starter.data.core.enums.QueryType;
 import java.io.Serial;
 import java.io.Serializable;
 import java.time.*;
-import java.math.BigDecimal;
 
 /**
  * AIGC知识库查询条件

+ 0 - 2
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/AgentKnowledgeReq.java

@@ -6,11 +6,9 @@ import lombok.Data;
 
 import io.swagger.v3.oas.annotations.media.Schema;
 
-import org.hibernate.validator.constraints.Length;
 import java.io.Serial;
 import java.io.Serializable;
 import java.time.*;
-import java.math.BigDecimal;
 
 /**
  * 智能体和知识库关联创建或修改参数

+ 13 - 13
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/AigcMessageReq.java

@@ -64,19 +64,19 @@ public class AigcMessageReq implements Serializable {
     @NotNull(message = "调用模型ID不能为空")
     private Long modelId;
 
-    /**
-     * 创建人
-     */
-    @Schema(description = "创建人")
-    @NotNull(message = "创建人不能为空")
-    private Long createUser;
-
-    /**
-     * 创建时间
-     */
-    @Schema(description = "创建时间")
-    @NotNull(message = "创建时间不能为空")
-    private LocalDateTime createTime;
+    // /**
+    //  * 创建人
+    //  */
+    // @Schema(description = "创建人")
+    // @NotNull(message = "创建人不能为空")
+    // private Long createUser;
+    //
+    // /**
+    //  * 创建时间
+    //  */
+    // @Schema(description = "创建时间")
+    // @NotNull(message = "创建时间不能为空")
+    // private LocalDateTime createTime;
 
     private StreamEmitter emitter;
 

+ 0 - 2
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/AppKnowledgeReq.java

@@ -6,11 +6,9 @@ import lombok.Data;
 
 import io.swagger.v3.oas.annotations.media.Schema;
 
-import org.hibernate.validator.constraints.Length;
 import java.io.Serial;
 import java.io.Serializable;
 import java.time.*;
-import java.math.BigDecimal;
 
 /**
  * 应用和知识库关联创建或修改参数

+ 18 - 18
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/ConversationReq.java

@@ -28,28 +28,28 @@ public class ConversationReq implements Serializable {
      * 所属用户ID
      */
     @Schema(description = "所属用户ID")
-    @NotNull(message = "所属用户ID不能为空")
+    // @NotNull(message = "所属用户ID不能为空")
     private Long userId;
 
     /**
      * 关联应用ID
      */
     @Schema(description = "关联应用ID")
-    @NotNull(message = "关联应用ID不能为空")
+    // @NotNull(message = "关联应用ID不能为空")
     private Long appId;
 
     /**
      * 使用模型ID
      */
     @Schema(description = "使用模型ID")
-    @NotNull(message = "使用模型ID不能为空")
+    // @NotNull(message = "使用模型ID不能为空")
     private Long modelId;
 
     /**
      * 对话标题
      */
     @Schema(description = "对话标题")
-    @NotBlank(message = "对话标题不能为空")
+    // @NotBlank(message = "对话标题不能为空")
     @Length(max = 200, message = "对话标题长度不能超过 {max} 个字符")
     private String title;
 
@@ -57,20 +57,20 @@ public class ConversationReq implements Serializable {
      * 最后活动时间
      */
     @Schema(description = "最后活动时间")
-    @NotNull(message = "最后活动时间不能为空")
+    // @NotNull(message = "最后活动时间不能为空")
     private LocalDateTime lastActive;
 
-    /**
-     * 创建人
-     */
-    @Schema(description = "创建人")
-    @NotNull(message = "创建人不能为空")
-    private Long createUser;
-
-    /**
-     * 创建时间
-     */
-    @Schema(description = "创建时间")
-    @NotNull(message = "创建时间不能为空")
-    private LocalDateTime createTime;
+    // /**
+    //  * 创建人
+    //  */
+    // @Schema(description = "创建人")
+    // @NotNull(message = "创建人不能为空")
+    // private Long createUser;
+    //
+    // /**
+    //  * 创建时间
+    //  */
+    // @Schema(description = "创建时间")
+    // @NotNull(message = "创建时间不能为空")
+    // private LocalDateTime createTime;
 }

+ 16 - 12
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/DocChunkReq.java

@@ -10,7 +10,6 @@ import org.hibernate.validator.constraints.Length;
 import java.io.Serial;
 import java.io.Serializable;
 import java.time.*;
-import java.math.BigDecimal;
 
 /**
  * 文档切片创建或修改参数
@@ -30,7 +29,7 @@ public class DocChunkReq implements Serializable {
      */
     @Schema(description = "向量库的ID")
     @NotNull(message = "向量库的ID不能为空")
-    private Long embedStoreId;
+    private String embedStoreId;
 
     /**
      * 文档ID
@@ -61,17 +60,22 @@ public class DocChunkReq implements Serializable {
     @Length(max = 65535, message = "切片内容长度不能超过 {max} 个字符")
     private String content;
 
-    /**
-     * 创建人
-     */
-    @Schema(description = "创建人")
-    @NotNull(message = "创建人不能为空")
-    private Long createUser;
+    // /**
+    //  * 创建人
+    //  */
+    // @Schema(description = "创建人")
+    // @NotNull(message = "创建人不能为空")
+    // private Long createUser;
+    //
+    // /**
+    //  * 创建时间
+    //  */
+    // @Schema(description = "创建时间")
+    // @NotNull(message = "创建时间不能为空")
+    // private LocalDateTime createTime;
 
     /**
-     * 创建时间
+     * 文档名称
      */
-    @Schema(description = "创建时间")
-    @NotNull(message = "创建时间不能为空")
-    private LocalDateTime createTime;
+    private String name;
 }

+ 16 - 11
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/DocReq.java

@@ -51,7 +51,7 @@ public class DocReq implements Serializable {
      * 文件哈希
      */
     @Schema(description = "文件哈希")
-    @NotBlank(message = "文件哈希不能为空")
+    // @NotBlank(message = "文件哈希不能为空")
     @Length(max = 64, message = "文件哈希长度不能超过 {max} 个字符")
     private String fileHash;
 
@@ -64,16 +64,21 @@ public class DocReq implements Serializable {
     private String storagePath;
 
     /**
-     * 创建人
+     * 切片数量
      */
-    @Schema(description = "创建人")
-    @NotNull(message = "创建人不能为空")
-    private Long createUser;
+    private Integer sliceNum;
 
-    /**
-     * 创建时间
-     */
-    @Schema(description = "创建时间")
-    @NotNull(message = "创建时间不能为空")
-    private LocalDateTime createTime;
+    // /**
+    //  * 创建人
+    //  */
+    // @Schema(description = "创建人")
+    // @NotNull(message = "创建人不能为空")
+    // private Long createUser;
+    //
+    // /**
+    //  * 创建时间
+    //  */
+    // @Schema(description = "创建时间")
+    // @NotNull(message = "创建时间不能为空")
+    // private LocalDateTime createTime;
 }

+ 7 - 0
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/KnowledgeReq.java

@@ -52,4 +52,11 @@ public class KnowledgeReq implements Serializable {
     @Schema(description = "关联向量存储ID")
     @NotNull(message = "关联向量存储ID不能为空")
     private Long embedStoreId;
+
+
+    /**
+     * 知识库描述
+     */
+    @Schema(description = "知识库描述")
+    private String knowDescribe;
 }

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/req/ModelSecretReq.java

@@ -6,7 +6,6 @@ import lombok.Data;
 
 import io.swagger.v3.oas.annotations.media.Schema;
 
-import org.hibernate.validator.constraints.Length;
 import java.io.Serial;
 import java.io.Serializable;
 import java.time.*;

+ 7 - 7
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/resp/AgentPlanResp.java

@@ -165,13 +165,13 @@ public class AgentPlanResp extends BaseResp {
                 default -> "[ ]";
             };
             state.append("步骤 ")
-                    .append(i)
-                    .append(": ")
-                    .append(symbol)
-                    .append(" ")
-                    .append(step.getDescription())
-                    .append("\n")
-                    .append("\n");
+                .append(i)
+                .append(": ")
+                .append(symbol)
+                .append(" ")
+                .append(step.getDescription())
+                .append("\n")
+                .append("\n");
             String result = step.getResult();
             if (result != null && !result.isEmpty()) {
                 state.append("该步骤的执行结果: ").append("\n").append(result).append("\n");

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/resp/AgentPlanStepDetailResp.java

@@ -36,7 +36,6 @@ public class AgentPlanStepDetailResp extends BaseDetailResp {
     @ExcelProperty(value = "计划描述:[BROWSER_AGENT] 打开百度主页")
     private String description;
 
-
     /**
      * 本次计划要使用的智能体:[BROWSER_AGENT]
      */

+ 0 - 1
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/resp/AgentPlanStepResp.java

@@ -157,7 +157,6 @@ public class AgentPlanStepResp extends BaseResp {
     @Schema(description = "本次计划要使用的智能体:[BROWSER_AGENT]")
     private PavisAgent agent;
 
-
     public AgentState getAgentRuntimeStatus() {
         return agent == null ? AgentState.NOT_STARTED : agent.getState();
     }

+ 1 - 5
pavis-module-aigc/src/main/java/com/pavis/admin/aigc/model/resp/AgentToolResp.java

@@ -38,11 +38,7 @@ public class AgentToolResp implements Serializable {
     /**
      * 工具ID
      */
-    @AssembleMethod(
-            targetType = ToolMapper.class,
-            method = @ContainerMethod(bindMethod = "selectById", resultType = ToolDO.class),
-            prop = ":tool"
-    )
+    @AssembleMethod(targetType = ToolMapper.class, method = @ContainerMethod(bindMethod = "selectById", resultType = ToolDO.class), prop = ":tool")
     @Schema(description = "工具ID")
     private Long toolId;
 

Неке датотеке нису приказане због велике количине промена