mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-24 22:03:54 +00:00
4.8 preview (#1288)
* Revert "lafAccount add pat & re request when token invalid (#76)" (#77) This reverts commit 83d85dfe37adcaef4833385ea52ee79fd84720be. * perf: workflow ux * system config * Newflow (#89) * docs: Add doc for Xinference (#1266) Signed-off-by: Carson Yang <yangchuansheng33@gmail.com> * Revert "lafAccount add pat & re request when token invalid (#76)" (#77) This reverts commit 83d85dfe37adcaef4833385ea52ee79fd84720be. * perf: workflow ux * system config * Revert "lafAccount add pat & re request when token invalid (#76)" (#77) This reverts commit 83d85dfe37adcaef4833385ea52ee79fd84720be. * Revert "lafAccount add pat & re request when token invalid (#76)" (#77) This reverts commit 83d85dfe37adcaef4833385ea52ee79fd84720be. * Revert "lafAccount add pat & re request when token invalid (#76)" (#77) This reverts commit 83d85dfe37adcaef4833385ea52ee79fd84720be. * rename code * move code * update flow * input type selector * perf: workflow runtime * feat: node adapt newflow * feat: adapt plugin * feat: 360 connection * check workflow * perf: flow 性能 * change plugin input type (#81) * change plugin input type * plugin label mode * perf: nodecard * debug * perf: debug ui * connection ui * change workflow ui (#82) * feat: workflow debug * adapt openAPI for new workflow (#83) * adapt openAPI for new workflow * i18n * perf: plugin debug * plugin input ui * delete * perf: global variable select * fix rebase * perf: workflow performance * feat: input render type icon * input icon * adapt flow (#84) * adapt newflow * temp * temp * fix * feat: app schedule trigger * feat: app schedule trigger * perf: schedule ui * feat: ioslatevm run js code * perf: workflow varialbe table ui * feat: adapt simple mode * feat: adapt input params * output * feat: adapt tamplate * fix: ts * add if-else module (#86) * perf: worker * if else node * perf: tiktoken worker * fix: ts * perf: tiktoken * fix if-else node (#87) * fix if-else node * type * fix * perf: audio render * perf: Parallel worker * log * perf: if else node * adapt plugin * prompt * perf: reference ui * reference ui * handle ux * template ui and plugin tool * adapt v1 workflow * adapt v1 workflow completions * perf: time variables * feat: workflow keyboard shortcuts * adapt v1 workflow * update workflow example doc (#88) * fix: simple mode select tool --------- Signed-off-by: Carson Yang <yangchuansheng33@gmail.com> Co-authored-by: Carson Yang <yangchuansheng33@gmail.com> Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com> * doc * perf: extract node * extra node field * update plugin version * doc * variable * change doc & fix prompt editor (#90) * fold workflow code * value type label --------- Signed-off-by: Carson Yang <yangchuansheng33@gmail.com> Co-authored-by: Carson Yang <yangchuansheng33@gmail.com> Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
@@ -28,8 +28,8 @@ images: []
|
||||
|
||||
### 其他模型没法进行问题分类/内容提取
|
||||
|
||||
需要给其他模型配置`toolChoice=false`,就会默认走提示词模式。目前内置提示词仅针对了商业模型API进行测试。
|
||||
问题分类基本可用,内容提取不太行。
|
||||
1. 看日志。如果提示 JSON invalid,not support tool 之类的,说明该模型不支持工具调用或函数调用,需要设置`toolChoice=false`和`functionCall=false`,就会默认走提示词模式。目前内置提示词仅针对了商业模型API进行测试。问题分类基本可用,内容提取不太行。
|
||||
2. 如果已经配置正常,并且没有错误日志,则说明可能提示词不太适合该模型,可以通过修改`customCQPrompt`来自定义提示词。
|
||||
|
||||
### 页面崩溃
|
||||
|
||||
|
@@ -286,7 +286,7 @@ type ResponseType = {
|
||||
pluginOutput?: Record<string, any>; // 插件输出
|
||||
pluginDetail?: ChatHistoryItemResType[]; // 插件详情
|
||||
|
||||
tfSwitchResult?: boolean; // 判断器结果
|
||||
isElseResult?: boolean; // 判断器结果
|
||||
}
|
||||
```
|
||||
|
||||
|
25
docSite/content/docs/development/upgrading/48.md
Normal file
25
docSite/content/docs/development/upgrading/48.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: 'V4.8(进行中)'
|
||||
description: 'FastGPT V4.8 更新说明'
|
||||
icon: 'upgrade'
|
||||
draft: false
|
||||
toc: true
|
||||
weight: 824
|
||||
---
|
||||
|
||||
## 新工作流
|
||||
|
||||
FastGPT workflow V2上线,支持更加简洁的工作流模式。
|
||||
|
||||
**由于工作流差异较大,需要手动重新构建。**
|
||||
|
||||
给应用和插件增加了 version 的字段,用于标识是旧工作流还是新工作流。当你更新 4.8 后,保存和新建的工作流均为新版,旧版工作流会有一个重置的弹窗提示。并且,如果是通过 API 和 分享链接 调用的工作流,仍可以正常使用,直到你下次保存它们。
|
||||
|
||||
## V4.8 更新说明
|
||||
|
||||
1. 重构 - 工作流
|
||||
2. 新增 - 工作流 Debug 模式,可以调试单个节点或者逐步调试工作流。
|
||||
3. 新增 - 定时执行应用。可轻松实现定时任务。
|
||||
4. 新增 - 插件自定义输入优化,可以渲染输入组件。
|
||||
5. 优化 - 工作流连线,可以四向连接,方便构建循环工作流。
|
||||
6. 优化 - worker进程管理,并将计算 Token 任务分配给 worker 进程。
|
@@ -9,7 +9,7 @@ weight: 404
|
||||
|
||||
| | |
|
||||
| --------------------- | --------------------- |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
## OpenAI Dalle3 接口
|
||||
|
||||
@@ -44,14 +44,14 @@ Response
|
||||
|
||||
## 编排思路
|
||||
|
||||
1. 通过 AI 来优化图片绘制的提示词(这部省略了,自己找提示词即可)
|
||||
2. 通过`HTTP 模块`调用 Dalle3 接口,获取图片的 URL。
|
||||
3. 通过`文本加工`来构建`Markdown`的图片格式。
|
||||
4. 通过`指定回复`来直接输出图片链接。
|
||||
1. 通过 AI 来优化图片绘制的提示词(这步省略了,自己找提示词即可)
|
||||
2. 通过 `【HTTP 请求】模块` 调用 Dalle3 接口,获取图片的 URL。
|
||||
3. 通过 `【文本加工】模块` 来构建 `Markdown` 的图片格式。
|
||||
4. 通过 `【指定回复】模块` 来直接输出图片链接。
|
||||
|
||||
### 1. 构建 HTTP 模块
|
||||
|
||||
请求参数直接复制 Dalle3 接口的即可,并求改 prompt 为变量。需要增加一个`Headers.Authorization`。
|
||||
请求参数直接复制 Dalle3 接口的即可,并求改 prompt 为变量。需要增加一个 `Headers.Authorization` 。
|
||||
|
||||
Body:
|
||||
|
||||
@@ -70,448 +70,402 @@ Headers:
|
||||
|
||||
Response:
|
||||
|
||||
响应值需要根据Dalle3接口的返回值进行获取,我们只绘制了1张图片,所以只需要取第一张图片的URL即可。给 HTTP 模块增加一个`key`为`data[0].url`的输出值。
|
||||
响应值需要根据 Dalle3 接口的返回值进行获取,我们只绘制了1张图片,所以只需要取第一张图片的 URL 即可。给 HTTP 模块增加一个自定义输出 `data[0].url` 。
|
||||
|
||||
### 2. 文本加工 - 构建图片链接
|
||||
|
||||
在`Markdown`语法中``表示插入图片,图片链接由`HTTP模块`输出。
|
||||
在 `Markdown` 语法中 `` 表示插入图片,图片链接由【HTTP 请求】模块输出。
|
||||
|
||||
因此可以增加一个输入来接收`HTTP模块`的图片链接输出,并在`文本内容`中通过变量来引用图片链接,从而得到一个完整的`Markdown`图片格式。
|
||||
因此可以增加一个输入来接收 `【HTTP 请求】模块` 的图片链接输出,并在 `【文本加工】模块 - 文本` 中通过变量来引用图片链接,从而得到一个完整的 `Markdown` 图片格式。
|
||||
|
||||
### 3. 指定回复
|
||||
|
||||
指定回复可以直接输出传入的内容到客户端,因此可以直接输出加工好的`Markdown`图片格式即可。
|
||||
指定回复可以直接输出传入的内容到客户端,因此可以直接输出加工好的 `Markdown` 图片格式即可。
|
||||
|
||||
## 编排代码
|
||||
|
||||
{{% details title="编排配置" closed="true" %}}
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"moduleId": "userGuide",
|
||||
"name": "core.module.template.App system setting",
|
||||
"flowType": "userGuide",
|
||||
"position": {
|
||||
"x": 454.98510354678695,
|
||||
"y": 721.4016845336229
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "welcomeText",
|
||||
"type": "hidden",
|
||||
"valueType": "string",
|
||||
"label": "core.app.Welcome Text",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "userGuide",
|
||||
"name": "系统配置",
|
||||
"intro": "可以配置应用的系统参数",
|
||||
"avatar": "/imgs/workflow/userGuide.png",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": 531.2422736065552,
|
||||
"y": -486.7611729549753
|
||||
},
|
||||
{
|
||||
"key": "variables",
|
||||
"type": "hidden",
|
||||
"valueType": "any",
|
||||
"label": "core.module.Variable",
|
||||
"value": [],
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "questionGuide",
|
||||
"valueType": "boolean",
|
||||
"type": "switch",
|
||||
"label": "",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "tts",
|
||||
"type": "hidden",
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"moduleId": "userChatInput",
|
||||
"name": "core.module.template.Chat entrance",
|
||||
"flowType": "questionInput",
|
||||
"position": {
|
||||
"x": 597.8136543694757,
|
||||
"y": 1709.9244174501202
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"type": "systemInput",
|
||||
"valueType": "string",
|
||||
"label": "core.module.input.label.user question",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"label": "core.module.input.label.user question",
|
||||
"type": "source",
|
||||
"valueType": "string",
|
||||
"targets": [
|
||||
{
|
||||
"moduleId": "mqgfub",
|
||||
"key": "prompt"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleId": "mqgfub",
|
||||
"name": "Dalle3绘图",
|
||||
"flowType": "httpRequest468",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1071.8956245626034,
|
||||
"y": 1236.690825267034
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "switch",
|
||||
"type": "target",
|
||||
"label": "core.module.input.label.switch",
|
||||
"description": "core.module.input.description.Trigger",
|
||||
"valueType": "any",
|
||||
"showTargetInApp": true,
|
||||
"showTargetInPlugin": true,
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "system_httpMethod",
|
||||
"type": "custom",
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"value": "POST",
|
||||
"required": true,
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "system_httpReqUrl",
|
||||
"type": "hidden",
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"description": "core.module.input.description.Http Request Url",
|
||||
"placeholder": "https://api.ai.com/getInventory",
|
||||
"required": false,
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"value": "https://api.openai.com/v1/images/generations",
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "system_httpHeader",
|
||||
"type": "custom",
|
||||
"valueType": "any",
|
||||
"value": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"type": "string",
|
||||
"value": "sk-xxx"
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"description": "core.module.input.description.Http Request Header",
|
||||
"placeholder": "core.module.input.description.Http Request Header",
|
||||
"required": false,
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "system_httpParams",
|
||||
"type": "hidden",
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"required": false,
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "system_httpJsonBody",
|
||||
"type": "hidden",
|
||||
"valueType": "any",
|
||||
"value": "{\r\n \"model\": \"dall-e-3\",\r\n \"prompt\": \"{{prompt}}\",\r\n \"n\": 1,\r\n \"size\": \"1024x1024\"\r\n }",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "DYNAMIC_INPUT_KEY",
|
||||
"type": "target",
|
||||
"valueType": "any",
|
||||
"label": "core.module.inputType.dynamicTargetInput",
|
||||
"description": "core.module.input.description.dynamic input",
|
||||
"required": false,
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": true,
|
||||
"hideInApp": true,
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "prompt",
|
||||
"valueType": "string",
|
||||
"label": "prompt",
|
||||
"type": "target",
|
||||
"required": true,
|
||||
"description": "",
|
||||
"edit": true,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"name": true,
|
||||
"description": true,
|
||||
"required": true,
|
||||
"dataType": true
|
||||
},
|
||||
"connected": true
|
||||
},
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"type": "addInputParam",
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"name": true,
|
||||
"description": true,
|
||||
"required": true,
|
||||
"dataType": true
|
||||
},
|
||||
"defaultEditField": {
|
||||
"label": "",
|
||||
"key": "",
|
||||
"description": "",
|
||||
"inputType": "target",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "welcomeText",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "string",
|
||||
"required": true
|
||||
"label": "core.app.Welcome Text",
|
||||
"value": ""
|
||||
},
|
||||
"connected": false
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"key": "finish",
|
||||
"label": "core.module.output.label.running done",
|
||||
"description": "core.module.output.description.running done",
|
||||
"valueType": "boolean",
|
||||
"type": "source",
|
||||
"targets": []
|
||||
},
|
||||
{
|
||||
"key": "system_addOutputParam",
|
||||
"type": "addOutputParam",
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"targets": [],
|
||||
"editField": {
|
||||
"key": true,
|
||||
"name": true,
|
||||
"description": true,
|
||||
"dataType": true
|
||||
{
|
||||
"key": "variables",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "any",
|
||||
"label": "core.app.Chat Variable",
|
||||
"value": []
|
||||
},
|
||||
"defaultEditField": {
|
||||
{
|
||||
"key": "questionGuide",
|
||||
"valueType": "boolean",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"label": "core.app.Question Guide",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"key": "tts",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"key": "",
|
||||
"description": "",
|
||||
"outputType": "source",
|
||||
"valueType": "string"
|
||||
"value": {
|
||||
"type": "web"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "whisper",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": {
|
||||
"open": false,
|
||||
"autoSend": false,
|
||||
"autoTTSResponse": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "scheduleTrigger",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "source",
|
||||
"valueType": "string",
|
||||
"key": "data[0].url",
|
||||
"label": "url",
|
||||
"description": "",
|
||||
"edit": true,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"name": true,
|
||||
"description": true,
|
||||
"dataType": true
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"moduleId": "nl6mr9",
|
||||
"key": "url"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleId": "xy76o2",
|
||||
"name": "core.module.template.Assigned reply",
|
||||
"flowType": "answerNode",
|
||||
"position": {
|
||||
"x": 2204.027057268489,
|
||||
"y": 1256.786345213533
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "switch",
|
||||
"type": "target",
|
||||
"label": "core.module.input.label.switch",
|
||||
"description": "core.module.input.description.Trigger",
|
||||
"valueType": "any",
|
||||
"showTargetInApp": true,
|
||||
"showTargetInPlugin": true,
|
||||
"connected": false
|
||||
{
|
||||
"nodeId": "448745",
|
||||
"name": "流程开始",
|
||||
"intro": "",
|
||||
"avatar": "/imgs/workflow/userChatInput.svg",
|
||||
"flowNodeType": "workflowStart",
|
||||
"position": {
|
||||
"x": 532.1275542407774,
|
||||
"y": 46.03775600322817
|
||||
},
|
||||
{
|
||||
"key": "text",
|
||||
"type": "textarea",
|
||||
"valueType": "any",
|
||||
"label": "core.module.input.label.Response content",
|
||||
"description": "core.module.input.description.Response content",
|
||||
"placeholder": "core.module.input.description.Response content",
|
||||
"showTargetInApp": true,
|
||||
"showTargetInPlugin": true,
|
||||
"connected": true
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"key": "finish",
|
||||
"label": "core.module.output.label.running done",
|
||||
"description": "core.module.output.description.running done",
|
||||
"valueType": "boolean",
|
||||
"type": "source",
|
||||
"targets": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleId": "nl6mr9",
|
||||
"name": "core.module.template.textEditor",
|
||||
"flowType": "pluginModule",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 1690.1826860670342,
|
||||
"y": 1262.3858719789062
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "pluginId",
|
||||
"type": "hidden",
|
||||
"label": "",
|
||||
"value": "community-textEditor",
|
||||
"valueType": "string",
|
||||
"connected": false,
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false
|
||||
},
|
||||
{
|
||||
"key": "switch",
|
||||
"type": "target",
|
||||
"label": "core.module.input.label.switch",
|
||||
"description": "core.module.input.description.Trigger",
|
||||
"valueType": "any",
|
||||
"showTargetInApp": true,
|
||||
"showTargetInPlugin": true,
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "textarea",
|
||||
"valueType": "string",
|
||||
"label": "文本内容",
|
||||
"type": "textarea",
|
||||
"required": true,
|
||||
"description": "可以通过 {{key}} 的方式引用传入的变量。变量仅支持字符串或数字。",
|
||||
"edit": false,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"name": true,
|
||||
"description": true,
|
||||
"required": true,
|
||||
"dataType": true,
|
||||
"inputType": true
|
||||
},
|
||||
"connected": false,
|
||||
"placeholder": "可以通过 {{key}} 的方式引用传入的变量。变量仅支持字符串或数字。",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "url",
|
||||
"valueType": "string",
|
||||
"label": "url",
|
||||
"type": "target",
|
||||
"required": true,
|
||||
"description": "",
|
||||
"edit": true,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"name": true,
|
||||
"description": true,
|
||||
"required": true,
|
||||
"dataType": true,
|
||||
"inputType": false
|
||||
},
|
||||
"connected": true
|
||||
},
|
||||
{
|
||||
"key": "DYNAMIC_INPUT_KEY",
|
||||
"valueType": "any",
|
||||
"label": "需要加工的输入",
|
||||
"type": "addInputParam",
|
||||
"required": false,
|
||||
"description": "可动态的添加字符串类型变量,在文本编辑中通过 {{key}} 使用变量。非字符串类型,会自动转成字符串类型。",
|
||||
"edit": false,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"name": true,
|
||||
"description": true,
|
||||
"required": true,
|
||||
"dataType": true,
|
||||
"inputType": false
|
||||
},
|
||||
"defaultEditField": {
|
||||
"label": "",
|
||||
"key": "",
|
||||
"description": "",
|
||||
"inputType": "target",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": [
|
||||
"reference",
|
||||
"textarea"
|
||||
],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "userChatInput",
|
||||
"key": "userChatInput",
|
||||
"label": "core.module.input.label.user question",
|
||||
"valueType": "string",
|
||||
"type": "static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "tMyUnRL5jIrC",
|
||||
"name": "HTTP 请求",
|
||||
"intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
|
||||
"avatar": "/imgs/workflow/http.png",
|
||||
"flowNodeType": "httpRequest468",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 921.2377506442713,
|
||||
"y": -483.94114977914256
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": [
|
||||
"addInputParam"
|
||||
],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "core.module.input.description.HTTP Dynamic Input",
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "prompt",
|
||||
"valueType": "string",
|
||||
"label": "prompt",
|
||||
"renderTypeList": [
|
||||
"reference"
|
||||
],
|
||||
"description": "",
|
||||
"canEdit": true,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
},
|
||||
"value": [
|
||||
"448745",
|
||||
"userChatInput"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "system_httpMethod",
|
||||
"renderTypeList": [
|
||||
"custom"
|
||||
],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"value": "POST",
|
||||
"required": true
|
||||
},
|
||||
"connected": false
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"key": "text",
|
||||
"valueType": "string",
|
||||
"label": "core.module.output.label.text",
|
||||
"type": "source",
|
||||
"edit": false,
|
||||
"targets": [
|
||||
{
|
||||
"moduleId": "xy76o2",
|
||||
"key": "text"
|
||||
{
|
||||
"key": "system_httpReqUrl",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"description": "core.module.input.description.Http Request Url",
|
||||
"placeholder": "https://api.ai.com/getInventory",
|
||||
"required": false,
|
||||
"value": "https://api.openai.com/v1/images/generations"
|
||||
},
|
||||
{
|
||||
"key": "system_httpHeader",
|
||||
"renderTypeList": [
|
||||
"custom"
|
||||
],
|
||||
"valueType": "any",
|
||||
"value": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"type": "string",
|
||||
"value": "Bearer sk-zsfBsxEU3ApSFGYxF4CdB97e9556412588421823371b9f7b"
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"description": "core.module.input.description.Http Request Header",
|
||||
"placeholder": "core.module.input.description.Http Request Header",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"key": "system_httpParams",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"key": "system_httpJsonBody",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "any",
|
||||
"value": "{\n \"model\": \"dall-e-3\",\n \"prompt\": \"{{prompt}}\",\n \"n\": 1,\n \"size\": \"1024x1024\"\n}",
|
||||
"label": "",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
},
|
||||
{
|
||||
"id": "httpRawResponse",
|
||||
"key": "httpRawResponse",
|
||||
"label": "原始响应",
|
||||
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
|
||||
"valueType": "any",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "DeKGGioBwaMf",
|
||||
"type": "dynamic",
|
||||
"key": "data[0].url",
|
||||
"valueType": "string",
|
||||
"label": "data[0].url"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "CO3POL8svbbi",
|
||||
"name": "文本加工",
|
||||
"intro": "可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。",
|
||||
"avatar": "/imgs/workflow/textEditor.svg",
|
||||
"flowNodeType": "pluginModule",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 1417.5940290051137,
|
||||
"y": -478.81889618104356
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"valueType": "dynamic",
|
||||
"label": "动态外部数据",
|
||||
"renderTypeList": [
|
||||
"addInputParam"
|
||||
],
|
||||
"required": false,
|
||||
"description": "",
|
||||
"canEdit": false,
|
||||
"value": "",
|
||||
"editField": {
|
||||
"key": true
|
||||
},
|
||||
"dynamicParamDefaultValue": {
|
||||
"inputType": "reference",
|
||||
"valueType": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "url",
|
||||
"valueType": "string",
|
||||
"label": "url",
|
||||
"renderTypeList": [
|
||||
"reference"
|
||||
],
|
||||
"required": true,
|
||||
"description": "",
|
||||
"canEdit": true,
|
||||
"editField": {
|
||||
"key": true
|
||||
},
|
||||
"value": [
|
||||
"tMyUnRL5jIrC",
|
||||
"DeKGGioBwaMf"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "文本",
|
||||
"valueType": "string",
|
||||
"label": "文本",
|
||||
"renderTypeList": [
|
||||
"textarea"
|
||||
],
|
||||
"required": true,
|
||||
"description": "",
|
||||
"canEdit": false,
|
||||
"value": "",
|
||||
"editField": {
|
||||
"key": true
|
||||
},
|
||||
"maxLength": "",
|
||||
"dynamicParamDefaultValue": {
|
||||
"inputType": "reference",
|
||||
"valueType": "string",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "text",
|
||||
"type": "static",
|
||||
"key": "text",
|
||||
"valueType": "string",
|
||||
"label": "text",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"pluginId": "community-textEditor"
|
||||
},
|
||||
{
|
||||
"nodeId": "7mapnCgHfKW6",
|
||||
"name": "指定回复",
|
||||
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
|
||||
"avatar": "/imgs/workflow/reply.png",
|
||||
"flowNodeType": "answerNode",
|
||||
"position": {
|
||||
"x": 1922.5628399315042,
|
||||
"y": -471.67391598231796
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "text",
|
||||
"renderTypeList": [
|
||||
"textarea",
|
||||
"reference"
|
||||
],
|
||||
"valueType": "string",
|
||||
"label": "core.module.input.label.Response content",
|
||||
"description": "core.module.input.description.Response content",
|
||||
"placeholder": "core.module.input.description.Response content",
|
||||
"selectedTypeIndex": 1,
|
||||
"value": [
|
||||
"CO3POL8svbbi",
|
||||
"text"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "448745",
|
||||
"target": "tMyUnRL5jIrC",
|
||||
"sourceHandle": "448745-source-right",
|
||||
"targetHandle": "tMyUnRL5jIrC-target-left"
|
||||
},
|
||||
{
|
||||
"source": "tMyUnRL5jIrC",
|
||||
"target": "CO3POL8svbbi",
|
||||
"sourceHandle": "tMyUnRL5jIrC-source-right",
|
||||
"targetHandle": "CO3POL8svbbi-target-left"
|
||||
},
|
||||
{
|
||||
"source": "CO3POL8svbbi",
|
||||
"target": "7mapnCgHfKW6",
|
||||
"sourceHandle": "CO3POL8svbbi-source-right",
|
||||
"targetHandle": "7mapnCgHfKW6-target-left"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
{{% /details %}}
|
||||
|
@@ -11,7 +11,7 @@ weight: 404
|
||||
|
||||
| | |
|
||||
| --------------------- | --------------------- |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
## 1. 准备飞书机器人
|
||||
|
||||
@@ -23,14 +23,16 @@ weight: 404
|
||||
|
||||
复制下面配置,点击「高级编排」右上角的导入按键,导入该配置,导入后将飞书提供的接口地址复制到「HTTP 模块」。
|
||||
|
||||
{{% details title="编排配置" closed="true" %}}
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"moduleId": "userGuide",
|
||||
"nodeId": "userGuide",
|
||||
"name": "core.module.template.App system setting",
|
||||
"intro": "core.app.tip.userGuideTip",
|
||||
"avatar": "/imgs/module/userGuide.png",
|
||||
"flowType": "userGuide",
|
||||
"avatar": "/imgs/workflow/userGuide.png",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": -92.26884681344463,
|
||||
"y": 710.9354029649536
|
||||
@@ -82,11 +84,11 @@ weight: 404
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"moduleId": "userChatInput",
|
||||
"nodeId": "userChatInput",
|
||||
"name": "core.module.template.Chat entrance",
|
||||
"intro": "当用户发送一个内容后,流程将会从这个模块开始执行。",
|
||||
"avatar": "/imgs/module/userChatInput.svg",
|
||||
"flowType": "questionInput",
|
||||
"avatar": "/imgs/workflow/userChatInput.svg",
|
||||
"flowNodeType": "questionInput",
|
||||
"position": {
|
||||
"x": 241.60980819261408,
|
||||
"y": 1330.9528898009685
|
||||
@@ -110,7 +112,7 @@ weight: 404
|
||||
"valueType": "string",
|
||||
"targets": [
|
||||
{
|
||||
"moduleId": "n84rvg",
|
||||
"nodeId": "n84rvg",
|
||||
"key": "userChatInput"
|
||||
}
|
||||
]
|
||||
@@ -118,27 +120,17 @@ weight: 404
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleId": "n84rvg",
|
||||
"nodeId": "n84rvg",
|
||||
"name": "工具调用(实验)",
|
||||
"intro": "通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。",
|
||||
"avatar": "/imgs/module/tool.svg",
|
||||
"flowType": "tools",
|
||||
"avatar": "/imgs/workflow/tool.svg",
|
||||
"flowNodeType": "tools",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 809.4264785615641,
|
||||
"y": 873.3971746859133
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "switch",
|
||||
"type": "triggerAndFinish",
|
||||
"label": "",
|
||||
"description": "core.module.input.description.Trigger",
|
||||
"valueType": "any",
|
||||
"showTargetInApp": true,
|
||||
"showTargetInPlugin": true,
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "model",
|
||||
"type": "settingLLMModel",
|
||||
@@ -227,7 +219,7 @@ weight: 404
|
||||
"type": "hidden",
|
||||
"targets": [
|
||||
{
|
||||
"moduleId": "3mbu91",
|
||||
"nodeId": "3mbu91",
|
||||
"key": "selectedTools"
|
||||
}
|
||||
]
|
||||
@@ -243,27 +235,18 @@ weight: 404
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleId": "3mbu91",
|
||||
"nodeId": "3mbu91",
|
||||
"name": "HTTP 请求",
|
||||
"intro": "调用飞书webhook,发送一个通知",
|
||||
"avatar": "/imgs/module/http.png",
|
||||
"flowType": "httpRequest468",
|
||||
"avatar": "/imgs/workflow/http.png",
|
||||
"flowNodeType": "httpRequest468",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1483.6437630977423,
|
||||
"y": 798.9716928475544
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "switch",
|
||||
"type": "triggerAndFinish",
|
||||
"label": "",
|
||||
"description": "core.module.input.description.Trigger",
|
||||
"valueType": "any",
|
||||
"showTargetInApp": true,
|
||||
"showTargetInPlugin": true,
|
||||
"connected": false
|
||||
},
|
||||
|
||||
{
|
||||
"key": "system_httpMethod",
|
||||
"type": "custom",
|
||||
@@ -327,7 +310,7 @@ weight: 404
|
||||
"key": "DYNAMIC_INPUT_KEY",
|
||||
"type": "target",
|
||||
"valueType": "any",
|
||||
"label": "core.module.inputType.dynamicTargetInput",
|
||||
"label": "core.workflow.inputType.dynamicTargetInput",
|
||||
"description": "core.module.input.description.dynamic input",
|
||||
"required": false,
|
||||
"showTargetInApp": false,
|
||||
@@ -376,11 +359,11 @@ weight: 404
|
||||
"type": "source",
|
||||
"targets": [
|
||||
{
|
||||
"moduleId": "rzx4mj",
|
||||
"nodeId": "rzx4mj",
|
||||
"key": "switch"
|
||||
},
|
||||
{
|
||||
"moduleId": "psdhs1",
|
||||
"nodeId": "psdhs1",
|
||||
"key": "switch"
|
||||
}
|
||||
]
|
||||
@@ -424,11 +407,11 @@ weight: 404
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleId": "rzx4mj",
|
||||
"nodeId": "rzx4mj",
|
||||
"name": "工具调用终止",
|
||||
"intro": "该模块需配置工具调用使用。当该模块被执行时,本次工具调用将会强制结束,并且不再调用AI针对工具调用结果回答问题。",
|
||||
"avatar": "/imgs/module/toolStop.svg",
|
||||
"flowType": "stopTool",
|
||||
"avatar": "/imgs/workflow/toolStop.svg",
|
||||
"flowNodeType": "stopTool",
|
||||
"position": {
|
||||
"x": 2145.5070710160267,
|
||||
"y": 1306.3581817783079
|
||||
@@ -448,11 +431,11 @@ weight: 404
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"moduleId": "psdhs1",
|
||||
"nodeId": "psdhs1",
|
||||
"name": "指定回复",
|
||||
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
|
||||
"avatar": "/imgs/module/reply.png",
|
||||
"flowType": "answerNode",
|
||||
"avatar": "/imgs/workflow/reply.png",
|
||||
"flowNodeType": "answerNode",
|
||||
"position": {
|
||||
"x": 2117.0429459850598,
|
||||
"y": 1658.4125434513746
|
||||
@@ -495,6 +478,9 @@ weight: 404
|
||||
]
|
||||
```
|
||||
|
||||
{{% /details %}}
|
||||
|
||||
|
||||
## 3. 流程说明
|
||||
|
||||
1. 为工具调用挂载一个HTTP模块,功能描述写上:调用飞书webhook,发送一个通知。
|
||||
|
@@ -7,9 +7,9 @@ toc: true
|
||||
weight: 401
|
||||
---
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
如上图,可以通过指定回复编排一个固定的开头和结尾内容。
|
||||
@@ -21,318 +21,411 @@ weight: 401
|
||||
{{% details title="编排配置" closed="true" %}}
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"moduleId": "userChatInput",
|
||||
"name": "用户问题(对话入口)",
|
||||
"flowType": "questionInput",
|
||||
"position": {
|
||||
"x": 59.03170043915989,
|
||||
"y": 1604.8595605938747
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "7z5g5h",
|
||||
"name": "流程开始",
|
||||
"intro": "",
|
||||
"avatar": "/imgs/workflow/userChatInput.svg",
|
||||
"flowNodeType": "workflowStart",
|
||||
"position": {
|
||||
"x": -269.50851681351924,
|
||||
"y": 1657.6123698022448
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": [
|
||||
"reference",
|
||||
"textarea"
|
||||
],
|
||||
"valueType": "string",
|
||||
"label": "问题输入",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题",
|
||||
"type": "systemInput",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0,
|
||||
"value": [
|
||||
"7z5g5h",
|
||||
"userChatInput"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "userChatInput",
|
||||
"type": "static",
|
||||
"key": "userChatInput",
|
||||
"valueType": "string",
|
||||
"label": "core.module.input.label.user question"
|
||||
}
|
||||
]
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"type": "systemInput",
|
||||
"label": "用户问题",
|
||||
"connected": true
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"label": "用户问题",
|
||||
"type": "source",
|
||||
"valueType": "string",
|
||||
"targets": [
|
||||
{
|
||||
"moduleId": "chatModule",
|
||||
"key": "userChatInput"
|
||||
},
|
||||
{
|
||||
"moduleId": "ymqh0t",
|
||||
"key": "switch"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleId": "history",
|
||||
"name": "聊天记录",
|
||||
"flowType": "historyNode",
|
||||
"position": {
|
||||
"x": 38.19233923987295,
|
||||
"y": 1184.4581738905642
|
||||
{
|
||||
"nodeId": "nlfwkc",
|
||||
"name": "AI 对话",
|
||||
"intro": "AI 大模型对话",
|
||||
"avatar": "/imgs/workflow/AI.png",
|
||||
"flowNodeType": "chatNode",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 907.2058332478431,
|
||||
"y": 1348.9992737142143
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"renderTypeList": [
|
||||
"settingLLMModel",
|
||||
"reference"
|
||||
],
|
||||
"label": "core.module.input.label.aiModel",
|
||||
"valueType": "string",
|
||||
"type": "selectLLMModel",
|
||||
"required": true,
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"value": "gpt-3.5-turbo",
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"label": "",
|
||||
"value": 0,
|
||||
"valueType": "number",
|
||||
"min": 0,
|
||||
"max": 10,
|
||||
"step": 1,
|
||||
"type": "hidden",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "maxToken",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"label": "",
|
||||
"value": 2000,
|
||||
"valueType": "number",
|
||||
"min": 100,
|
||||
"max": 4000,
|
||||
"step": 50,
|
||||
"type": "hidden",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "isResponseAnswerText",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"label": "",
|
||||
"value": true,
|
||||
"valueType": "boolean",
|
||||
"type": "hidden",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "quoteTemplate",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"type": "hidden",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "quotePrompt",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"type": "hidden",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"renderTypeList": [
|
||||
"textarea",
|
||||
"reference"
|
||||
],
|
||||
"max": 300,
|
||||
"valueType": "string",
|
||||
"label": "core.ai.Prompt",
|
||||
"description": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"type": "textarea",
|
||||
"showTargetInApp": true,
|
||||
"showTargetInPlugin": true,
|
||||
"value": "",
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"renderTypeList": [
|
||||
"numberInput",
|
||||
"reference"
|
||||
],
|
||||
"valueType": "chatHistory",
|
||||
"label": "core.module.input.label.chat history",
|
||||
"required": true,
|
||||
"min": 0,
|
||||
"max": 30,
|
||||
"value": 6,
|
||||
"type": "numberInput",
|
||||
"showTargetInApp": true,
|
||||
"showTargetInPlugin": true,
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": [
|
||||
"reference",
|
||||
"textarea"
|
||||
],
|
||||
"valueType": "string",
|
||||
"label": "问题输入",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题",
|
||||
"type": "custom",
|
||||
"showTargetInApp": true,
|
||||
"showTargetInPlugin": true,
|
||||
"connected": true,
|
||||
"selectedTypeIndex": 0,
|
||||
"value": [
|
||||
"7z5g5h",
|
||||
"userChatInput"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "quoteQA",
|
||||
"renderTypeList": [
|
||||
"settingDatasetQuotePrompt"
|
||||
],
|
||||
"label": "",
|
||||
"debugLabel": "知识库引用",
|
||||
"description": "core.module.Dataset quote.Input description",
|
||||
"valueType": "datasetQuote",
|
||||
"type": "target",
|
||||
"showTargetInApp": true,
|
||||
"showTargetInPlugin": true,
|
||||
"connected": true,
|
||||
"selectedTypeIndex": 0,
|
||||
"value": [
|
||||
"fljhzy",
|
||||
"quoteQA"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "answerText",
|
||||
"type": "static",
|
||||
"key": "answerText",
|
||||
"valueType": "string",
|
||||
"label": "core.module.output.label.Ai response content",
|
||||
"description": "core.module.output.description.Ai response content"
|
||||
},
|
||||
{
|
||||
"id": "history",
|
||||
"type": "static",
|
||||
"key": "history",
|
||||
"valueType": "chatHistory",
|
||||
"label": "core.module.output.label.New context",
|
||||
"description": "core.module.output.description.New context"
|
||||
}
|
||||
]
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "maxContext",
|
||||
"type": "numberInput",
|
||||
"label": "最长记录数",
|
||||
"value": 6,
|
||||
"min": 0,
|
||||
"max": 50,
|
||||
"connected": true
|
||||
{
|
||||
"nodeId": "q9equb",
|
||||
"name": "core.module.template.App system setting",
|
||||
"intro": "可以配置应用的系统参数。",
|
||||
"avatar": "/imgs/workflow/userGuide.png",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": -275.92529567956024,
|
||||
"y": 1094.1001488133452
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"type": "hidden",
|
||||
"label": "聊天记录",
|
||||
"connected": true
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"key": "history",
|
||||
"label": "聊天记录",
|
||||
"valueType": "chatHistory",
|
||||
"type": "source",
|
||||
"targets": [
|
||||
{
|
||||
"moduleId": "chatModule",
|
||||
"key": "history"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleId": "chatModule",
|
||||
"name": "AI 对话",
|
||||
"flowType": "chatNode",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 943.1225685246793,
|
||||
"y": 891.3094521573212
|
||||
"inputs": [
|
||||
{
|
||||
"key": "welcomeText",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "string",
|
||||
"label": "core.app.Welcome Text",
|
||||
"type": "hidden",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"value": "你好,我是电影《星际穿越》 AI 助手,有什么可以帮助你的?\n[导演是谁]\n[剧情介绍]\n[票房分析]",
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "variables",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "any",
|
||||
"label": "core.module.Variable",
|
||||
"value": [],
|
||||
"type": "hidden",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "questionGuide",
|
||||
"valueType": "boolean",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"label": "",
|
||||
"type": "switch",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "tts",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"type": "hidden",
|
||||
"showTargetInApp": false,
|
||||
"showTargetInPlugin": false,
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
},
|
||||
{
|
||||
"key": "whisper",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "any",
|
||||
"label": ""
|
||||
},
|
||||
{
|
||||
"key": "scheduleTrigger",
|
||||
"renderTypeList": [
|
||||
"hidden"
|
||||
],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": null
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"type": "custom",
|
||||
"label": "对话模型",
|
||||
"value": "gpt-3.5-turbo",
|
||||
"list": [
|
||||
{
|
||||
"label": "FastGPT-4k",
|
||||
"value": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"label": "FastGPT-16k",
|
||||
"value": "gpt-3.5-turbo-16k"
|
||||
},
|
||||
{
|
||||
"label": "文心一言",
|
||||
"value": "ERNIE-Bot"
|
||||
},
|
||||
{
|
||||
"label": "FastGPT-Plus",
|
||||
"value": "gpt-4"
|
||||
},
|
||||
{
|
||||
"label": "glm2(演示娱乐)",
|
||||
"value": "glm2-6b"
|
||||
}
|
||||
],
|
||||
"connected": true
|
||||
{
|
||||
"nodeId": "tc90wz",
|
||||
"name": "指定回复",
|
||||
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
|
||||
"avatar": "/imgs/workflow/reply.png",
|
||||
"flowNodeType": "answerNode",
|
||||
"position": {
|
||||
"x": 159.49274056478237,
|
||||
"y": 1621.4635230667668
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"type": "slider",
|
||||
"label": "温度",
|
||||
"value": 0,
|
||||
"min": 0,
|
||||
"max": 10,
|
||||
"step": 1,
|
||||
"markList": [
|
||||
{
|
||||
"label": "严谨",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"label": "发散",
|
||||
"value": 10
|
||||
}
|
||||
],
|
||||
"connected": true
|
||||
},
|
||||
{
|
||||
"key": "maxToken",
|
||||
"type": "custom",
|
||||
"label": "回复上限",
|
||||
"value": 2000,
|
||||
"min": 100,
|
||||
"max": 4000,
|
||||
"step": 50,
|
||||
"markList": [
|
||||
{
|
||||
"label": "100",
|
||||
"value": 100
|
||||
},
|
||||
{
|
||||
"label": "4000",
|
||||
"value": 4000
|
||||
}
|
||||
],
|
||||
"connected": true
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"type": "textarea",
|
||||
"label": "系统提示词",
|
||||
"max": 300,
|
||||
"valueType": "string",
|
||||
"description": "模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}",
|
||||
"placeholder": "模型固定的引导词,通过调整该内容,可以引导模型聊天方向。该内容会被固定在上下文的开头。可使用变量,例如 {{language}}",
|
||||
"value": "",
|
||||
"connected": true
|
||||
},
|
||||
{
|
||||
"key": "limitPrompt",
|
||||
"type": "textarea",
|
||||
"valueType": "string",
|
||||
"label": "限定词",
|
||||
"max": 500,
|
||||
"description": "限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。不建议内容太长,会影响上下文,可使用变量,例如 {{language}}。可在文档中找到对应的限定例子",
|
||||
"placeholder": "限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。不建议内容太长,会影响上下文,可使用变量,例如 {{language}}。可在文档中找到对应的限定例子",
|
||||
"value": "",
|
||||
"connected": true
|
||||
},
|
||||
{
|
||||
"key": "switch",
|
||||
"type": "target",
|
||||
"label": "触发器",
|
||||
"valueType": "any",
|
||||
"connected": true
|
||||
},
|
||||
{
|
||||
"key": "quoteQA",
|
||||
"type": "target",
|
||||
"label": "引用内容",
|
||||
"description": "对象数组格式,结构:\n [{q:'问题',a:'回答'}]",
|
||||
"valueType": "datasetQuote",
|
||||
"connected": false
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"type": "target",
|
||||
"label": "聊天记录",
|
||||
"valueType": "chatHistory",
|
||||
"connected": true
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"type": "target",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"valueType": "string",
|
||||
"connected": true
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"key": "answerText",
|
||||
"label": "AI回复",
|
||||
"description": "将在 stream 回复完毕后触发",
|
||||
"valueType": "string",
|
||||
"type": "source",
|
||||
"targets": []
|
||||
},
|
||||
{
|
||||
"key": "finish",
|
||||
"label": "回复结束",
|
||||
"description": "AI 回复完成后触发",
|
||||
"valueType": "boolean",
|
||||
"type": "source",
|
||||
"targets": [
|
||||
{
|
||||
"moduleId": "ojeopv",
|
||||
"key": "switch"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleId": "ymqh0t",
|
||||
"name": "指定回复",
|
||||
"flowType": "answerNode",
|
||||
"position": {
|
||||
"x": 435.27459673941917,
|
||||
"y": 1081.9477378716076
|
||||
"inputs": [
|
||||
{
|
||||
"key": "text",
|
||||
"renderTypeList": [
|
||||
"textarea",
|
||||
"reference"
|
||||
],
|
||||
"valueType": "any",
|
||||
"label": "core.module.input.label.Response content",
|
||||
"description": "core.module.input.description.Response content",
|
||||
"placeholder": "core.module.input.description.Response content",
|
||||
"type": "textarea",
|
||||
"showTargetInApp": true,
|
||||
"showTargetInPlugin": true,
|
||||
"value": "这是开头\\n",
|
||||
"connected": false,
|
||||
"selectedTypeIndex": 0
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "switch",
|
||||
"type": "target",
|
||||
"label": "触发器",
|
||||
"valueType": "any",
|
||||
"connected": true
|
||||
{
|
||||
"nodeId": "U5T3dMVY4wj7",
|
||||
"name": "指定回复",
|
||||
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
|
||||
"avatar": "/imgs/workflow/reply.png",
|
||||
"flowNodeType": "answerNode",
|
||||
"position": {
|
||||
"x": 1467.0625486167608,
|
||||
"y": 1597.346243737531
|
||||
},
|
||||
{
|
||||
"key": "text",
|
||||
"type": "textarea",
|
||||
"valueType": "string",
|
||||
"value": "这是AI作答:\n\n---\n\n",
|
||||
"label": "回复的内容",
|
||||
"description": "可以使用 \\n 来实现换行。也可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容",
|
||||
"connected": true
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"key": "finish",
|
||||
"label": "回复结束",
|
||||
"description": "回复完成后触发",
|
||||
"valueType": "boolean",
|
||||
"type": "source",
|
||||
"targets": [
|
||||
{
|
||||
"moduleId": "chatModule",
|
||||
"key": "switch"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleId": "ojeopv",
|
||||
"name": "指定回复",
|
||||
"flowType": "answerNode",
|
||||
"position": {
|
||||
"x": 1573.4540253108476,
|
||||
"y": 1551.9808807287498
|
||||
"inputs": [
|
||||
{
|
||||
"key": "text",
|
||||
"renderTypeList": [
|
||||
"textarea",
|
||||
"reference"
|
||||
],
|
||||
"valueType": "string",
|
||||
"label": "core.module.input.label.Response content",
|
||||
"description": "core.module.input.description.Response content",
|
||||
"placeholder": "core.module.input.description.Response content",
|
||||
"value": "这是结尾"
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "7z5g5h",
|
||||
"target": "tc90wz",
|
||||
"sourceHandle": "7z5g5h-source-right",
|
||||
"targetHandle": "tc90wz-target-left"
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"key": "switch",
|
||||
"type": "target",
|
||||
"label": "触发器",
|
||||
"valueType": "any",
|
||||
"connected": true
|
||||
},
|
||||
{
|
||||
"key": "text",
|
||||
"type": "textarea",
|
||||
"valueType": "string",
|
||||
"value": "\\n\n---\n\n这是固定的结尾",
|
||||
"label": "回复的内容",
|
||||
"description": "可以使用 \\n 来实现换行。也可以通过外部模块输入实现回复,外部模块输入时会覆盖当前填写的内容",
|
||||
"connected": true
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"key": "finish",
|
||||
"label": "回复结束",
|
||||
"description": "回复完成后触发",
|
||||
"valueType": "boolean",
|
||||
"type": "source",
|
||||
"targets": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
{
|
||||
"source": "tc90wz",
|
||||
"target": "nlfwkc",
|
||||
"sourceHandle": "tc90wz-source-right",
|
||||
"targetHandle": "nlfwkc-target-left"
|
||||
},
|
||||
{
|
||||
"source": "nlfwkc",
|
||||
"target": "U5T3dMVY4wj7",
|
||||
"sourceHandle": "nlfwkc-source-right",
|
||||
"targetHandle": "U5T3dMVY4wj7-target-left"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
{{% /details %}}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user