Commit ab297109 by heheer Committed by GitHub

fix: node copy, debug variables, auto-execution (#5664)

* fix debug variables

* auto execute condition

* fix autoTTSResponse

* node copy

* memory debug nodes

* doc

* yuque doc

* fix: debug

* img

* i18n

---------

Co-authored-by: archer <545436317@qq.com>
parent 1581a080
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"configuration", "configuration",
"docker", "docker",
"faq", "faq",
"signoz",
"modelConfig", "modelConfig",
"openapi", "openapi",
"custom-models", "custom-models",
......
---
title: 接入 Signoz 服务监控
description: FastGPT 接入 Signoz 服务监控
---
## 介绍
[SigNoz](https://signoz.io/) 是一款开源的应用性能监控(APM)和可观测性平台,为 FastGPT 提供全面的服务监控能力。它基于 OpenTelemetry 标准,能够收集、处理和可视化分布式系统的遥测数据,包括链路追踪(Tracing)、指标监控(Metrics)和日志分析(Logging)。
**主要功能:**
- **链路追踪**:跟踪用户请求在 FastGPT 各个服务间的完整调用链路
- **性能监控**:监控 API 响应时间、吞吐量等关键性能指标
- **错误追踪**:自动捕获和记录系统异常,便于问题排查
- **日志聚合**:集中收集和管理应用日志,支持结构化查询
- **实时告警**:基于指标阈值设置告警规则,及时发现系统异常
## 部署 Signoz
可以使用 [SigNoz](https://signoz.io/) 官方云服务,或者私有部署,下面介绍在 Sealos 上快速部署 Signoz。
1. 点击下方的卡片,即可一键部署 Signoz。
[![](/imgs/Deploy-on-Sealos.svg)](https://hzh.sealos.run/?uid=fnWRt09fZP&openapp=system-template%3FtemplateName%3Dsignoz)
2. 开启 Signoz 外网访问
部署后,可点击 P1 中的详情,进入应用详情页, 然后点击右上角的变更,并开启 4318 端口的外网地址(如果走内网服务,可忽略该步骤)。
| P1 | P2 | P3 |
| --- | --- | --- |
| ![alt text](/imgs/image-112.png) | ![alt text](/imgs/image-110.png) | ![alt text](/imgs/image-111.png) |
3. 获取 Signoz 访问地址
变更完成后,等待公网地址就绪,复制该地址,将其填入 FastGPT 中。如果是走内网服务,可以直接复制 4318 端口的内网地址。
![alt text](/imgs/image-113.png)
## 配置 FastGPT
1. 修改 FastGPT 环境变量
```
SIGNOZ_BASE_URL=上一步复制的地址
SIGNOZ_SERVICE_NAME=fastgpt # 服务标识名,必须为英文
SIGNOZ_STORE_LEVEL=warn # 日志等级,可选值: debug, info, warn, error
```
2. 重启 FastGPT
## 查看效果
返回 Sealos 应用管理列表,点击进入 Signoz 前端项目,并访问其公网地址,进入管理台。
| | |
| --- | --- |
| ![alt text](/imgs/image-114.png) | ![alt text](/imgs/image-115.png) |
首次注册需要注册一个账号(数据是存储本地数据库),随便填写即可。
![alt text](/imgs/image-116.png)
登录进去后,如果看到右侧 COMPLETED 的步骤条中,logs 和 traces 亮起,则说明配置成功。
![alt text](/imgs/image-117.png)
![alt text](/imgs/image-118.png)
## 注意事项
1. 调整日志存储时长
Signoz 监控是一个非常占用磁盘的服务,首先不要把 FastGPT debug 日志也存储进来,另外可以将日志存储时长调整为 7 天。如果突然发现 Signoz 数据不增加了,并且内存一直追加,则说明是磁盘满了,需要扩大容量。
![alt text](/imgs/image-119.png)
\ No newline at end of file
...@@ -74,7 +74,7 @@ description: FastGPT 批量运行节点介绍和使用 ...@@ -74,7 +74,7 @@ description: FastGPT 批量运行节点介绍和使用
### 循环体配置 ### 循环体配置
![循环体配置](/imgs/fastgpt-loop-node-config.png) ![循环体配置](/imgs/fastgpt-loop-node-config.webp)
1. 在循环体内部,可以添加任意类型的节点,如: 1. 在循环体内部,可以添加任意类型的节点,如:
- AI 对话节点 - AI 对话节点
......
...@@ -17,10 +17,18 @@ FastGPT v4.8.16 版本开始,商业版用户支持语雀文件库导入,用 ...@@ -17,10 +17,18 @@ FastGPT v4.8.16 版本开始,商业版用户支持语雀文件库导入,用
参考下图获取 Token 和 User ID,注意给 Token 赋值权限: 参考下图获取 Token 和 User ID,注意给 Token 赋值权限:
**个人版**:
| 获取 Token | 增加权限 | 获取 User ID | | 获取 Token | 增加权限 | 获取 User ID |
| --- | --- | --- | | --- | --- | --- |
| ![alt text](/imgs/image-33.png) | ![alt text](/imgs/image-34.png) | ![alt text](/imgs/image-35.png) | | ![alt text](/imgs/image-33.png) | ![alt text](/imgs/image-34.png) | ![alt text](/imgs/image-35.png) |
**企业版**:
| 获取 Token | 获取 User ID |
| --- | --- |
| ![alt text](/imgs/image-109.png) | ![alt text](/imgs/image-108.png) |
## 2. 创建知识库 ## 2. 创建知识库
使用上一步获取的 token 和 uid,创建知识库,选择语雀文件库类型,然后填入对应的参数,点击创建。 使用上一步获取的 token 和 uid,创建知识库,选择语雀文件库类型,然后填入对应的参数,点击创建。
......
...@@ -42,6 +42,7 @@ description: FastGPT 文档目录 ...@@ -42,6 +42,7 @@ description: FastGPT 文档目录
- [/docs/introduction/development/proxy/http_proxy](/docs/introduction/development/proxy/http_proxy) - [/docs/introduction/development/proxy/http_proxy](/docs/introduction/development/proxy/http_proxy)
- [/docs/introduction/development/proxy/nginx](/docs/introduction/development/proxy/nginx) - [/docs/introduction/development/proxy/nginx](/docs/introduction/development/proxy/nginx)
- [/docs/introduction/development/sealos](/docs/introduction/development/sealos) - [/docs/introduction/development/sealos](/docs/introduction/development/sealos)
- [/docs/introduction/development/signoz](/docs/introduction/development/signoz)
- [/docs/introduction/guide/DialogBoxes/htmlRendering](/docs/introduction/guide/DialogBoxes/htmlRendering) - [/docs/introduction/guide/DialogBoxes/htmlRendering](/docs/introduction/guide/DialogBoxes/htmlRendering)
- [/docs/introduction/guide/DialogBoxes/quoteList](/docs/introduction/guide/DialogBoxes/quoteList) - [/docs/introduction/guide/DialogBoxes/quoteList](/docs/introduction/guide/DialogBoxes/quoteList)
- [/docs/introduction/guide/admin/sso](/docs/introduction/guide/admin/sso) - [/docs/introduction/guide/admin/sso](/docs/introduction/guide/admin/sso)
......
...@@ -47,7 +47,6 @@ curl --location --request POST 'https://{{host}}/api/admin/initv4124' \ ...@@ -47,7 +47,6 @@ curl --location --request POST 'https://{{host}}/api/admin/initv4124' \
1. HTTP 工具空指针,导致无法编辑。 1. HTTP 工具空指针,导致无法编辑。
2. python 代码运行,入参无法是 boolean 值。 2. python 代码运行,入参无法是 boolean 值。
3. debug 模式下,全局变量未传递。
## 🔨 插件更新 ## 🔨 插件更新
...@@ -12,7 +12,12 @@ description: 'FastGPT V4.12.5 更新说明' ...@@ -12,7 +12,12 @@ description: 'FastGPT V4.12.5 更新说明'
## 🐛 修复 ## 🐛 修复
1. debug 模式下,全局变量未传递。
2. debug 模式下,前方节点参数无法传递至后方节点
3. 调试模式下,开启“自动执行”,会跳过外部变量的填写。
4. 自动语音回复未生效
5. 节点复制,报错捕获配置丢失
## 🔨 插件更新 ## 🔨 插件更新
1. 新增火山引擎融合信息搜索工具。 1. 新增火山引擎融合信息搜索工具。
\ No newline at end of file
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"document/content/docs/introduction/development/custom-models/chatglm2.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/development/custom-models/chatglm2.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/development/custom-models/m3e.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/development/custom-models/m3e.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/development/custom-models/marker.mdx": "2025-08-04T22:07:52+08:00", "document/content/docs/introduction/development/custom-models/marker.mdx": "2025-08-04T22:07:52+08:00",
"document/content/docs/introduction/development/custom-models/mineru.mdx": "2025-09-17T18:33:31+08:00",
"document/content/docs/introduction/development/custom-models/ollama.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/introduction/development/custom-models/ollama.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/custom-models/xinference.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/introduction/development/custom-models/xinference.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/design/dataset.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/development/design/dataset.mdx": "2025-07-23T21:35:03+08:00",
...@@ -75,11 +76,11 @@ ...@@ -75,11 +76,11 @@
"document/content/docs/introduction/guide/knowledge_base/api_dataset.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/guide/knowledge_base/api_dataset.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/knowledge_base/collection_tags.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/introduction/guide/knowledge_base/collection_tags.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/introduction/guide/knowledge_base/dataset_engine.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/guide/knowledge_base/dataset_engine.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/knowledge_base/lark_dataset.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/guide/knowledge_base/lark_dataset.mdx": "2025-09-17T17:40:47+08:00",
"document/content/docs/introduction/guide/knowledge_base/template.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/guide/knowledge_base/template.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/knowledge_base/third_dataset.mdx": "2025-07-24T13:00:27+08:00", "document/content/docs/introduction/guide/knowledge_base/third_dataset.mdx": "2025-07-24T13:00:27+08:00",
"document/content/docs/introduction/guide/knowledge_base/websync.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/introduction/guide/knowledge_base/websync.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/guide/knowledge_base/yuque_dataset.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/guide/knowledge_base/yuque_dataset.mdx": "2025-09-17T19:04:12+08:00",
"document/content/docs/introduction/guide/plugins/bing_search_plugin.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/guide/plugins/bing_search_plugin.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/plugins/dev_system_tool.mdx": "2025-08-20T19:00:48+08:00", "document/content/docs/introduction/guide/plugins/dev_system_tool.mdx": "2025-08-20T19:00:48+08:00",
"document/content/docs/introduction/guide/plugins/doc2x_plugin_guide.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/guide/plugins/doc2x_plugin_guide.mdx": "2025-07-23T21:35:03+08:00",
...@@ -97,7 +98,7 @@ ...@@ -97,7 +98,7 @@
"document/content/docs/protocol/terms.en.mdx": "2025-08-03T22:37:45+08:00", "document/content/docs/protocol/terms.en.mdx": "2025-08-03T22:37:45+08:00",
"document/content/docs/protocol/terms.mdx": "2025-08-03T22:37:45+08:00", "document/content/docs/protocol/terms.mdx": "2025-08-03T22:37:45+08:00",
"document/content/docs/toc.en.mdx": "2025-08-04T13:42:36+08:00", "document/content/docs/toc.en.mdx": "2025-08-04T13:42:36+08:00",
"document/content/docs/toc.mdx": "2025-09-17T17:03:12+08:00", "document/content/docs/toc.mdx": "2025-09-17T18:33:31+08:00",
"document/content/docs/upgrading/4-10/4100.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-10/4100.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-10/4101.mdx": "2025-09-08T20:07:20+08:00", "document/content/docs/upgrading/4-10/4101.mdx": "2025-09-08T20:07:20+08:00",
"document/content/docs/upgrading/4-11/4110.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/upgrading/4-11/4110.mdx": "2025-08-05T23:20:39+08:00",
...@@ -106,8 +107,8 @@ ...@@ -106,8 +107,8 @@
"document/content/docs/upgrading/4-12/4121.mdx": "2025-09-07T14:41:48+08:00", "document/content/docs/upgrading/4-12/4121.mdx": "2025-09-07T14:41:48+08:00",
"document/content/docs/upgrading/4-12/4122.mdx": "2025-09-07T14:41:48+08:00", "document/content/docs/upgrading/4-12/4122.mdx": "2025-09-07T14:41:48+08:00",
"document/content/docs/upgrading/4-12/4123.mdx": "2025-09-07T20:55:14+08:00", "document/content/docs/upgrading/4-12/4123.mdx": "2025-09-07T20:55:14+08:00",
"document/content/docs/upgrading/4-12/4124.mdx": "2025-09-16T10:46:55+08:00", "document/content/docs/upgrading/4-12/4124.mdx": "2025-09-17T18:36:54+08:00",
"document/content/docs/upgrading/4-12/4125.mdx": "2025-09-17T17:03:12+08:00", "document/content/docs/upgrading/4-12/4125.mdx": "2025-09-17T21:22:47+08:00",
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",
......

179 KB | W: | H:

176 KB | W: | H:

document/public/imgs/datasetEngine9.jpg
document/public/imgs/datasetEngine9.jpg
document/public/imgs/datasetEngine9.jpg
document/public/imgs/datasetEngine9.jpg
  • 2-up
  • Swipe
  • Onion skin

179 KB | W: | H:

176 KB | W: | H:

document/public/imgs/datasetprompt5.jpg
document/public/imgs/datasetprompt5.jpg
document/public/imgs/datasetprompt5.jpg
document/public/imgs/datasetprompt5.jpg
  • 2-up
  • Swipe
  • Onion skin

205 KB | W: | H:

204 KB | W: | H:

document/public/imgs/datasetprompt8.jpg
document/public/imgs/datasetprompt8.jpg
document/public/imgs/datasetprompt8.jpg
document/public/imgs/datasetprompt8.jpg
  • 2-up
  • Swipe
  • Onion skin

208 KB | W: | H:

207 KB | W: | H:

document/public/imgs/datasetprompt9.jpg
document/public/imgs/datasetprompt9.jpg
document/public/imgs/datasetprompt9.jpg
document/public/imgs/datasetprompt9.jpg
  • 2-up
  • Swipe
  • Onion skin

194 KB | W: | H:

41.2 KB | W: | H:

document/public/imgs/evaluation2.png
document/public/imgs/evaluation2.png
document/public/imgs/evaluation2.png
document/public/imgs/evaluation2.png
  • 2-up
  • Swipe
  • Onion skin

218 KB | W: | H:

48.3 KB | W: | H:

document/public/imgs/evaluation3.png
document/public/imgs/evaluation3.png
document/public/imgs/evaluation3.png
document/public/imgs/evaluation3.png
  • 2-up
  • Swipe
  • Onion skin

288 KB | W: | H:

287 KB | W: | H:

document/public/imgs/fastgpt-loop-node-example-5.png
document/public/imgs/fastgpt-loop-node-example-5.png
document/public/imgs/fastgpt-loop-node-example-5.png
document/public/imgs/fastgpt-loop-node-example-5.png
  • 2-up
  • Swipe
  • Onion skin

211 KB | W: | H:

211 KB | W: | H:

document/public/imgs/fileinpu-3.jpg
document/public/imgs/fileinpu-3.jpg
document/public/imgs/fileinpu-3.jpg
document/public/imgs/fileinpu-3.jpg
  • 2-up
  • Swipe
  • Onion skin

242 KB | W: | H:

241 KB | W: | H:

document/public/imgs/fileinpu-5.jpg
document/public/imgs/fileinpu-5.jpg
document/public/imgs/fileinpu-5.jpg
document/public/imgs/fileinpu-5.jpg
  • 2-up
  • Swipe
  • Onion skin

179 KB | W: | H:

179 KB | W: | H:

document/public/imgs/gapierTool3.png
document/public/imgs/gapierTool3.png
document/public/imgs/gapierTool3.png
document/public/imgs/gapierTool3.png
  • 2-up
  • Swipe
  • Onion skin

254 KB | W: | H:

64.7 KB | W: | H:

document/public/imgs/image-100.png
document/public/imgs/image-100.png
document/public/imgs/image-100.png
document/public/imgs/image-100.png
  • 2-up
  • Swipe
  • Onion skin

263 KB | W: | H:

92.3 KB | W: | H:

document/public/imgs/image-5.png
document/public/imgs/image-5.png
document/public/imgs/image-5.png
document/public/imgs/image-5.png
  • 2-up
  • Swipe
  • Onion skin

259 KB | W: | H:

68.9 KB | W: | H:

document/public/imgs/image-60.png
document/public/imgs/image-60.png
document/public/imgs/image-60.png
document/public/imgs/image-60.png
  • 2-up
  • Swipe
  • Onion skin

288 KB | W: | H:

82.1 KB | W: | H:

document/public/imgs/image-64.png
document/public/imgs/image-64.png
document/public/imgs/image-64.png
document/public/imgs/image-64.png
  • 2-up
  • Swipe
  • Onion skin

279 KB | W: | H:

79.7 KB | W: | H:

document/public/imgs/image-67.png
document/public/imgs/image-67.png
document/public/imgs/image-67.png
document/public/imgs/image-67.png
  • 2-up
  • Swipe
  • Onion skin

288 KB | W: | H:

99.1 KB | W: | H:

document/public/imgs/image-7.png
document/public/imgs/image-7.png
document/public/imgs/image-7.png
document/public/imgs/image-7.png
  • 2-up
  • Swipe
  • Onion skin

273 KB | W: | H:

61.7 KB | W: | H:

document/public/imgs/image-71.png
document/public/imgs/image-71.png
document/public/imgs/image-71.png
document/public/imgs/image-71.png
  • 2-up
  • Swipe
  • Onion skin

257 KB | W: | H:

85.5 KB | W: | H:

document/public/imgs/image-91.png
document/public/imgs/image-91.png
document/public/imgs/image-91.png
document/public/imgs/image-91.png
  • 2-up
  • Swipe
  • Onion skin

253 KB | W: | H:

69.7 KB | W: | H:

document/public/imgs/image-97.png
document/public/imgs/image-97.png
document/public/imgs/image-97.png
document/public/imgs/image-97.png
  • 2-up
  • Swipe
  • Onion skin

185 KB | W: | H:

58 KB | W: | H:

document/public/imgs/mcp_tools3.png
document/public/imgs/mcp_tools3.png
document/public/imgs/mcp_tools3.png
document/public/imgs/mcp_tools3.png
  • 2-up
  • Swipe
  • Onion skin

183 KB | W: | H:

64 KB | W: | H:

document/public/imgs/mcp_tools4.png
document/public/imgs/mcp_tools4.png
document/public/imgs/mcp_tools4.png
document/public/imgs/mcp_tools4.png
  • 2-up
  • Swipe
  • Onion skin

182 KB | W: | H:

60.4 KB | W: | H:

document/public/imgs/mcp_tools5.png
document/public/imgs/mcp_tools5.png
document/public/imgs/mcp_tools5.png
document/public/imgs/mcp_tools5.png
  • 2-up
  • Swipe
  • Onion skin

204 KB | W: | H:

66.8 KB | W: | H:

document/public/imgs/mcp_tools6.png
document/public/imgs/mcp_tools6.png
document/public/imgs/mcp_tools6.png
document/public/imgs/mcp_tools6.png
  • 2-up
  • Swipe
  • Onion skin

195 KB | W: | H:

74.4 KB | W: | H:

document/public/imgs/mcp_tools7.png
document/public/imgs/mcp_tools7.png
document/public/imgs/mcp_tools7.png
document/public/imgs/mcp_tools7.png
  • 2-up
  • Swipe
  • Onion skin

253 KB | W: | H:

89.4 KB | W: | H:

document/public/imgs/mcp_tools8.png
document/public/imgs/mcp_tools8.png
document/public/imgs/mcp_tools8.png
document/public/imgs/mcp_tools8.png
  • 2-up
  • Swipe
  • Onion skin

312 KB | W: | H:

69.3 KB | W: | H:

document/public/imgs/mineru1.png
document/public/imgs/mineru1.png
document/public/imgs/mineru1.png
document/public/imgs/mineru1.png
  • 2-up
  • Swipe
  • Onion skin

518 KB | W: | H:

161 KB | W: | H:

document/public/imgs/mineru3-1.png
document/public/imgs/mineru3-1.png
document/public/imgs/mineru3-1.png
document/public/imgs/mineru3-1.png
  • 2-up
  • Swipe
  • Onion skin

666 KB | W: | H:

250 KB | W: | H:

document/public/imgs/mineru3.png
document/public/imgs/mineru3.png
document/public/imgs/mineru3.png
document/public/imgs/mineru3.png
  • 2-up
  • Swipe
  • Onion skin

443 KB | W: | H:

140 KB | W: | H:

document/public/imgs/mineru4-1.png
document/public/imgs/mineru4-1.png
document/public/imgs/mineru4-1.png
document/public/imgs/mineru4-1.png
  • 2-up
  • Swipe
  • Onion skin

264 KB | W: | H:

87.2 KB | W: | H:

document/public/imgs/mineru5.png
document/public/imgs/mineru5.png
document/public/imgs/mineru5.png
document/public/imgs/mineru5.png
  • 2-up
  • Swipe
  • Onion skin

419 KB | W: | H:

105 KB | W: | H:

document/public/imgs/mineru6.png
document/public/imgs/mineru6.png
document/public/imgs/mineru6.png
document/public/imgs/mineru6.png
  • 2-up
  • Swipe
  • Onion skin

206 KB | W: | H:

206 KB | W: | H:

document/public/imgs/model-m3e3.png
document/public/imgs/model-m3e3.png
document/public/imgs/model-m3e3.png
document/public/imgs/model-m3e3.png
  • 2-up
  • Swipe
  • Onion skin

226 KB | W: | H:

53.5 KB | W: | H:

document/public/imgs/plugin-openapi2.png
document/public/imgs/plugin-openapi2.png
document/public/imgs/plugin-openapi2.png
document/public/imgs/plugin-openapi2.png
  • 2-up
  • Swipe
  • Onion skin

275 KB | W: | H:

75.6 KB | W: | H:

document/public/imgs/plugin_submission2.png
document/public/imgs/plugin_submission2.png
document/public/imgs/plugin_submission2.png
document/public/imgs/plugin_submission2.png
  • 2-up
  • Swipe
  • Onion skin

181 KB | W: | H:

47.7 KB | W: | H:

document/public/imgs/plugin_submission7.png
document/public/imgs/plugin_submission7.png
document/public/imgs/plugin_submission7.png
document/public/imgs/plugin_submission7.png
  • 2-up
  • Swipe
  • Onion skin

284 KB | W: | H:

76.6 KB | W: | H:

document/public/imgs/sealos-redis1.png
document/public/imgs/sealos-redis1.png
document/public/imgs/sealos-redis1.png
document/public/imgs/sealos-redis1.png
  • 2-up
  • Swipe
  • Onion skin

199 KB | W: | H:

199 KB | W: | H:

document/public/imgs/searxng_plugin_guide1.png
document/public/imgs/searxng_plugin_guide1.png
document/public/imgs/searxng_plugin_guide1.png
document/public/imgs/searxng_plugin_guide1.png
  • 2-up
  • Swipe
  • Onion skin

255 KB | W: | H:

63.9 KB | W: | H:

document/public/imgs/sso2.png
document/public/imgs/sso2.png
document/public/imgs/sso2.png
document/public/imgs/sso2.png
  • 2-up
  • Swipe
  • Onion skin

265 KB | W: | H:

68.8 KB | W: | H:

document/public/imgs/teammode.png
document/public/imgs/teammode.png
document/public/imgs/teammode.png
document/public/imgs/teammode.png
  • 2-up
  • Swipe
  • Onion skin

228 KB | W: | H:

98.5 KB | W: | H:

document/public/imgs/thirddataset-10.png
document/public/imgs/thirddataset-10.png
document/public/imgs/thirddataset-10.png
document/public/imgs/thirddataset-10.png
  • 2-up
  • Swipe
  • Onion skin

206 KB | W: | H:

90.7 KB | W: | H:

document/public/imgs/thirddataset-19.png
document/public/imgs/thirddataset-19.png
document/public/imgs/thirddataset-19.png
document/public/imgs/thirddataset-19.png
  • 2-up
  • Swipe
  • Onion skin

207 KB | W: | H:

89.6 KB | W: | H:

document/public/imgs/thirddataset-2.png
document/public/imgs/thirddataset-2.png
document/public/imgs/thirddataset-2.png
document/public/imgs/thirddataset-2.png
  • 2-up
  • Swipe
  • Onion skin

188 KB | W: | H:

82.7 KB | W: | H:

document/public/imgs/thirddataset-20.png
document/public/imgs/thirddataset-20.png
document/public/imgs/thirddataset-20.png
document/public/imgs/thirddataset-20.png
  • 2-up
  • Swipe
  • Onion skin

197 KB | W: | H:

85.3 KB | W: | H:

document/public/imgs/thirddataset-21.png
document/public/imgs/thirddataset-21.png
document/public/imgs/thirddataset-21.png
document/public/imgs/thirddataset-21.png
  • 2-up
  • Swipe
  • Onion skin

282 KB | W: | H:

87.1 KB | W: | H:

document/public/imgs/translate17.png
document/public/imgs/translate17.png
document/public/imgs/translate17.png
document/public/imgs/translate17.png
  • 2-up
  • Swipe
  • Onion skin

288 KB | W: | H:

108 KB | W: | H:

document/public/imgs/translate2.png
document/public/imgs/translate2.png
document/public/imgs/translate2.png
document/public/imgs/translate2.png
  • 2-up
  • Swipe
  • Onion skin

179 KB | W: | H:

59.3 KB | W: | H:

document/public/imgs/variable_update5.png
document/public/imgs/variable_update5.png
document/public/imgs/variable_update5.png
document/public/imgs/variable_update5.png
  • 2-up
  • Swipe
  • Onion skin

250 KB | W: | H:

102 KB | W: | H:

document/public/imgs/webSync4.jpg
document/public/imgs/webSync4.jpg
document/public/imgs/webSync4.jpg
document/public/imgs/webSync4.jpg
  • 2-up
  • Swipe
  • Onion skin

304 KB | W: | H:

114 KB | W: | H:

document/public/imgs/wecom-bot-10.png
document/public/imgs/wecom-bot-10.png
document/public/imgs/wecom-bot-10.png
document/public/imgs/wecom-bot-10.png
  • 2-up
  • Swipe
  • Onion skin

227 KB | W: | H:

62 KB | W: | H:

document/public/imgs/wecom-bot-19.png
document/public/imgs/wecom-bot-19.png
document/public/imgs/wecom-bot-19.png
document/public/imgs/wecom-bot-19.png
  • 2-up
  • Swipe
  • Onion skin

444 KB | W: | H:

192 KB | W: | H:

document/public/imgs/wecom-bot-2.png
document/public/imgs/wecom-bot-2.png
document/public/imgs/wecom-bot-2.png
document/public/imgs/wecom-bot-2.png
  • 2-up
  • Swipe
  • Onion skin

341 KB | W: | H:

114 KB | W: | H:

document/public/imgs/wecom-bot-4.png
document/public/imgs/wecom-bot-4.png
document/public/imgs/wecom-bot-4.png
document/public/imgs/wecom-bot-4.png
  • 2-up
  • Swipe
  • Onion skin

281 KB | W: | H:

97.2 KB | W: | H:

document/public/imgs/wecom-bot-5.png
document/public/imgs/wecom-bot-5.png
document/public/imgs/wecom-bot-5.png
document/public/imgs/wecom-bot-5.png
  • 2-up
  • Swipe
  • Onion skin

305 KB | W: | H:

108 KB | W: | H:

document/public/imgs/wecom-bot-9.png
document/public/imgs/wecom-bot-9.png
document/public/imgs/wecom-bot-9.png
document/public/imgs/wecom-bot-9.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -141,6 +141,7 @@ export const runWorkflow = async (data: RunWorkflowProps): Promise<DispatchFlowR ...@@ -141,6 +141,7 @@ export const runWorkflow = async (data: RunWorkflowProps): Promise<DispatchFlowR
flowUsages: [], flowUsages: [],
debugResponse: { debugResponse: {
memoryEdges: [], memoryEdges: [],
memoryNodes: [],
entryNodeIds: [], entryNodeIds: [],
nodeResponses: {}, nodeResponses: {},
skipNodeQueue: [] skipNodeQueue: []
...@@ -850,6 +851,7 @@ export const runWorkflow = async (data: RunWorkflowProps): Promise<DispatchFlowR ...@@ -850,6 +851,7 @@ export const runWorkflow = async (data: RunWorkflowProps): Promise<DispatchFlowR
...edge, ...edge,
status: entryNodeIds.includes(edge.target) ? 'active' : edge.status status: entryNodeIds.includes(edge.target) ? 'active' : edge.status
})), })),
memoryNodes: Array.from(this.runtimeNodesMap.values()),
entryNodeIds, entryNodeIds,
nodeResponses: this.debugNodeResponses, nodeResponses: this.debugNodeResponses,
skipNodeQueue: Array.from(this.skipNodeQueue.values()).map((item) => ({ skipNodeQueue: Array.from(this.skipNodeQueue.values()).map((item) => ({
......
...@@ -15,6 +15,7 @@ import type { ChatNodeUsageType } from '@fastgpt/global/support/wallet/bill/type ...@@ -15,6 +15,7 @@ import type { ChatNodeUsageType } from '@fastgpt/global/support/wallet/bill/type
export type WorkflowDebugResponse = { export type WorkflowDebugResponse = {
memoryEdges: RuntimeEdgeItemType[]; memoryEdges: RuntimeEdgeItemType[];
memoryNodes: RuntimeNodeItemType[];
entryNodeIds: string[]; // Next step entry nodes entryNodeIds: string[]; // Next step entry nodes
nodeResponses: Record< nodeResponses: Record<
string, string,
......
...@@ -707,7 +707,6 @@ ...@@ -707,7 +707,6 @@
"core.workflow.Custom outputs": "Custom Outputs", "core.workflow.Custom outputs": "Custom Outputs",
"core.workflow.Dataset quote": "Dataset Quote", "core.workflow.Dataset quote": "Dataset Quote",
"core.workflow.Debug": "Debug", "core.workflow.Debug": "Debug",
"core.workflow.Debug Node": "Debug Mode",
"core.workflow.Failed": "Run Failed", "core.workflow.Failed": "Run Failed",
"core.workflow.Not intro": "This Node Has No Introduction", "core.workflow.Not intro": "This Node Has No Introduction",
"core.workflow.Run": "Run", "core.workflow.Run": "Run",
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
"dataset_quote_role_system_option_desc": "Historical records should be consistent first (recommended)", "dataset_quote_role_system_option_desc": "Historical records should be consistent first (recommended)",
"dataset_quote_role_tip": "When set to System, the knowledge base reference content will be placed in the system message, which can ensure the continuity of the history record, but the constraint effect may not be good.\n\nWhen set to User, the knowledge base reference content will be placed in the user message, and the {{question}} variable location needs to be specified. \nIt will have a certain impact on the consistency of historical records, but usually the constraint effect is better.", "dataset_quote_role_tip": "When set to System, the knowledge base reference content will be placed in the system message, which can ensure the continuity of the history record, but the constraint effect may not be good.\n\nWhen set to User, the knowledge base reference content will be placed in the user message, and the {{question}} variable location needs to be specified. \nIt will have a certain impact on the consistency of historical records, but usually the constraint effect is better.",
"dataset_quote_role_user_option_desc": "Strong constraints take precedence", "dataset_quote_role_user_option_desc": "Strong constraints take precedence",
"debug_test": "Debug debugging",
"dynamic_input_description": "Receive the output value of the previous node as a variable, which can be used by Laf request parameters.", "dynamic_input_description": "Receive the output value of the previous node as a variable, which can be used by Laf request parameters.",
"edit_input": "Edit Input", "edit_input": "Edit Input",
"edit_output": "Edit output", "edit_output": "Edit output",
......
{ {
"AI_input_is_empty": "传入AI 节点的内容为空", "AI_input_is_empty": "传入 AI 节点的内容为空",
"Delete_all": "清空词库", "Delete_all": "清空词库",
"LLM_model_response_empty": "模型流响应为空,请检查模型流输出是否正常", "LLM_model_response_empty": "模型流响应为空,请检查模型流输出是否正常",
"ai_reasoning": "思考过程", "ai_reasoning": "思考过程",
......
...@@ -707,7 +707,6 @@ ...@@ -707,7 +707,6 @@
"core.workflow.Custom outputs": "自定义输出", "core.workflow.Custom outputs": "自定义输出",
"core.workflow.Dataset quote": "知识库引用", "core.workflow.Dataset quote": "知识库引用",
"core.workflow.Debug": "调试", "core.workflow.Debug": "调试",
"core.workflow.Debug Node": "Debug 模式",
"core.workflow.Failed": "运行失败", "core.workflow.Failed": "运行失败",
"core.workflow.Not intro": "这个节点没有介绍~", "core.workflow.Not intro": "这个节点没有介绍~",
"core.workflow.Run": "运行", "core.workflow.Run": "运行",
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
"dataset_quote_role_system_option_desc": "历史记录连贯优先(推荐)", "dataset_quote_role_system_option_desc": "历史记录连贯优先(推荐)",
"dataset_quote_role_tip": "设置为 System 时,将会把知识库引用内容放置到 system 消息中,可以确保历史记录的连贯性,但约束效果可能不佳,需要多调试。\n设置为 User 时,将会把知识库引用内容放置到 user 消息中,并且需要指定 {{question}} 变量位置。会对历史记录连贯性有一定影响,但通常约束效果更优。", "dataset_quote_role_tip": "设置为 System 时,将会把知识库引用内容放置到 system 消息中,可以确保历史记录的连贯性,但约束效果可能不佳,需要多调试。\n设置为 User 时,将会把知识库引用内容放置到 user 消息中,并且需要指定 {{question}} 变量位置。会对历史记录连贯性有一定影响,但通常约束效果更优。",
"dataset_quote_role_user_option_desc": "强约束优先", "dataset_quote_role_user_option_desc": "强约束优先",
"debug_test": "Debug 调试",
"dynamic_input_description": "接收前方节点的输出值作为变量,这些变量可以被 Laf 请求参数使用。", "dynamic_input_description": "接收前方节点的输出值作为变量,这些变量可以被 Laf 请求参数使用。",
"edit_input": "编辑输入", "edit_input": "编辑输入",
"edit_output": "编辑输出", "edit_output": "编辑输出",
......
...@@ -706,7 +706,6 @@ ...@@ -706,7 +706,6 @@
"core.workflow.Custom outputs": "自訂輸出", "core.workflow.Custom outputs": "自訂輸出",
"core.workflow.Dataset quote": "知識庫引用", "core.workflow.Dataset quote": "知識庫引用",
"core.workflow.Debug": "除錯", "core.workflow.Debug": "除錯",
"core.workflow.Debug Node": "除錯模式",
"core.workflow.Failed": "執行失敗", "core.workflow.Failed": "執行失敗",
"core.workflow.Not intro": "此節點沒有介紹", "core.workflow.Not intro": "此節點沒有介紹",
"core.workflow.Run": "執行", "core.workflow.Run": "執行",
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
"dataset_quote_role_system_option_desc": "歷史紀錄連貫優先(建議)", "dataset_quote_role_system_option_desc": "歷史紀錄連貫優先(建議)",
"dataset_quote_role_tip": "設定為 System 時,會將知識庫引用內容放置到系統訊息中,可以確保歷史紀錄的連貫性,但約束效果可能不佳。\n設定為 User 時,會將知識庫引用內容放置到使用者訊息中,並且需要指定 {{question}} 變數位置。會對歷史紀錄連貫性有一定影響,但通常約束效果較佳。", "dataset_quote_role_tip": "設定為 System 時,會將知識庫引用內容放置到系統訊息中,可以確保歷史紀錄的連貫性,但約束效果可能不佳。\n設定為 User 時,會將知識庫引用內容放置到使用者訊息中,並且需要指定 {{question}} 變數位置。會對歷史紀錄連貫性有一定影響,但通常約束效果較佳。",
"dataset_quote_role_user_option_desc": "強約束優先", "dataset_quote_role_user_option_desc": "強約束優先",
"debug_test": "Debug 調試",
"dynamic_input_description": "接收前一個節點的輸出值作為變數,這些變數可以被 Laf 請求參數使用。", "dynamic_input_description": "接收前一個節點的輸出值作為變數,這些變數可以被 Laf 請求參數使用。",
"edit_input": "編輯輸入", "edit_input": "編輯輸入",
"edit_output": "編輯輸出", "edit_output": "編輯輸出",
......
...@@ -53,7 +53,7 @@ const LabelAndFormRender = ({ ...@@ -53,7 +53,7 @@ const LabelAndFormRender = ({
return ( return (
<Box _notLast={{ mb: 4 }}> <Box _notLast={{ mb: 4 }}>
<Flex alignItems={'center'} mb={1}> <Flex alignItems={'center'} mb={1}>
{typeof label === 'string' ? <FormLabel required={required}>{label}</FormLabel> : label} {typeof label === 'string' ? <FormLabel required={required}>{t(label)}</FormLabel> : label}
{placeholder && <QuestionTip ml={1} label={placeholder} />} {placeholder && <QuestionTip ml={1} label={placeholder} />}
</Flex> </Flex>
......
...@@ -64,6 +64,7 @@ const ChatInput = ({ ...@@ -64,6 +64,7 @@ const ChatInput = ({
const chatInputGuide = useContextSelector(ChatBoxContext, (v) => v.chatInputGuide); const chatInputGuide = useContextSelector(ChatBoxContext, (v) => v.chatInputGuide);
const fileSelectConfig = useContextSelector(ChatBoxContext, (v) => v.fileSelectConfig); const fileSelectConfig = useContextSelector(ChatBoxContext, (v) => v.fileSelectConfig);
const dialogTips = useContextSelector(ChatBoxContext, (v) => v.dialogTips); const dialogTips = useContextSelector(ChatBoxContext, (v) => v.dialogTips);
const autoTTSResponse = useContextSelector(ChatBoxContext, (v) => v.autoTTSResponse);
const fileCtrl = useFieldArray({ const fileCtrl = useFieldArray({
control, control,
...@@ -448,7 +449,8 @@ const ChatInput = ({ ...@@ -448,7 +449,8 @@ const ChatInput = ({
handleSend={(text) => { handleSend={(text) => {
onSendMessage({ onSendMessage({
text: text.trim(), text: text.trim(),
files: fileList files: fileList,
autoTTSResponse
}); });
replaceFiles([]); replaceFiles([]);
}} }}
......
...@@ -46,7 +46,6 @@ export type ChatProviderProps = { ...@@ -46,7 +46,6 @@ export type ChatProviderProps = {
type useChatStoreType = ChatProviderProps & { type useChatStoreType = ChatProviderProps & {
welcomeText: string; welcomeText: string;
variableList: VariableItemType[]; variableList: VariableItemType[];
allVariableList: VariableItemType[];
questionGuide: AppQGConfigType; questionGuide: AppQGConfigType;
ttsConfig: AppTTSConfigType; ttsConfig: AppTTSConfigType;
whisperConfig: AppWhisperConfigType; whisperConfig: AppWhisperConfigType;
...@@ -238,10 +237,7 @@ const Provider = ({ ...@@ -238,10 +237,7 @@ const Provider = ({
const value: useChatStoreType = { const value: useChatStoreType = {
...props, ...props,
welcomeText, welcomeText,
variableList: variables.filter( variableList: variables,
(item) => item.type !== VariableInputEnum.custom && item.type !== VariableInputEnum.internal
),
allVariableList: variables,
questionGuide, questionGuide,
ttsConfig, ttsConfig,
fileSelectConfig, fileSelectConfig,
......
import React, { useEffect, useMemo } from 'react'; import React, { useMemo } from 'react';
import { type UseFormReturn } from 'react-hook-form'; import { type UseFormReturn } from 'react-hook-form';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { Box, Button, Card, Flex } from '@chakra-ui/react'; import { Box, Button, Card, Flex } from '@chakra-ui/react';
...@@ -152,6 +152,19 @@ const VariableInput = ({ ...@@ -152,6 +152,19 @@ const VariableInput = ({
/> />
); );
})} })}
{!chatStarted && commonVariableList.length === 0 && (
<Button
leftIcon={<MyIcon name={'core/chat/chatFill'} w={'16px'} />}
size={'sm'}
maxW={'100px'}
mt={4}
onClick={variablesForm.handleSubmit(() => {
chatForm.setValue('chatStarted', true);
})}
>
{t('chat:start_chat')}
</Button>
)}
</Card> </Card>
</Box> </Box>
)} )}
......
...@@ -20,7 +20,12 @@ const ChatHomeVariablesForm = ({ chatForm }: Props) => { ...@@ -20,7 +20,12 @@ const ChatHomeVariablesForm = ({ chatForm }: Props) => {
const variablesForm = useContextSelector(ChatItemContext, (v) => v.variablesForm); const variablesForm = useContextSelector(ChatItemContext, (v) => v.variablesForm);
const variableList = useContextSelector(ChatBoxContext, (v) => v.variableList); const variableList = useContextSelector(ChatBoxContext, (v) => v.variableList);
const allVariableList = useContextSelector(ChatBoxContext, (v) => v.allVariableList); const externalVariableList = variableList.filter(
(item) => item.type === VariableInputEnum.custom
);
const commonVariableList = variableList.filter(
(item) => item.type !== VariableInputEnum.custom && item.type !== VariableInputEnum.internal
);
return ( return (
<Card <Card
...@@ -31,27 +36,25 @@ const ChatHomeVariablesForm = ({ chatForm }: Props) => { ...@@ -31,27 +36,25 @@ const ChatHomeVariablesForm = ({ chatForm }: Props) => {
> >
<Box p={3}> <Box p={3}>
{/* custom variables */} {/* custom variables */}
{allVariableList.filter((i) => i.type === VariableInputEnum.custom).length > 0 && ( {externalVariableList.length > 0 && (
<> <>
{allVariableList {externalVariableList.map((item) => (
.filter((i) => i.type === VariableInputEnum.custom) <LabelAndFormRender
.map((item) => ( {...item}
<LabelAndFormRender key={item.key}
{...item} fieldName={`variables.${item.key}`}
key={item.key} placeholder={item.description}
fieldName={`variables.${item.key}`} inputType={variableInputTypeToInputType(item.type, item.valueType)}
placeholder={item.description} form={variablesForm}
inputType={variableInputTypeToInputType(item.type, item.valueType)} bg={'myGray.50'}
form={variablesForm} />
bg={'myGray.50'} ))}
/>
))}
</> </>
)} )}
{/* normal variables */} {/* normal variables */}
{variableList.length > 0 && ( {commonVariableList.length > 0 && (
<> <>
{variableList.map((item) => ( {commonVariableList.map((item) => (
<LabelAndFormRender <LabelAndFormRender
{...item} {...item}
key={item.key} key={item.key}
......
...@@ -144,7 +144,6 @@ const ChatBox = ({ ...@@ -144,7 +144,6 @@ const ChatBox = ({
const outLinkAuthData = useContextSelector(ChatBoxContext, (v) => v.outLinkAuthData); const outLinkAuthData = useContextSelector(ChatBoxContext, (v) => v.outLinkAuthData);
const welcomeText = useContextSelector(ChatBoxContext, (v) => v.welcomeText); const welcomeText = useContextSelector(ChatBoxContext, (v) => v.welcomeText);
const variableList = useContextSelector(ChatBoxContext, (v) => v.variableList); const variableList = useContextSelector(ChatBoxContext, (v) => v.variableList);
const allVariableList = useContextSelector(ChatBoxContext, (v) => v.allVariableList);
const questionGuide = useContextSelector(ChatBoxContext, (v) => v.questionGuide); const questionGuide = useContextSelector(ChatBoxContext, (v) => v.questionGuide);
const startSegmentedAudio = useContextSelector(ChatBoxContext, (v) => v.startSegmentedAudio); const startSegmentedAudio = useContextSelector(ChatBoxContext, (v) => v.startSegmentedAudio);
const finishSegmentedAudio = useContextSelector(ChatBoxContext, (v) => v.finishSegmentedAudio); const finishSegmentedAudio = useContextSelector(ChatBoxContext, (v) => v.finishSegmentedAudio);
...@@ -156,11 +155,14 @@ const ChatBox = ({ ...@@ -156,11 +155,14 @@ const ChatBox = ({
const isInteractive = useMemo(() => checkIsInteractiveByHistories(chatRecords), [chatRecords]); const isInteractive = useMemo(() => checkIsInteractiveByHistories(chatRecords), [chatRecords]);
const showExternalVariable = useMemo(() => { const showExternalVariable = useMemo(() => {
return ( const map: Record<string, boolean> = {
[ChatTypeEnum.log, ChatTypeEnum.test, ChatTypeEnum.chat].includes(chatType) && [ChatTypeEnum.log]: true,
allVariableList.some((item) => item.type === VariableInputEnum.custom) [ChatTypeEnum.test]: true,
); [ChatTypeEnum.chat]: true,
}, [allVariableList, chatType]); [ChatTypeEnum.home]: true
};
return map[chatType] && variableList.some((item) => item.type === VariableInputEnum.custom);
}, [variableList, chatType]);
// compute variable input is finish. // compute variable input is finish.
const chatForm = useForm<ChatBoxInputFormType>({ const chatForm = useForm<ChatBoxInputFormType>({
...@@ -173,10 +175,20 @@ const ChatBox = ({ ...@@ -173,10 +175,20 @@ const ChatBox = ({
const { setValue, watch } = chatForm; const { setValue, watch } = chatForm;
const chatStartedWatch = watch('chatStarted'); const chatStartedWatch = watch('chatStarted');
// 可以进入对话框对话 const commonVariableList = variableList.filter(
(item) => item.type !== VariableInputEnum.custom && item.type !== VariableInputEnum.internal
);
/*
对话已经开始的标记:
1. 保证 appId 一致。
2. 有对话记录/手动点了开始/默认没有需要填写的变量。
*/
const chatStarted = const chatStarted =
chatBoxData?.appId === appId && chatBoxData?.appId === appId &&
(chatRecords.length > 0 || chatStartedWatch || variableList.length === 0); (chatRecords.length > 0 ||
chatStartedWatch ||
(commonVariableList.length === 0 && !showExternalVariable));
// 滚动到底部 // 滚动到底部
const scrollToBottom = useMemoizedFn((behavior: 'smooth' | 'auto' = 'smooth', delay = 0) => { const scrollToBottom = useMemoizedFn((behavior: 'smooth' | 'auto' = 'smooth', delay = 0) => {
...@@ -449,7 +461,7 @@ const ChatBox = ({ ...@@ -449,7 +461,7 @@ const ChatBox = ({
// Only declared variables are kept // Only declared variables are kept
const requestVariables: Record<string, any> = {}; const requestVariables: Record<string, any> = {};
allVariableList?.forEach((item) => { variableList?.forEach((item) => {
const val = const val =
variables[item.key] === '' || variables[item.key] === '' ||
variables[item.key] === undefined || variables[item.key] === undefined ||
...@@ -827,7 +839,7 @@ const ChatBox = ({ ...@@ -827,7 +839,7 @@ const ChatBox = ({
feConfigs?.show_emptyChat && feConfigs?.show_emptyChat &&
showEmptyIntro && showEmptyIntro &&
chatRecords.length === 0 && chatRecords.length === 0 &&
!variableList?.length && !commonVariableList?.length &&
!showExternalVariable && !showExternalVariable &&
!welcomeText, !welcomeText,
[ [
...@@ -835,7 +847,7 @@ const ChatBox = ({ ...@@ -835,7 +847,7 @@ const ChatBox = ({
feConfigs?.show_emptyChat, feConfigs?.show_emptyChat,
showEmptyIntro, showEmptyIntro,
chatRecords.length, chatRecords.length,
variableList?.length, commonVariableList?.length,
showExternalVariable, showExternalVariable,
welcomeText welcomeText
] ]
...@@ -1126,8 +1138,7 @@ const ChatBox = ({ ...@@ -1126,8 +1138,7 @@ const ChatBox = ({
> >
<Flex h={'100%'} flexDir={'column'} justifyContent={'center'} w={'100%'}> <Flex h={'100%'} flexDir={'column'} justifyContent={'center'} w={'100%'}>
{HomeChatRenderBox} {HomeChatRenderBox}
{allVariableList.filter((item) => item.type !== VariableInputEnum.internal).length > {variableList.filter((item) => item.type !== VariableInputEnum.internal).length > 0 ? (
0 ? (
<Box w={'100%'}> <Box w={'100%'}>
<ChatHomeVariablesForm chatForm={chatForm} /> <ChatHomeVariablesForm chatForm={chatForm} />
</Box> </Box>
......
...@@ -30,6 +30,7 @@ import { ...@@ -30,6 +30,7 @@ import {
nodeInputTypeToInputType, nodeInputTypeToInputType,
variableInputTypeToInputType variableInputTypeToInputType
} from '@/components/core/app/formRender/utils'; } from '@/components/core/app/formRender/utils';
import { useSafeTranslation } from '@fastgpt/web/hooks/useSafeTranslation';
const MyRightDrawer = dynamic( const MyRightDrawer = dynamic(
() => import('@fastgpt/web/components/common/MyDrawer/MyRightDrawer') () => import('@fastgpt/web/components/common/MyDrawer/MyRightDrawer')
...@@ -41,7 +42,7 @@ enum TabEnum { ...@@ -41,7 +42,7 @@ enum TabEnum {
} }
export const useDebug = () => { export const useDebug = () => {
const { t } = useTranslation(); const { t } = useSafeTranslation();
const { toast } = useToast(); const { toast } = useToast();
const setNodes = useContextSelector(WorkflowNodeEdgeContext, (v) => v.setNodes); const setNodes = useContextSelector(WorkflowNodeEdgeContext, (v) => v.setNodes);
...@@ -241,8 +242,8 @@ export const useDebug = () => { ...@@ -241,8 +242,8 @@ export const useDebug = () => {
<MyRightDrawer <MyRightDrawer
onClose={onClose} onClose={onClose}
iconSrc="core/workflow/debugBlue" iconSrc="core/workflow/debugBlue"
title={t('common:core.workflow.Debug Node')} title={t('workflow:debug_test')}
maxW={['90vw', '35vw']} maxW={['90vw', '40vw']}
px={0} px={0}
> >
<Box flex={'1 0 0'} overflow={'auto'} px={6}> <Box flex={'1 0 0'} overflow={'auto'} px={6}>
...@@ -260,12 +261,27 @@ export const useDebug = () => { ...@@ -260,12 +261,27 @@ export const useDebug = () => {
onChange={setCurrentTab} onChange={setCurrentTab}
/> />
)} )}
<Box display={currentTab === TabEnum.node ? 'block' : 'none'}>
{renderInputs.map((item) => (
<LabelAndFormRender
key={item.key}
label={item.label}
required={item.required}
placeholder={t(item.placeholder || item.description)}
inputType={nodeInputTypeToInputType(item.renderTypeList)}
form={variablesForm}
fieldName={`nodeVariables.${item.key}`}
bg={'myGray.50'}
/>
))}
</Box>
<Box display={currentTab === TabEnum.global ? 'block' : 'none'}> <Box display={currentTab === TabEnum.global ? 'block' : 'none'}>
{customVar.map((item) => ( {customVar.map((item) => (
<LabelAndFormRender <LabelAndFormRender
{...item}
key={item.key} key={item.key}
placeholder={item.description} label={item.label}
required={item.required}
placeholder={t(item.description)}
inputType={variableInputTypeToInputType(item.type)} inputType={variableInputTypeToInputType(item.type)}
form={variablesForm} form={variablesForm}
fieldName={`variables.${item.key}`} fieldName={`variables.${item.key}`}
...@@ -274,9 +290,10 @@ export const useDebug = () => { ...@@ -274,9 +290,10 @@ export const useDebug = () => {
))} ))}
{internalVar.map((item) => ( {internalVar.map((item) => (
<LabelAndFormRender <LabelAndFormRender
{...item}
key={item.key} key={item.key}
placeholder={item.description} label={item.label}
required={item.required}
placeholder={t(item.description)}
inputType={variableInputTypeToInputType(item.type)} inputType={variableInputTypeToInputType(item.type)}
form={variablesForm} form={variablesForm}
fieldName={`variables.${item.key}`} fieldName={`variables.${item.key}`}
...@@ -285,8 +302,9 @@ export const useDebug = () => { ...@@ -285,8 +302,9 @@ export const useDebug = () => {
))} ))}
{filteredVar.map((item) => ( {filteredVar.map((item) => (
<LabelAndFormRender <LabelAndFormRender
{...item}
key={item.key} key={item.key}
label={item.label}
required={item.required}
placeholder={item.description} placeholder={item.description}
inputType={variableInputTypeToInputType(item.type)} inputType={variableInputTypeToInputType(item.type)}
form={variablesForm} form={variablesForm}
...@@ -295,19 +313,6 @@ export const useDebug = () => { ...@@ -295,19 +313,6 @@ export const useDebug = () => {
/> />
))} ))}
</Box> </Box>
<Box display={currentTab === TabEnum.node ? 'block' : 'none'}>
{renderInputs.map((item) => (
<LabelAndFormRender
{...item}
key={item.key}
placeholder={item.placeholder || item.description}
inputType={nodeInputTypeToInputType(item.renderTypeList)}
form={variablesForm}
fieldName={`nodeVariables.${item.key}`}
bg={'myGray.50'}
/>
))}
</Box>
</Box> </Box>
<Flex py={2} justifyContent={'flex-end'} px={6}> <Flex py={2} justifyContent={'flex-end'} px={6}>
<Button onClick={handleSubmit(onClickRun, onCheckRunError)}>{t('common:Run')}</Button> <Button onClick={handleSubmit(onClickRun, onCheckRunError)}>{t('common:Run')}</Button>
......
...@@ -514,7 +514,8 @@ const MenuRender = React.memo(function MenuRender({ ...@@ -514,7 +514,8 @@ const MenuRender = React.memo(function MenuRender({
version: template.version, version: template.version,
versionLabel: template.versionLabel, versionLabel: template.versionLabel,
isLatestVersion: template.isLatestVersion, isLatestVersion: template.isLatestVersion,
toolConfig: template.toolConfig toolConfig: template.toolConfig,
catchError: template.catchError
}, },
selected: true, selected: true,
parentNodeId: undefined, parentNodeId: undefined,
......
...@@ -707,25 +707,31 @@ const WorkflowContextProvider = ({ ...@@ -707,25 +707,31 @@ const WorkflowContextProvider = ({
try { try {
// 3. Run one step // 3. Run one step
const { memoryEdges, entryNodeIds, skipNodeQueue, nodeResponses, newVariables } = const {
await postWorkflowDebug({ memoryEdges,
nodes: runtimeNodes, memoryNodes,
edges: debugData.runtimeEdges, entryNodeIds,
skipNodeQueue: debugData.skipNodeQueue, skipNodeQueue,
variables: { nodeResponses,
appId, newVariables
cTime: formatTime2YMDHMW(), } = await postWorkflowDebug({
...debugData.variables nodes: runtimeNodes,
}, edges: debugData.runtimeEdges,
query: debugData.query, // 添加 query 参数 skipNodeQueue: debugData.skipNodeQueue,
history: debugData.history, variables: {
appId, appId,
chatConfig: appDetail.chatConfig cTime: formatTime2YMDHMW(),
}); ...debugData.variables
},
query: debugData.query, // 添加 query 参数
history: debugData.history,
appId,
chatConfig: appDetail.chatConfig
});
// 4. Store debug result // 4. Store debug result
setWorkflowDebugData({ setWorkflowDebugData({
runtimeNodes: debugData.runtimeNodes, runtimeNodes: memoryNodes,
runtimeEdges: memoryEdges, runtimeEdges: memoryEdges,
entryNodeIds, entryNodeIds,
skipNodeQueue, skipNodeQueue,
...@@ -776,7 +782,7 @@ const WorkflowContextProvider = ({ ...@@ -776,7 +782,7 @@ const WorkflowContextProvider = ({
console.log(error); console.log(error);
} }
}, },
[appId, onChangeNode, setNodes] [appId, onChangeNode, setNodes, appDetail.chatConfig]
); );
const onStopNodeDebug = useMemoizedFn(() => { const onStopNodeDebug = useMemoizedFn(() => {
setWorkflowDebugData(undefined); setWorkflowDebugData(undefined);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment