Files

81 lines
2.6 KiB
Markdown
Raw Permalink 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.
# 友通达询价智能体(新)
与现网 **功能与业务合同等价** 的新实现。业务合同见 `prompt/`。
**切流目标(方案 B)**:用 `E:\wwwroot` 新系统取代 `C:\yutongda`。清单见 `deploy/CUTOVER-TO-PROD.md`。
切流完成前数据仍隔离(`inquiry_robot*`),域名/企微已与正式相同。
## 目录命名
| 目录 | 职责 |
|---|---|
| `inquiry-agent/` | 智能体端(HTTP + Worker,Python) |
| `inquiry-backend/` | 管理后台前端(Jeecg Vue3) |
| `inquiry-api/` | 主账接口(JeecgBoot + inquiry 模块,端口 8180) |
| `aibot-bridge/` | 企微 AIBOT 传输桥(仅回环) |
| `contracts/` | 字段合同 JSON |
| `deploy/` | 部署脚本与 SQL |
| `prompt/` | 业务合同提示词 |
| `docs/` | 决策与设计文档 |
## 进程一览(切流前并存端口)
| 进程 | 目录 | 默认端口 | 说明 |
|---|---|---|---|
| 主账 API | `inquiry-api/` | 8180 | JeecgBoot;六态 / TMS Owner |
| 智能体 HTTP | `inquiry-agent/` | 8910 | FastAPI;回调/H5/唤醒只入队快回 |
| 智能体 Worker | `inquiry-agent/` | 无 | 同仓另一入口;LibreOffice 仅 1 槽 |
| AIBOT 桥 | `aibot-bridge/` | 8913(仅 127.0.0.1) | 传输壳;并存期默认不连 Bot |
| 管理后台 | `inquiry-backend/` | 3100 开发 / Nginx 静态 | 只消费主账 `/jeecgboot` |
现网 8080 / 8810 / 8813 切流前勿强占。配置用 `YTD_ENV=prod|test`,变量名见 `.env.example` 与 `prompt/13-环境对照.md`。
## 本机快速起
1. 复制 `.env.example` 为 `.env`(勿提交)。
2. **主账**(JDK 8 + Maven;建议 jar 放到纯英文路径如 `C:\ytd\inquiry-ledger`):
```text
cd inquiry-api
mvn -DskipTests package
```
3. **后台前端**:
```text
cd inquiry-backend
pnpm install
pnpm run dev
```
4. **智能体 HTTP**(Python 3.12+):
```text
cd inquiry-agent
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
python -m agent.http_app
```
5. **Worker**(另开终端,同目录):
```text
python -m agent.worker_app
```
6. **AIBOT 桥**:
```text
cd aibot-bridge
node server.cjs
```
冒烟:
```text
curl http://127.0.0.1:8180/jeecgboot/
curl http://127.0.0.1:8910/health
curl http://127.0.0.1:8913/health
```
后台开发地址以 `inquiry-backend` 的 Vite 端口为准(见 `.env` 里 `VITE_PORT`)。
## 不要做的事
- 不要提交 `.env`、密钥、私钥。
- 不要连现网库 `jeecg-boot` / `ytd_runtime`,不要改现网 Nginx 回调。
- 不要让测试 AIBOT 再连现网长连接。
- 不要在回调线程里跑 LLM / LibreOffice。