Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ YOLO Data Agent把智能体、指标和业务数据集、权限及分析工作
- **从结果继续工作**:会话记忆帮助承接上下文;表格、图表、文件和代码分析结果可保留在工作区,方便下载、复查和后续追问。
- **管理和复盘使用情况**:管理员可查看查询计划、数据集访问记录、模型调用、反馈和知识缺口,定位配置问题并持续改进。

### 登录与会话

#### 在线演示

- 演示地址:[http://49.232.39.8/](http://49.232.39.8/)
- 演示账号:`admin` / `yolo123456`

## 页面截图

![开始问数](docs/screenshots/query_index.png)
Expand Down Expand Up @@ -110,7 +117,7 @@ flowchart LR
- Node.js `>= 22.5`
- 平台配置: MySQL(默认)或SQLite;通过 `PLATFORM_DB_BACKEND` 选择。MySQL 模式还需配置 `PLATFORM_DB_*`相关参数。
- npm 或 pnpm
- Python 3:用于高级数据处理和文件生成。`npm run setup` 会自动初始化环境
- Python 3.11+: 必须是python3.11以上,用于高级数据处理和文件生成。`npm run setup` 会自动初始化环境
- 或:Docker + Docker Compose,一条命令启动完整平台,无需本机 Node/Python(见 [Docker 一键部署](#docker-一键部署))
- 可选外部服务:
- Doris 或 MySQL 兼容业务数据库
Expand Down Expand Up @@ -138,18 +145,6 @@ docker compose up -d --build
PostgreSQL 数据源接入方式见 [PostgreSQL 接入文档](docs/postgresql.md)。


### 登录与会话

| 用户名 | 显示名称 | 角色 | 默认口令 |
| ----------------- | ----- | --------- | ------------ |
| `admin` | 平台管理员 | `ADMIN` | `yolo123456` |
| `east_manager` | 区域经理 | `ANALYST` | `yolo123456` |
| `channel_analyst` | 渠道分析员 | `ANALYST` | `yolo123456` |

- 以上为首次初始化的示例账号。首次登录后请立即修改默认口令,并按实际需要创建账号与授权。

- 角色分管理员与分析员:管理员管理平台,分析员只能查看已授权智能体并用其问数。

## 配置说明

### 配置文件 `yolo-conf.yaml`
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Python analysis runtime required by execute_analysis_code and XLSX generation.
pandas>=2.2,<3
pandas==2.3.2
openpyxl>=3.1,<4
19 changes: 19 additions & 0 deletions scripts/python-setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ function pythonVersion(pythonBin) {
return result.status === 0 ? String(result.stdout ?? '').trim() || null : null;
}

function pythonMeetsMinimum(pythonBin, minimumMajor = 3, minimumMinor = 9) {
const result = spawnSync(
pythonBin,
['-c', 'import sys; print("%s.%s" % sys.version_info[:2])'],
{ encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] },
);
if (result.status !== 0) return false;
const [major, minor] = String(result.stdout ?? '').trim().split('.').map(Number);
return major > minimumMajor || (major === minimumMajor && minor >= minimumMinor);
}

function createVenv(projectRoot, basePython, onInfo) {
const venvPath = path.join(projectRoot, VENV_DIRECTORY);
onInfo(`创建项目 Python 虚拟环境 ${VENV_DIRECTORY}`);
Expand Down Expand Up @@ -100,6 +111,14 @@ export function ensurePythonAnalysisRuntime({ projectRoot, confPath, onInfo = ()
}
}

if (!pythonMeetsMinimum(pythonBin)) {
throw new Error(
`当前项目虚拟环境使用 Python ${pythonVersion(pythonBin) ?? '未知版本'},`
+ 'pandas 2.3.2 要求 Python >= 3.9。请先将现有 .venv 移走,'
+ '再用 PYTHON_BIN=/usr/local/python3.11/bin/python3.11 npm run setup 重建。',
);
}

const digest = requirementsDigest(requirementsPath);
const stampPath = path.join(venvPath, STAMP_FILE);
const installedDigest = fs.existsSync(stampPath)
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function assertNodeVersion() {
function installDependencies() {
info('安装依赖(含 MySQL/Doris 驱动 mysql2)');
// Windows cannot reliably spawn .cmd files directly (Node may return EINVAL).
// Invoke npm.cmd through cmd.exe there; keep direct execution on POSIX.
// Run npm.cmd through cmd.exe there; keep direct execution on POSIX.
const command = process.platform === 'win32'
? (process.env.ComSpec || 'cmd.exe')
: 'npm';
Expand Down
Loading