4.8.13 feature (#3118)

* chore(ui): login page & workflow page (#3046)

* login page & number input & multirow select & llm select

* workflow

* adjust nodes

* New file upload (#3058)

* feat: toolNode aiNode readFileNode adapt new version

* update docker-compose

* update tip

* feat: adapt new file version

* perf: file input

* fix: ts

* feat: add chat history time label (#3024)

* feat:add chat and logs time

* feat: add chat history time label

* code perf

* code perf

---------

Co-authored-by: 勤劳上班的卑微小张 <jiazhan.zhang@ggimage.com>

* add chatType (#3060)

* pref: slow query of full text search (#3044)

* Adapt findLast api;perf: markdown zh format. (#3066)

* perf: context code

* fix: adapt findLast api

* perf: commercial plugin run error

* perf: markdown zh format

* perf: dockerfile proxy (#3067)

* fix ui (#3065)

* fix ui

* fix

* feat: support array reference multi-select (#3041)

* feat: support array reference multi-select

* fix build

* fix

* fix loop multi-select

* adjust condition

* fix get value

* array and non-array conversion

* fix plugin input

* merge func

* feat: iframe code block;perf: workflow selector type (#3076)

* feat: iframe code block

* perf: workflow selector type

* node pluginoutput check (#3074)

* feat: View will move when workflow check error;fix: ui refresh error when continuous file upload (#3077)

* fix: plugin output check

* fix: ui refresh error when continuous file upload

* feat: View will move when workflow check error

* add dispatch try catch (#3075)

* perf: workflow context split (#3083)

* perf: workflow context split

* perf: context

* 4.8.13 test (#3085)

* perf: workflow node ui

* chat iframe url

* feat: support sub route config (#3071)

* feat: support sub route config

* dockerfile

* fix upload

* delete unused code

* 4.8.13 test (#3087)

* fix: image expired

* fix: datacard navbar ui

* perf: build action

* fix: workflow file upload refresh (#3088)

* fix: http tool response (#3097)

* loop node dynamic height (#3092)

* loop node dynamic height

* fix

* fix

* feat: support push chat log (#3093)

* feat: custom uid/metadata

* to: custom info

* fix: chat push latest

* feat: add chat log envs

* refactor: move timer to pushChatLog

* fix: using precise log

---------

Co-authored-by: Finley Ge <m13203533462@163.com>

* 4.8.13 test (#3098)

* perf: loop node refresh

* rename context

* comment

* fix: ts

* perf: push chat log

* array reference check & node ui (#3100)

* feat: loop start add index (#3101)

* feat: loop start add index

* update doc

* 4.8.13 test (#3102)

* fix: loop index;edge parent check

* perf: reference invalid check

* fix: ts

* fix: plugin select files and ai response check (#3104)

* fix: plugin select files and ai response check

* perf: text editor selector;tool call tip;remove invalid image url;

* perf: select file

* perf: drop files

* feat: source id prefix env (#3103)

* 4.8.13 test (#3106)

* perf: select file

* perf: drop files

* perf: env template

* 4.8.13 test (#3107)

* perf: select file

* perf: drop files

* fix: imple mode adapt files

* perf: push chat log (#3109)

* fix: share page load title error (#3111)

* 4.8.13 perf (#3112)

* fix: share page load title error

* update file input doc

* perf: auto add file urls

* perf: auto ser loop node offset height

* 4.8.13 test (#3117)

* perf: plugin

* updat eaction

* feat: add more share config (#3120)

* feat: add more share config

* add i18n en

* fix: missing subroute (#3121)

* perf: outlink config (#3128)

* update action

* perf: outlink config

* fix: ts (#3129)

* 更新 docSite 文档内容 (#3131)

* fix: null pointer (#3130)

* fix: null pointer

* perf: not input text

* update doc url

* perf: outlink default value (#3134)

* update doc (#3136)

* 4.8.13 test (#3137)

* update doc

* perf: completions chat api

* Restore docSite content based on upstream/4.8.13-dev (#3138)

* Restore docSite content based on upstream/4.8.13-dev

* 4813.md缺少更正

* update doc (#3141)

---------

Co-authored-by: heheer <heheer@sealos.io>
Co-authored-by: papapatrick <109422393+Patrickill@users.noreply.github.com>
Co-authored-by: 勤劳上班的卑微小张 <jiazhan.zhang@ggimage.com>
Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
Co-authored-by: a.e. <49438478+I-Info@users.noreply.github.com>
Co-authored-by: Finley Ge <m13203533462@163.com>
Co-authored-by: Jiangween <145003935+Jiangween@users.noreply.github.com>
This commit is contained in:
Archer
2024-11-13 11:29:53 +08:00
committed by GitHub
parent e1f5483432
commit e9d52ada73
449 changed files with 7626 additions and 4180 deletions

View File

@@ -0,0 +1,9 @@
---
weight: 300
title: '系统插件'
description: '介绍如何使用和提交系统插件,以及各插件的填写说明'
icon: 'extension'
draft: false
images: []
---
<!-- 300 ~ 400 -->

View File

@@ -0,0 +1,32 @@
---
title: "Bing 搜索插件填写说明"
description: "FastGPT Bing 搜索插件配置步骤详解"
icon: "bing_search"
draft: false
toc: true
weight: 306
---
1. # 打开微软Azure官网登陆账号
https://portal.azure.com/
![](/imgs/bing_search_plugin1.png)
1. # 创建bing web搜索资源
搜索Bing Search v7点击创建
https://portal.azure.com/#create/Microsoft.BingSearch
![](/imgs/bing_search_plugin2.png)
1. # 进入资源详情点击管理密钥
![](/imgs/bing_search_plugin3.png)
# 4. 复制任意一个密钥填入插件输入
![](/imgs/bing_search_plugin4.png)
![](/imgs/bing_search_plugin5.png)

View File

@@ -0,0 +1,26 @@
---
title: "Doc2x 插件填写说明"
description: "如何配置和使用 Doc2x 插件"
icon: "doc_transform"
draft: false
toc: true
weight: 308
---
1. # 打开docx官网创建账号并复制 apikey
https://doc2x.noedgeai.com/
![](/imgs/doc2x_plugin1.png)
![](/imgs/doc2x_plugin2.png)
1. # 填写apikey到fastgpt中
**工作流****中:**
![](/imgs/doc2x_plugin3.png)
**简易模式使用:**
![](/imgs/doc2x_plugin4.png)

View File

@@ -0,0 +1,32 @@
---
title: "Google 搜索插件填写说明"
description: "FastGPT Google 搜索插件配置指南"
icon: "google_search"
draft: false
toc: true
weight: 304
---
1. # 创建Google Custom Search Engine
https://programmablesearchengine.google.com/
我们连到Custom Search Engine control panel 建立Search Engine
![](/imgs/google_search_plugin1.png)
取得搜索引擎的ID即cx
![](/imgs/google_search_plugin2.png)
1. # 获取api key
https://developers.google.com/custom-search/v1/overview?hl=zh-cn
![](/imgs/google_search_plugin3.png)
1. # 填入插件输入参数
将搜索引擎ID填入cx字段api key填入key字段
![](/imgs/google_search_plugin4.png)

View File

@@ -0,0 +1,118 @@
---
title: "如何提交系统插件"
description: "FastGPT 系统插件提交指南"
icon: "plugin_submission"
draft: false
toc: true
weight: 302
---
> 如何向 FastGPT 社区提交系统插件
## 系统插件原则
- 尽可能的轻量简洁,以解决实际问题的工具为主
- 不允许有密集 cpu 计算,不会占用大量内存占用或网络消耗
- 不允许操作数据库
- 不允许往固定的私人地址发送请求(不包含请求某些在线服务,例如 gapier, firecrawl等)
- 不允许使用私人包,可使用主流的开源包
## 什么插件可以合并
由于目前未采用按需安装的模式,合并进仓库的插件会全部展示给用户使用。
为了控制插件的质量以及避免数量过多带来的繁琐,并不是所有的插件都会被合并到开源仓库中,你可以提前 PR 与我们沟通插件的内容。
后续实现插件按需安装后,我们会允许更多的社区插件合入。
## 如何写一个系统插件 - 初步
FastGPT 系统插件和用户工作台的插件效果是一致的,所以你需要提前了解“插件”的定义和功能。
在 FastGPT 中,插件是一种特殊的工作流,它允许你将一个工作流封装起来,并自定义入口参数和出口参数,类似于代码里的 “子函数”。
1. ### 跑通 FastGPT dev 环境
需要在 dev 环境下执行下面的操作。
1. ### 在 FastGPT 工作台中,创建一个插件
选择基础模板即可。
![](/imgs/plugin_submission1.png)
1. ### 创建系统插件配置
系统插件配置以及自定义代码,都会在 **packages/plugins** 目录下。
1.**packages/plugins/src** 下,复制一份 **template** 目录,并修改名字。
2. 打开目录里面的 template.json 文件,配置如下:
3. 目录还有一个 index.ts 文件,下文再提。
```TypeScript
{
"author": "填写你的名字",
"version": "当前系统版本号",
"name": "插件名",
"avatar": "插件头像,需要配成 icon 格式。直接把 logo 图在 pr 评论区提交即可,我们会帮你加入。",
"intro": " 插件的描述,这个描述会影响工具调用",
"showStatus": false, // 是否在对话过程展示状态
"weight": 10, // 排序权重,均默认 10
"isTool": true, // 是否作为工具调用节点
"templateType": "tools", // 都填写 tools 即可,由官方来分类
"workflow": { // 这个对象先不管,待会直接粘贴导出的工作流即可
"nodes": [],
"edges": []
}
}
```
1. 打开 **packages/plugins/register** 文件,注册你的插件。在 list 数组中,加入一个你插件目录的名字,如下图的例子。如需构建插件组(带目录),可参考 DuckDuckGo 插件。
无需额外写代码的插件,直接放在 staticPluginList 内,需要在项目内额外写代码的,写在 packagePluginList 中。
![](/imgs/plugin_submission2.png)
1. ### 完成工作流编排并测试
完成工作流编排后,可以点击右上角的发布,并在其他工作流中引入进行测试(此时属于团队插件)。
1. ### 复制配置到 template.json
鼠标放置在左上角插件的头像和名称上,会出现对于下拉框操作,可以导出工作流配置。
导出的配置,会自动到剪切板,可以直接到 template.json 文件中粘贴使用,替换步骤 2 中,**workflow** 的值。
![](/imgs/plugin_submission3.png)
1. ### 验证插件是否加载成功
刷新页面,打开系统插件,看其是否成功加载,并将其添加到工作流中使用。
![](/imgs/plugin_submission4.png)
1. ### 提交 PR
如果你觉得你的插件需要提交到开源仓库,可以通过 PR 形式向我们提交。
- 写清楚插件的介绍和功能
- 配上插件运行的效果图
- 插件参数填写说明,需要在 PR 中写清楚。例如,有些插件需要去某个提供商申请 key需要附上对应的地址和教材后续我们会加入到文档中。
## 写一个复杂的系统插件 - 进阶
这一章会介绍如何增加一些无法单纯通过编排实现的插件。因为可能需要用到网络请求或第三方包。
上一章提到,在插件的 **template** 目录下,还有一个 **index.ts** 文件,这个文件就是用来执行一些插件的代码的。你可以通过在 HTTP 节点中的 URL填写插件的名字即可触发该方法下面以 **duckduckgo/search** 这个插件为例:
![](/imgs/plugin_submission5.png)
![](/imgs/plugin_submission6.png)
![](/imgs/plugin_submission7.png)
参考上面 3 张图片,当 HTTP 节点的 URL 为系统插件注册的名字时,该请求不会以 HTTP 形式发送,而是会请求到 index.ts 文件中的 main 方法。出入参则对应了 body 和自定义输出的字段名。
由于目前插件会默认插件输出均作为“工具调用”的结果,无法单独指定某些字段作为工具输出,所以,请避免插件的自定义输出携带大量说明字段。