diff --git a/Dockerfile b/Dockerfile index 1b0a79c..b5ac1b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,8 @@ FROM base AS builder COPY --from=deps /app/node_modules ./node_modules COPY . . RUN npx prisma generate +ENV DATABASE_URL="file:./dev.db" +RUN npx prisma db push RUN npm run build # 阶段3: 生产运行环境 diff --git a/Docker部署说明.md b/Docker部署说明.md new file mode 100644 index 0000000..0ef5be1 --- /dev/null +++ b/Docker部署说明.md @@ -0,0 +1,241 @@ +# Docker 部署说明 + +## 项目概述 + +基于 Next.js 15 的 AI 智能体门户系统,使用 Prisma + SQLite 作为数据存储,采用 `output: 'standalone'` 模式构建自包含的生产镜像。 + +## 前置要求 + +- Docker >= 20.10 +- Docker Compose >= 2.0(可选,推荐使用) + +## 目录结构说明 + +``` +├── Dockerfile # 多阶段构建(3 阶段) +├── docker-compose.yml # 编排配置 +├── .dockerignore # 构建上下文排除 +├── .env # 环境变量(仅开发参考) +└── prisma/ + ├── schema.prisma # 数据库模型 + ├── seed.ts # 种子数据脚本 + └── migrations/ # 数据库迁移文件 +``` + +## 环境变量 + +| 变量名 | 说明 | 示例值 | +|--------|------|--------| +| `DATABASE_URL` | SQLite 数据库文件路径 | `file:/app/data/dev.db` | +| `NEXTAUTH_SECRET` | NextAuth JWT 加密密钥 | `your-secret-key` | +| `NEXTAUTH_URL` | 应用公网访问地址 | `http://your-domain.com` | + +> **注意**:生产环境请使用强随机字符串替换 `NEXTAUTH_SECRET`,可通过 `openssl rand -base64 32` 生成。 + +## 快速启动 + +### 方式一:使用 docker-compose(推荐) + +```bash +# 1. 创建数据持久化目录 +sudo mkdir -p /opt/nextapp/data + +# 2. 启动服务 +docker-compose up -d + +# 3. 查看日志 +docker-compose logs -f +``` + +### 方式二:手动 docker 命令 + +```bash +# 1. 构建镜像 +docker build -t nextapp . + +# 2. 创建数据目录 +mkdir -p /opt/nextapp/data + +# 3. 运行容器 +docker run -d \ + --name nextapp \ + -p 3000:3000 \ + -e DATABASE_URL=file:/app/data/dev.db \ + -e NEXTAUTH_SECRET=your-secret-key \ + -e NEXTAUTH_URL=http://localhost:3000 \ + -v /opt/nextapp/data/dev.db:/app/data/dev.db \ + --restart unless-stopped \ + nextapp +``` + +### 方式三:使用 Docker Compose 带数据库初始化 + +若需在首次启动时自动执行数据库迁移和种子数据初始化,可使用如下 `docker-compose.yml`: + +```yaml +version: '3.8' +services: + nextapp: + build: . + ports: + - "3000:3000" + environment: + - DATABASE_URL=file:/app/data/dev.db + - NEXTAUTH_SECRET=your-secret-key + - NEXTAUTH_URL=http://localhost:3000 + volumes: + - /opt/nextapp/data:/app/data + command: > + sh -c "npx prisma migrate deploy && npx prisma db seed && node server.js" + restart: unless-stopped +``` + +## Dockerfile 多阶段构建详解 + +| 阶段 | 基础镜像 | 作用 | +|------|----------|------| +| `base` | `node:20-alpine` | 基础环境,设置工作目录 | +| `deps` | `base` | 安装全部 npm 依赖(含 devDependencies) | +| `builder` | `base` | 生成 Prisma Client + `next build` | +| `runner` | `base` | 最小运行时:仅复制 standalone 产物、静态文件、prisma schema,创建非 root 用户 | + +构建产出:`.next/standalone/` 目录下的自包含 Node.js 服务器(`server.js`),无需 `next start`。 + +## 数据库管理 + +### 手动执行迁移 + +若容器已运行,需手动执行数据库迁移: + +```bash +docker exec -it nextapp sh -c "npx prisma migrate deploy" +``` + +### 手动执行种子数据 + +```bash +docker exec -it nextapp sh -c "npx prisma db seed" +``` + +初始化后可使用以下默认账号登录管理后台: +- 地址:`http://localhost:3000/admin/login` +- 用户名:`admin` +- 密码:`admin123` + +### 数据持久化 + +SQLite 数据库文件通过 volume 挂载到宿主机,路径为 `/opt/nextapp/data/dev.db`。建议定期备份此文件: + +```bash +cp /opt/nextapp/data/dev.db /opt/nextapp/data/backup-$(date +%Y%m%d).db +``` + +## 生产部署建议 + +### 反向代理(Nginx) + +```nginx +server { + listen 80; + server_name your-domain.com; + + location / { + proxy_pass http://127.0.0.1:3000; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_cache_bypass $http_upgrade; + } +} +``` + +使用 HTTPS(推荐使用 certbot / acme.sh 自动申请证书): + +```nginx +server { + listen 443 ssl; + server_name your-domain.com; + + ssl_certificate /path/to/cert.pem; + ssl_certificate_key /path/to/key.pem; + + location / { + proxy_pass http://127.0.0.1:3000; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_cache_bypass $http_upgrade; + } +} +``` + +### 更新部署 + +```bash +# 拉取最新代码 +git pull + +# 重新构建并启动 +docker-compose down +docker-compose up -d --build + +# 执行数据库迁移(如有 schema 变更) +docker exec -it nextapp sh -c "npx prisma migrate deploy" +``` + +### 查看日志 + +```bash +# 实时日志 +docker-compose logs -f + +# 最近 100 行 +docker-compose logs --tail=100 +``` + +## 常见问题 + +### 1. 数据库文件权限问题 + +确保宿主机上的数据目录对容器内 `nextjs` 用户(UID 1001)可写: + +```bash +sudo chown -R 1001:1001 /opt/nextapp/data +``` + +### 2. 端口冲突 + +修改 `docker-compose.yml` 中的宿主机端口映射: + +```yaml +ports: + - "8080:3000" # 将宿主机 8080 映射到容器 3000 +``` + +### 3. 构建性能 + +首次构建较慢,可配置 Docker BuildKit 加速: + +```bash +export DOCKER_BUILDKIT=1 +docker-compose build +``` + +### 4. NEXTAUTH_URL 配置错误 + +若通过反向代理访问,`NEXTAUTH_URL` 需设置为公网可访问的地址(含 https),否则 NextAuth 回调会失败。 + +## 镜像优化说明 + +- 使用 `node:20-alpine` 作为基础镜像(约 120MB) +- 采用多阶段构建,最终运行时镜像仅包含必要产物 +- `output: 'standalone'` 模式将应用代码打包为单文件 `server.js` +- 运行阶段使用非 root 用户 `nextjs`,提升安全性 diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index 53ecb50..8e85736 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -1,8 +1,8 @@ import { NextResponse } from "next/server" import { prisma } from "@/app/lib/prisma" -const FALLBACK_API_KEY = 'app-lbe2lglt7taGtZk0dG7pAhbx' -const FALLBACK_API_URL = 'http://df.clkeji.com/v1/chat-messages' +const FALLBACK_API_KEY = process.env.DIFY_API_KEY || 'app-lbe2lglt7taGtZk0dG7pAhbx' +const FALLBACK_API_URL = process.env.DIFY_API_URL || 'http://host.docker.internal/v1/chat-messages' export async function POST(request: Request) { try { diff --git a/docker-compose.yml b/docker-compose.yml index 3602d1f..8099a25 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,10 +4,14 @@ services: build: . ports: - "3000:3000" + extra_hosts: + - "host.docker.internal:host-gateway" environment: - DATABASE_URL=file:/app/data/dev.db - NEXTAUTH_SECRET=nextapp-secret-key-2026 - NEXTAUTH_URL=http://localhost:3000 + - DIFY_API_URL=http://host.docker.internal/v1/chat-messages + - DIFY_API_KEY=app-lbe2lglt7taGtZk0dG7pAhbx volumes: - - /opt/nextapp/data/dev.db:/app/data/dev.db + - ./prisma/dev.db:/app/data/dev.db restart: unless-stopped diff --git a/mysite1.conf b/mysite1.conf new file mode 100644 index 0000000..6653af4 --- /dev/null +++ b/mysite1.conf @@ -0,0 +1,15 @@ +server { + listen 88; + server_name _; + location / { + proxy_pass http://127.0.0.1:3000; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_cache_bypass $http_upgrade; + } +} \ No newline at end of file diff --git a/prisma/dev.db b/prisma/dev.db index dc91892..79f2847 100644 Binary files a/prisma/dev.db and b/prisma/dev.db differ diff --git a/本地启动说明.md b/本地启动说明.md new file mode 100644 index 0000000..62c58c2 --- /dev/null +++ b/本地启动说明.md @@ -0,0 +1,103 @@ +# NextApp 本地启动说明 + +## 环境要求 + +- Node.js 18.x 或更高版本 +- npm(随 Node.js 一同安装) + +--- + +## 启动步骤 + +### 1. 安装依赖 + +```bash +npm install +``` + +### 2. 配置环境变量 + +项目已提供 `.env` 文件,内容如下(通常无需修改): + +``` +DATABASE_URL="file:./dev.db" +NEXTAUTH_SECRET="nextapp-secret-key-2026" +NEXTAUTH_URL="http://localhost:3000" +``` + +### 3. 生成 Prisma 客户端 + +```bash +npx prisma generate +``` + +### 4. 初始化数据库 + +```bash +npx prisma migrate dev +``` + +### 5. 启动开发服务器 + +```bash +npm run dev +``` + +终端出现 `▲ Next.js x.x.x` 及 `Local: http://localhost:3000` 即为启动成功。 + +### 6. 初始化种子数据(可选) + +浏览器访问 **http://localhost:3000/api/seed**,或执行: + +```bash +curl http://localhost:3000/api/seed +``` + +--- + +## 常用命令 + +| 命令 | 说明 | +|------|------| +| `npm run dev` | 启动开发服务器(热重载) | +| `npm run build` | 构建生产版本 | +| `npm run start` | 启动生产服务器 | +| `npm run lint` | 代码检查 | +| `npx prisma studio` | 打开数据库可视化工具 | +| `npx prisma migrate dev --name <描述>` | 创建新数据库迁移 | + +--- + +## 访问地址 + +- 开发环境:**http://localhost:3000** +- 端口被占用时,可指定其他端口:`npm run dev -- -p 3001` + +--- + +## 常见问题 + +### Prisma 客户端未生成 + +```bash +npx prisma generate +``` + +### 数据库迁移未执行 + +```bash +npx prisma migrate dev +``` + +### 重置数据库 + +```bash +npx prisma migrate reset +``` + +### 清除缓存 + +```bash +rm -rf .next node_modules/.cache +npm run dev +``` diff --git a/测试/error2.txt b/测试/error2.txt new file mode 100644 index 0000000..2852410 --- /dev/null +++ b/测试/error2.txt @@ -0,0 +1,5 @@ +Chat API error: TypeError: fetch failed + at async c (.next/server/app/api/chat/route.js:1:1010) { + [cause]: [Error [ConnectTimeoutError]: Connect Timeout Error (attempted address: df.clkeji.com:80, timeout: 10000ms)] { + code: 'UND_ERR_CONNECT_TIMEOUT' + } 该服务宿主机可通过localhost访问,怎么修改地址,能访问到该服务 \ No newline at end of file diff --git a/测试/测试dify.txt b/测试/测试dify.txt deleted file mode 100644 index 0712894..0000000 --- a/测试/测试dify.txt +++ /dev/null @@ -1,45 +0,0 @@ -集团制度AI助手dify接口测试 - -curl -X POST 'http://df.clkeji.com/v1/chat-messages' \ ---header 'Authorization: Bearer app-8fifvN9DwYeCiLOBwZaKnq4F' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "inputs": {}, - "query": "What are the specs of the iPhone 13 Pro Max?", - "response_mode": "streaming", - "conversation_id": "", - "user": "abc-123", - "files": [ - { - "type": "image", - "transfer_method": "remote_url", - "url": "https://cloud.dify.ai/logo/logo-site.png" - } - ] -}' - -接口返回信息 - -data: {"event":"workflow_started","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"e8041804-adbe-4dca-b686-3338166313a2","workflow_id":"1d5da1ed-27f8-413e-bb82-56ba801ea2d2","inputs":{"sys.files":[],"sys.user_id":"abc-123","sys.app_id":"620a1161-8a63-4708-b1a8-637b2701dd7d","sys.workflow_id":"1d5da1ed-27f8-413e-bb82-56ba801ea2d2","sys.workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","sys.query":"What are the specs of the iPhone 13 Pro Max?","sys.dialogue_count":1},"created_at":1778220111,"reason":"initial"}} - -data: {"event":"node_started","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"30796137-3c9c-4ba2-9544-e1b555fce241","node_id":"1711528914102","node_type":"start","title":"开始","index":1,"predecessor_node_id":null,"inputs":null,"inputs_truncated":false,"created_at":1778220111,"extras":{},"iteration_id":null,"loop_id":null,"agent_strategy":null}} - -data: {"event":"message","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","answer":"ok","from_variable_selector":["1711528919501","answer"]} - -data: {"event":"node_finished","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"30796137-3c9c-4ba2-9544-e1b555fce241","node_id":"1711528914102","node_type":"start","title":"开始","index":1,"predecessor_node_id":null,"inputs":{"sys.files":[],"sys.user_id":"abc-123","sys.app_id":"620a1161-8a63-4708-b1a8-637b2701dd7d","sys.workflow_id":"1d5da1ed-27f8-413e-bb82-56ba801ea2d2","sys.workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","sys.query":"What are the specs of the iPhone 13 Pro Max?","sys.conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","sys.dialogue_count":1},"inputs_truncated":false,"process_data":{},"process_data_truncated":false,"outputs":{"sys.files":[],"sys.user_id":"abc-123","sys.app_id":"620a1161-8a63-4708-b1a8-637b2701dd7d","sys.workflow_id":"1d5da1ed-27f8-413e-bb82-56ba801ea2d2","sys.workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","sys.query":"What are the specs of the iPhone 13 Pro Max?","sys.conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","sys.dialogue_count":1},"outputs_truncated":false,"status":"succeeded","error":null,"elapsed_time":0.000115,"execution_metadata":null,"created_at":1778220111,"finished_at":1778220111,"files":[],"iteration_id":null,"loop_id":null}} - -data: {"event":"node_started","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"b6d426f3-a890-4a47-be7f-301c22a19834","node_id":"1778147363037","node_type":"knowledge-retrieval","title":"知识检索","index":1,"predecessor_node_id":null,"inputs":null,"inputs_truncated":false,"created_at":1778220111,"extras":{},"iteration_id":null,"loop_id":null,"agent_strategy":null}} - -data: {"event":"node_finished","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"b6d426f3-a890-4a47-be7f-301c22a19834","node_id":"1778147363037","node_type":"knowledge-retrieval","title":"知识检索","index":1,"predecessor_node_id":null,"inputs":{"query":"What are the specs of the iPhone 13 Pro Max?"},"inputs_truncated":false,"process_data":{"usage":{"prompt_tokens":0,"prompt_unit_price":"0.0","prompt_price_unit":"0.0","prompt_price":"0.0","completion_tokens":0,"completion_unit_price":"0.0","completion_price_unit":"0.0","completion_price":"0.0","total_tokens":0,"total_price":"0.0","currency":"USD","latency":0.0,"time_to_first_token":null,"time_to_generate":null}},"process_data_truncated":false,"outputs":{"result":[]},"outputs_truncated":false,"status":"succeeded","error":null,"elapsed_time":0.567075,"execution_metadata":{"total_tokens":0,"total_price":"0.0","currency":"USD"},"created_at":1778220111,"finished_at":1778220112,"files":[],"iteration_id":null,"loop_id":null}} - -data: {"event":"node_started","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"ed623bbb-d6a1-440f-85a2-ae8ed2f127ca","node_id":"1711528917469","node_type":"llm","title":"LLM","index":1,"predecessor_node_id":null,"inputs":null,"inputs_truncated":false,"created_at":1778220112,"extras":{},"iteration_id":null,"loop_id":null,"agent_strategy":null}} - -data: {"event":"node_finished","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"ed623bbb-d6a1-440f-85a2-ae8ed2f127ca","node_id":"1711528917469","node_type":"llm","title":"LLM","index":1,"predecessor_node_id":null,"inputs":{},"inputs_truncated":false,"process_data":{"model_mode":"chat","prompts":[{"role":"system","text":"你是一个乐于助人的助手。\n使用以下内容作为你所学习的知识,放在 XML标签内。\n\n{{#context#}}\n\n回答用户时:\n如果你不知道,就直说你不知道。如果你在不确定的 时候不知道,就寻求澄清。\n避免提及你是从上下文中获取的信息。\n并根据用户问题的语言来回答。","files":[]},{"role":"user","text":"What are the specs of the iPhone 13 Pro Max?","files":[]}],"usage":{"prompt_tokens":103,"prompt_unit_price":"0","prompt_price_unit":"0","prompt_price":"0","completion_tokens":243,"completion_unit_price":"0","completion_price_unit":"0","completion_price":"0","total_tokens":346,"total_price":"0","currency":"USD","latency":3.909,"time_to_first_token":0.297,"time_to_generate":3.613},"finish_reason":"stop","model_provider":"langgenius/ollama/ollama","model_name":"qwen2.5:14b"},"process_data_truncated":false,"outputs":{"text":"The iPhone 13 Pro Max features a Super Retina XDR display with a resolution of 2778 by 1284 pixels. It comes in two storage variants: 128GB, 256GB, 512GB, and 1TB. The phone is powered by the A15 Bionic chip.\n\nHere are some additional specifications:\n\n- Operating system: iOS\n- Processor: Hexa-core (2x3.21 GHz Avalanche + 4x1.92 GHz Blizzard)\n- RAM: 6 GB\n- Rear camera: Triple 12 MP\n- Front camera: 12 MP TrueDepth sensor\n- Battery: Approximate battery life: Up to 28 hours of talk time, up to 104 hours of audio playback, up to 25 hours of video playback\n\nIt also has features like Super Retina XDR display with ProMotion technology (up to 120Hz), Ceramic Shield front cover, LiDAR Scanner, and more.\n\nFor the most accurate and detailed information directly from Apple, you might want to refer to their official website or product page.","reasoning_content":"","usage":{"prompt_tokens":103,"prompt_unit_price":"0","prompt_price_unit":"0","prompt_price":"0","completion_tokens":243,"completion_unit_price":"0","completion_price_unit":"0","completion_price":"0","total_tokens":346,"total_price":"0","currency":"USD","latency":3.909,"time_to_first_token":0.297,"time_to_generate":3.613},"finish_reason":"stop"},"outputs_truncated":false,"status":"succeeded","error":null,"elapsed_time":3.928194,"execution_metadata":{"total_tokens":346,"total_price":"0","currency":"USD"},"created_at":1778220112,"finished_at":1778220115,"files":[],"iteration_id":null,"loop_id":null}} - -data: {"event":"node_started","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"579b24a0-083e-4459-a5b3-a777a9cec86c","node_id":"1711528919501","node_type":"answer","title":"直接回复","index":1,"predecessor_node_id":null,"inputs":null,"inputs_truncated":false,"created_at":1778220115,"extras":{},"iteration_id":null,"loop_id":null,"agent_strategy":null}} - -data: {"event":"node_finished","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"579b24a0-083e-4459-a5b3-a777a9cec86c","node_id":"1711528919501","node_type":"answer","title":"直接回复","index":1,"predecessor_node_id":null,"inputs":{},"inputs_truncated":false,"process_data":{},"process_data_truncated":false,"outputs":{"answer":"ok","files":[]},"outputs_truncated":false,"status":"succeeded","error":null,"elapsed_time":0.000276,"execution_metadata":null,"created_at":1778220115,"finished_at":1778220115,"files":[],"iteration_id":null,"loop_id":null}} - -data: {"event":"message_end","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","metadata":{"annotation_reply":null,"retriever_resources":[],"usage":{"prompt_tokens":103,"prompt_unit_price":"0","prompt_price_unit":"0","prompt_price":"0","completion_tokens":243,"completion_unit_price":"0","completion_price_unit":"0","completion_price":"0","total_tokens":346,"total_price":"0","currency":"USD","latency":3.909,"time_to_first_token":0.24,"time_to_generate":0.0}},"files":[]} - -data: {"event":"workflow_finished","conversation_id":"873b7321-67a0-4bbd-ab6b-82d7386ec701","message_id":"5143a2ee-5175-4ece-85c0-bff7eab02ca8","created_at":1778220111,"task_id":"9e8a52b9-79b4-4558-88b9-fe7ad0b578a0","workflow_run_id":"e8041804-adbe-4dca-b686-3338166313a2","data":{"id":"e8041804-adbe-4dca-b686-3338166313a2","workflow_id":"1d5da1ed-27f8-413e-bb82-56ba801ea2d2","status":"succeeded","outputs":{"answer":"ok","files":[]},"error":null,"elapsed_time":4.586759,"total_tokens":346,"total_steps":4,"created_by":{"id":"b9be62f8-bb81-45ee-95c1-57d7ae3a6d58","user":"abc-123"},"created_at":1778220111,"finished_at":1778220116,"exceptions_count":0,"files":[]}} diff --git a/配置/git配置信息.txt b/配置/git配置信息.txt deleted file mode 100644 index 4d8279b..0000000 --- a/配置/git配置信息.txt +++ /dev/null @@ -1,8 +0,0 @@ -背景:当前远程git库为空,将本地的代码推送到git库,并生成README和.gitignore文件 - - -通过命令行推送一个已存在的版本库 - git remote add origin http://admin@192.168.0.105:8440/r/ai-portal.git - git push -u origin master - - diff --git a/需求/需求1.txt b/需求/需求1.txt deleted file mode 100644 index babf84c..0000000 --- a/需求/需求1.txt +++ /dev/null @@ -1 +0,0 @@ -给数字人应用单独建立一个详情页面,点击首页数字人应用图标,跳转到详情页,详情页面包含数字人库,创建几个虚拟人物,比如,小雅,书淇,樱桃等名字 \ No newline at end of file