Files
uipath-explainator/README.md
xiaomai d6218d6bad feat(gemini): normalize base URL to strip API version suffixes
Automatically remove trailing slashes and version paths (e.g., /v1beta) from GEMINI_BASE_URL
Update GeminiAnalyzer to use the normalized URL and add type hints
Add test coverage for Gemini client configuration
2026-04-02 10:25:18 +08:00

54 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# UiPath Explainator
`uipath-explainator` 会按 UiPath 项目入口 `main.xaml` 递归提取 `Invoke Workflow``Invoke VBA`,复制到指定工作区,删除 `<ui:CommentOut>` 里的无效代码,再重新扫描并裁掉不再使用的文件,最后逐个调用 Gemini 生成说明文档。
## 安装
```bash
./.venv/bin/pip install -e .
```
## 配置
`.env.example` 复制成 `.env`,至少填入:
```env
GEMINI_API_KEY=your_api_key
GEMINI_BASE_URL=
GEMINI_MODEL=gemini-2.5-flash
```
`GEMINI_BASE_URL` 留空时走官方默认地址;如果你前面挂了代理或网关,可以填自定义地址。
这里填写网关根地址即可,例如 `https://your-gateway.example.com`,不要自己追加 `/v1beta``/v1alpha``/v1`
## 使用
```bash
./.venv/bin/python -m uipath_explainator \
/path/to/uipath-project \
--output-dir workspace/project-copy \
--force
```
常用参数:
- `--entry`: 入口文件名,默认 `main.xaml`
- `--env-file`: 自定义 `.env` 路径
- `--model`: 临时覆盖 `.env` 里的模型名
- `--skip-analysis`: 只做复制、清理和剪枝,不调用 Gemini
- `--force`: 允许覆盖已有输出目录
## 输出内容
输出目录会保留原项目的相对目录结构,并额外生成:
- `manifest.json`: 扫描、剪枝、告警和分析结果清单
- `OVERVIEW.md`: 总览摘要
- `*.analysis.md`: 每个最终保留文件对应的 Gemini 说明
## 当前实现约束
- 只解析能静态识别出来的 `Invoke Workflow` / `Invoke VBA` 文件路径。
- 对动态拼接路径会记录 warning但不会猜测。
- `Invoke VBA` 默认识别常见文本型 VBA 文件扩展名:`.txt``.bas``.vb``.vbs``.vba``.cls``.frm`