Skip to content

Commit dec4f74

Browse files
authored
Merge pull request #1 from chrisis58/dev-graph
feat: 改用基于图的流程重新实现日志分析
2 parents 8d730f7 + d0710aa commit dec4f74

37 files changed

Lines changed: 1602 additions & 137 deletions

.env.example

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,54 @@
22
# Required Settings 必填项
33
# ========================
44

5-
# Dashscope API Key
6-
# get it from https://help.aliyun.com/zh/model-studio/first-api-call-to-qwen?spm=a2c4g.11186623.help-menu-2400256.d_0_0_1.30237dc5FLsnId
7-
AI_API_KEY=your_api_key_here
5+
# Dashscope API Key (Required/必填)
6+
# Get it from Aliyun Dashscope Console
7+
# 获取地址: https://help.aliyun.com/zh/model-studio/first-api-call-to-qwen
8+
AI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
89

910

1011
# =======================
1112
# Optional Settings 可选项
1213
# =======================
1314

14-
WDD_SERVER_PORT=8093
15+
# --- AI Configuration (AI 基础配置) ---
1516

16-
# OpenAi-Compatible mode for Dashscope, change if needed
17-
# 默认使用 Dashscope 的 OpenAI 兼容模式,如有需要可更改
17+
# OpenAI-Compatible Base URL
18+
# 默认使用阿里云百炼 (Dashscope) 的兼容接口
1819
AI_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode
19-
AI_MODEL=qwen3-max
20+
21+
# Global Default Model (全局默认模型)
22+
# Used if Think/Flash models are not specified separately
23+
# 如果未单独指定 Think/Flash 模型,将默认使用此模型
24+
AI_CHAT_MODEL=qwen-max
25+
26+
# --- Agent Specific Models (Agent 专用模型配置) ---
27+
# Leave blank to use AI_CHAT_MODEL
28+
# 留空则默认继承 AI_CHAT_MODEL 的设置
29+
30+
# Thinking Model (推理模型) - For complex planning
31+
# 用于复杂任务规划
32+
WDD_AGENT_THINK_MODEL=qwen-max
33+
34+
# Flash Model (快速模型) - For simple tasks
35+
# 用于简单权限检查或快速响应
36+
WDD_AGENT_FLASH_MODEL=qwen-flash
37+
38+
# --- Security & Dashboard (安全与面板登录) ---
2039

2140
# Dashboard login credentials
2241
# 登录用户名和密码
2342
WDD_USER_NAME=admin
2443
WDD_USER_PASSWORD=admin
2544

45+
# --- Probe Configuration (探针配置) ---
46+
2647
# (Recommended) Hash salt for probe secret generation
27-
# (建议修改) 探针密钥生成的哈希盐值
48+
# (强烈建议修改) 用于探针连接鉴权的哈希盐值,生产环境请修改
2849
WDD_PROBE_CONNECT_KEY=default_connect_key
50+
51+
# --- Server Configuration (服务器配置) ---
52+
53+
# Application Port
54+
# 应用启动端口
55+
SERVER_PORT=8093

docker-compose.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@ services:
66
image: win-diag-doctor:latest
77
container_name: wdd-server
88
ports:
9-
- "${WDD_SERVER_PORT:-8093}:8093"
9+
- "${SERVER_PORT:-8093}:8093"
1010
environment:
11+
# --- AI 核心配置 ---
1112
- AI_API_KEY=${AI_API_KEY}
1213
- AI_BASE_URL=${AI_BASE_URL:-https://dashscope.aliyuncs.com/compatible-mode}
13-
- AI_CHAT_MODEL=${AI_CHAT_MODEL:-qwen3-max}
14+
- AI_CHAT_MODEL=${AI_CHAT_MODEL:-qwen-max}
1415

16+
# 如果 .env 中未定义,如果留空会自动回退使用 AI_CHAT_MODEL
17+
- WDD_AGENT_THINK_MODEL=${WDD_AGENT_THINK_MODEL}
18+
- WDD_AGENT_FLASH_MODEL=${WDD_AGENT_FLASH_MODEL}
19+
20+
# --- 安全配置 ---
1521
- WDD_USER_NAME=${WDD_USER_NAME:-admin}
1622
- WDD_USER_PASSWORD=${WDD_USER_PASSWORD:-admin}
1723

24+
# --- 探针配置 ---
1825
- WDD_PROBE_CONNECT_KEY=${WDD_PROBE_CONNECT_KEY:-default_connect_key}
1926
restart: unless-stopped

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<spring-ai-alibaba.version>1.1.0.0-M4</spring-ai-alibaba.version>
4949

5050
<jtoon.version>0.1.2</jtoon.version>
51+
<graph-composer.version>0.2.0</graph-composer.version>
5152
</properties>
5253

5354
<dependencyManagement>
@@ -92,6 +93,12 @@
9293
<version>${spring-ai-alibaba.version}</version>
9394
</dependency>
9495

96+
<dependency>
97+
<groupId>cn.teacy.ai</groupId>
98+
<artifactId>saa-graph-composer</artifactId>
99+
<version>0.1.0</version>
100+
</dependency>
101+
95102
</dependencies>
96103
</dependencyManagement>
97104

win-diag-doctor-app/pom.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,35 @@
6868

6969
<dependency>
7070
<groupId>org.springframework.ai</groupId>
71-
<artifactId>spring-ai-starter-model-openai</artifactId>
71+
<artifactId>spring-ai-openai</artifactId>
7272
</dependency>
7373

7474
<dependency>
7575
<groupId>com.alibaba.cloud.ai</groupId>
7676
<artifactId>spring-ai-alibaba-studio</artifactId>
77+
<exclusions>
78+
<exclusion>
79+
<groupId>com.alibaba.cloud.ai</groupId>
80+
<artifactId>spring-ai-alibaba-autoconfigure-dashscope</artifactId>
81+
</exclusion>
82+
</exclusions>
7783
</dependency>
7884

7985
<dependency>
8086
<groupId>com.felipestanzani</groupId>
8187
<artifactId>jtoon</artifactId>
8288
</dependency>
8389

90+
<dependency>
91+
<groupId>com.fasterxml.jackson.dataformat</groupId>
92+
<artifactId>jackson-dataformat-xml</artifactId>
93+
</dependency>
94+
95+
<dependency>
96+
<groupId>cn.teacy.ai</groupId>
97+
<artifactId>saa-graph-composer</artifactId>
98+
</dependency>
99+
84100
</dependencies>
85101

86102
<build>

win-diag-doctor-app/src/main/java/cn/teacy/wdd/WinDiagDoctorMainApplication.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package cn.teacy.wdd;
22

3+
import cn.teacy.ai.annotation.EnableGraphComposer;
34
import org.springframework.boot.SpringApplication;
45
import org.springframework.boot.autoconfigure.SpringBootApplication;
56

67
@SpringBootApplication(excludeName = {
78
"com.alibaba.cloud.ai.agent.studio.SaaStudioWebModuleAutoConfiguration"
89
})
10+
@EnableGraphComposer
911
public class WinDiagDoctorMainApplication {
1012

1113
public static void main(String[] args) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package cn.teacy.wdd.agent.common;
2+
3+
public class ProbeIdMissingException extends RuntimeException {
4+
public ProbeIdMissingException(String message) {
5+
super(message);
6+
}
7+
}

0 commit comments

Comments
 (0)