diff --git a/docSite/assets/imgs/bing_search_plugin1.png b/docSite/assets/imgs/bing_search_plugin1.png new file mode 100644 index 000000000..27d51f03f Binary files /dev/null and b/docSite/assets/imgs/bing_search_plugin1.png differ diff --git a/docSite/assets/imgs/bing_search_plugin2.png b/docSite/assets/imgs/bing_search_plugin2.png new file mode 100644 index 000000000..fccaa5940 Binary files /dev/null and b/docSite/assets/imgs/bing_search_plugin2.png differ diff --git a/docSite/assets/imgs/bing_search_plugin3.png b/docSite/assets/imgs/bing_search_plugin3.png new file mode 100644 index 000000000..7c83fefb6 Binary files /dev/null and b/docSite/assets/imgs/bing_search_plugin3.png differ diff --git a/docSite/assets/imgs/bing_search_plugin4.png b/docSite/assets/imgs/bing_search_plugin4.png new file mode 100644 index 000000000..b4a428bbc Binary files /dev/null and b/docSite/assets/imgs/bing_search_plugin4.png differ diff --git a/docSite/assets/imgs/bing_search_plugin5.png b/docSite/assets/imgs/bing_search_plugin5.png new file mode 100644 index 000000000..fb0afe407 Binary files /dev/null and b/docSite/assets/imgs/bing_search_plugin5.png differ diff --git a/docSite/assets/imgs/doc2x_plugin1.png b/docSite/assets/imgs/doc2x_plugin1.png new file mode 100644 index 000000000..4d6d0126f Binary files /dev/null and b/docSite/assets/imgs/doc2x_plugin1.png differ diff --git a/docSite/assets/imgs/doc2x_plugin2.png b/docSite/assets/imgs/doc2x_plugin2.png new file mode 100644 index 000000000..a30379d21 Binary files /dev/null and b/docSite/assets/imgs/doc2x_plugin2.png differ diff --git a/docSite/assets/imgs/doc2x_plugin3.png b/docSite/assets/imgs/doc2x_plugin3.png new file mode 100644 index 000000000..c9ea407a0 Binary files /dev/null and b/docSite/assets/imgs/doc2x_plugin3.png differ diff --git a/docSite/assets/imgs/doc2x_plugin4.png b/docSite/assets/imgs/doc2x_plugin4.png new file mode 100644 index 000000000..aa549ab06 Binary files /dev/null and b/docSite/assets/imgs/doc2x_plugin4.png differ diff --git a/docSite/assets/imgs/document_analysis1.png b/docSite/assets/imgs/document_analysis1.png new file mode 100644 index 000000000..a1a76deb6 Binary files /dev/null and b/docSite/assets/imgs/document_analysis1.png differ diff --git a/docSite/assets/imgs/document_analysis2.png b/docSite/assets/imgs/document_analysis2.png new file mode 100644 index 000000000..b2e662fb0 Binary files /dev/null and b/docSite/assets/imgs/document_analysis2.png differ diff --git a/docSite/assets/imgs/google_search_plugin1.png b/docSite/assets/imgs/google_search_plugin1.png new file mode 100644 index 000000000..d9db7878c Binary files /dev/null and b/docSite/assets/imgs/google_search_plugin1.png differ diff --git a/docSite/assets/imgs/google_search_plugin2.png b/docSite/assets/imgs/google_search_plugin2.png new file mode 100644 index 000000000..6421bf151 Binary files /dev/null and b/docSite/assets/imgs/google_search_plugin2.png differ diff --git a/docSite/assets/imgs/google_search_plugin3.png b/docSite/assets/imgs/google_search_plugin3.png new file mode 100644 index 000000000..63542f66d Binary files /dev/null and b/docSite/assets/imgs/google_search_plugin3.png differ diff --git a/docSite/assets/imgs/google_search_plugin4.png b/docSite/assets/imgs/google_search_plugin4.png new file mode 100644 index 000000000..a6a4c7853 Binary files /dev/null and b/docSite/assets/imgs/google_search_plugin4.png differ diff --git a/docSite/assets/imgs/integration1.png b/docSite/assets/imgs/integration1.png new file mode 100644 index 000000000..c84df0175 Binary files /dev/null and b/docSite/assets/imgs/integration1.png differ diff --git a/docSite/assets/imgs/knowledge_merge1.png b/docSite/assets/imgs/knowledge_merge1.png new file mode 100644 index 000000000..fb3789f75 Binary files /dev/null and b/docSite/assets/imgs/knowledge_merge1.png differ diff --git a/docSite/assets/imgs/knowledge_merge2.png b/docSite/assets/imgs/knowledge_merge2.png new file mode 100644 index 000000000..acc4846ed Binary files /dev/null and b/docSite/assets/imgs/knowledge_merge2.png differ diff --git a/docSite/assets/imgs/knowledge_merge3.png b/docSite/assets/imgs/knowledge_merge3.png new file mode 100644 index 000000000..42e1bfc8b Binary files /dev/null and b/docSite/assets/imgs/knowledge_merge3.png differ diff --git a/docSite/assets/imgs/plugin_submission1.png b/docSite/assets/imgs/plugin_submission1.png new file mode 100644 index 000000000..07e7d89a1 Binary files /dev/null and b/docSite/assets/imgs/plugin_submission1.png differ diff --git a/docSite/assets/imgs/plugin_submission2.png b/docSite/assets/imgs/plugin_submission2.png new file mode 100644 index 000000000..5008d87ed Binary files /dev/null and b/docSite/assets/imgs/plugin_submission2.png differ diff --git a/docSite/assets/imgs/plugin_submission3.png b/docSite/assets/imgs/plugin_submission3.png new file mode 100644 index 000000000..a65cac416 Binary files /dev/null and b/docSite/assets/imgs/plugin_submission3.png differ diff --git a/docSite/assets/imgs/plugin_submission4.png b/docSite/assets/imgs/plugin_submission4.png new file mode 100644 index 000000000..bf46d5785 Binary files /dev/null and b/docSite/assets/imgs/plugin_submission4.png differ diff --git a/docSite/assets/imgs/plugin_submission5.png b/docSite/assets/imgs/plugin_submission5.png new file mode 100644 index 000000000..8aab80a34 Binary files /dev/null and b/docSite/assets/imgs/plugin_submission5.png differ diff --git a/docSite/assets/imgs/plugin_submission6.png b/docSite/assets/imgs/plugin_submission6.png new file mode 100644 index 000000000..5cb9829e7 Binary files /dev/null and b/docSite/assets/imgs/plugin_submission6.png differ diff --git a/docSite/assets/imgs/plugin_submission7.png b/docSite/assets/imgs/plugin_submission7.png new file mode 100644 index 000000000..a13d382f9 Binary files /dev/null and b/docSite/assets/imgs/plugin_submission7.png differ diff --git a/docSite/assets/imgs/points1.png b/docSite/assets/imgs/points1.png new file mode 100644 index 000000000..31714f247 Binary files /dev/null and b/docSite/assets/imgs/points1.png differ diff --git a/docSite/assets/imgs/spellcheck1.png b/docSite/assets/imgs/spellcheck1.png new file mode 100644 index 000000000..199264319 Binary files /dev/null and b/docSite/assets/imgs/spellcheck1.png differ diff --git a/docSite/assets/imgs/spellcheck2.png b/docSite/assets/imgs/spellcheck2.png new file mode 100644 index 000000000..9e6e502f5 Binary files /dev/null and b/docSite/assets/imgs/spellcheck2.png differ diff --git a/docSite/assets/imgs/spellcheck3.png b/docSite/assets/imgs/spellcheck3.png new file mode 100644 index 000000000..b7fa4eeca Binary files /dev/null and b/docSite/assets/imgs/spellcheck3.png differ diff --git a/docSite/assets/imgs/spellcheck4.png b/docSite/assets/imgs/spellcheck4.png new file mode 100644 index 000000000..4a4564e4c Binary files /dev/null and b/docSite/assets/imgs/spellcheck4.png differ diff --git a/docSite/assets/imgs/spellcheck5.png b/docSite/assets/imgs/spellcheck5.png new file mode 100644 index 000000000..4c29ada01 Binary files /dev/null and b/docSite/assets/imgs/spellcheck5.png differ diff --git a/docSite/assets/imgs/template_submission1.png b/docSite/assets/imgs/template_submission1.png new file mode 100644 index 000000000..7ea025d89 Binary files /dev/null and b/docSite/assets/imgs/template_submission1.png differ diff --git a/docSite/assets/imgs/template_submission2.png b/docSite/assets/imgs/template_submission2.png new file mode 100644 index 000000000..338d47b1a Binary files /dev/null and b/docSite/assets/imgs/template_submission2.png differ diff --git a/docSite/assets/imgs/template_submission3.png b/docSite/assets/imgs/template_submission3.png new file mode 100644 index 000000000..cc0897414 Binary files /dev/null and b/docSite/assets/imgs/template_submission3.png differ diff --git a/docSite/assets/imgs/template_submission4.png b/docSite/assets/imgs/template_submission4.png new file mode 100644 index 000000000..3ba1f0ee1 Binary files /dev/null and b/docSite/assets/imgs/template_submission4.png differ diff --git a/docSite/assets/imgs/translate1.png b/docSite/assets/imgs/translate1.png new file mode 100644 index 000000000..86d13d96d Binary files /dev/null and b/docSite/assets/imgs/translate1.png differ diff --git a/docSite/assets/imgs/translate10.png b/docSite/assets/imgs/translate10.png new file mode 100644 index 000000000..7705286c4 Binary files /dev/null and b/docSite/assets/imgs/translate10.png differ diff --git a/docSite/assets/imgs/translate11.png b/docSite/assets/imgs/translate11.png new file mode 100644 index 000000000..b8ec88ea8 Binary files /dev/null and b/docSite/assets/imgs/translate11.png differ diff --git a/docSite/assets/imgs/translate12.png b/docSite/assets/imgs/translate12.png new file mode 100644 index 000000000..c4d03b739 Binary files /dev/null and b/docSite/assets/imgs/translate12.png differ diff --git a/docSite/assets/imgs/translate13.png b/docSite/assets/imgs/translate13.png new file mode 100644 index 000000000..000719089 Binary files /dev/null and b/docSite/assets/imgs/translate13.png differ diff --git a/docSite/assets/imgs/translate14.png b/docSite/assets/imgs/translate14.png new file mode 100644 index 000000000..dc82701ec Binary files /dev/null and b/docSite/assets/imgs/translate14.png differ diff --git a/docSite/assets/imgs/translate15.png b/docSite/assets/imgs/translate15.png new file mode 100644 index 000000000..9076e97f1 Binary files /dev/null and b/docSite/assets/imgs/translate15.png differ diff --git a/docSite/assets/imgs/translate16.png b/docSite/assets/imgs/translate16.png new file mode 100644 index 000000000..366ed4bbf Binary files /dev/null and b/docSite/assets/imgs/translate16.png differ diff --git a/docSite/assets/imgs/translate17.png b/docSite/assets/imgs/translate17.png new file mode 100644 index 000000000..399935df7 Binary files /dev/null and b/docSite/assets/imgs/translate17.png differ diff --git a/docSite/assets/imgs/translate18.png b/docSite/assets/imgs/translate18.png new file mode 100644 index 000000000..6296c5a86 Binary files /dev/null and b/docSite/assets/imgs/translate18.png differ diff --git a/docSite/assets/imgs/translate19.png b/docSite/assets/imgs/translate19.png new file mode 100644 index 000000000..010160a07 Binary files /dev/null and b/docSite/assets/imgs/translate19.png differ diff --git a/docSite/assets/imgs/translate2.png b/docSite/assets/imgs/translate2.png new file mode 100644 index 000000000..55a764d21 Binary files /dev/null and b/docSite/assets/imgs/translate2.png differ diff --git a/docSite/assets/imgs/translate20.png b/docSite/assets/imgs/translate20.png new file mode 100644 index 000000000..ea7d3298f Binary files /dev/null and b/docSite/assets/imgs/translate20.png differ diff --git a/docSite/assets/imgs/translate21.png b/docSite/assets/imgs/translate21.png new file mode 100644 index 000000000..210137ac5 Binary files /dev/null and b/docSite/assets/imgs/translate21.png differ diff --git a/docSite/assets/imgs/translate3.png b/docSite/assets/imgs/translate3.png new file mode 100644 index 000000000..a4e9e1d2e Binary files /dev/null and b/docSite/assets/imgs/translate3.png differ diff --git a/docSite/assets/imgs/translate4.png b/docSite/assets/imgs/translate4.png new file mode 100644 index 000000000..7eae67077 Binary files /dev/null and b/docSite/assets/imgs/translate4.png differ diff --git a/docSite/assets/imgs/translate5.png b/docSite/assets/imgs/translate5.png new file mode 100644 index 000000000..7272932a8 Binary files /dev/null and b/docSite/assets/imgs/translate5.png differ diff --git a/docSite/assets/imgs/translate61.png b/docSite/assets/imgs/translate61.png new file mode 100644 index 000000000..4d2d781d6 Binary files /dev/null and b/docSite/assets/imgs/translate61.png differ diff --git a/docSite/assets/imgs/translate7.png b/docSite/assets/imgs/translate7.png new file mode 100644 index 000000000..44e2e8d0a Binary files /dev/null and b/docSite/assets/imgs/translate7.png differ diff --git a/docSite/assets/imgs/translate8.png b/docSite/assets/imgs/translate8.png new file mode 100644 index 000000000..9ba735bbd Binary files /dev/null and b/docSite/assets/imgs/translate8.png differ diff --git a/docSite/assets/imgs/translate9.png b/docSite/assets/imgs/translate9.png new file mode 100644 index 000000000..d2cd500e9 Binary files /dev/null and b/docSite/assets/imgs/translate9.png differ diff --git a/docSite/assets/imgs/user-selection1.png b/docSite/assets/imgs/user-selection1.png new file mode 100644 index 000000000..a629af4e8 Binary files /dev/null and b/docSite/assets/imgs/user-selection1.png differ diff --git a/docSite/assets/imgs/user-selection2.png b/docSite/assets/imgs/user-selection2.png new file mode 100644 index 000000000..ab5fede1d Binary files /dev/null and b/docSite/assets/imgs/user-selection2.png differ diff --git a/docSite/assets/imgs/user-selection3.png b/docSite/assets/imgs/user-selection3.png new file mode 100644 index 000000000..8acfb7752 Binary files /dev/null and b/docSite/assets/imgs/user-selection3.png differ diff --git a/docSite/assets/imgs/variable_update1.png b/docSite/assets/imgs/variable_update1.png new file mode 100644 index 000000000..569238d27 Binary files /dev/null and b/docSite/assets/imgs/variable_update1.png differ diff --git a/docSite/assets/imgs/variable_update2.png b/docSite/assets/imgs/variable_update2.png new file mode 100644 index 000000000..0f4a72b2f Binary files /dev/null and b/docSite/assets/imgs/variable_update2.png differ diff --git a/docSite/assets/imgs/variable_update3.png b/docSite/assets/imgs/variable_update3.png new file mode 100644 index 000000000..182d7e5ba Binary files /dev/null and b/docSite/assets/imgs/variable_update3.png differ diff --git a/docSite/assets/imgs/variable_update4.png b/docSite/assets/imgs/variable_update4.png new file mode 100644 index 000000000..cd8f35eb8 Binary files /dev/null and b/docSite/assets/imgs/variable_update4.png differ diff --git a/docSite/assets/imgs/variable_update5.png b/docSite/assets/imgs/variable_update5.png new file mode 100644 index 000000000..fdfb454e6 Binary files /dev/null and b/docSite/assets/imgs/variable_update5.png differ diff --git a/docSite/content/zh-cn/docs/development/migration/ docker_mongo.md b/docSite/content/zh-cn/docs/development/migration/docker_mongo.md similarity index 100% rename from docSite/content/zh-cn/docs/development/migration/ docker_mongo.md rename to docSite/content/zh-cn/docs/development/migration/docker_mongo.md diff --git a/docSite/content/zh-cn/docs/faq/_index.md b/docSite/content/zh-cn/docs/faq/_index.md index 89cec79b3..d789768bd 100644 --- a/docSite/content/zh-cn/docs/faq/_index.md +++ b/docSite/content/zh-cn/docs/faq/_index.md @@ -6,6 +6,6 @@ draft: false toc: true weight: 900 --- - + FastGPT 是一个由用户和贡献者参与推动的开源项目,如果您对产品使用存在疑问和建议,可尝试[加入社区](community)寻求支持。我们的团队与社区会竭尽所能为您提供帮助。 \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/faq/app.md b/docSite/content/zh-cn/docs/faq/app.md index 3819bd4d2..41e427276 100644 --- a/docSite/content/zh-cn/docs/faq/app.md +++ b/docSite/content/zh-cn/docs/faq/app.md @@ -4,7 +4,7 @@ description: 'FastGPT 常见应用使用问题,包括简易应用、工作流 icon: 'quiz' draft: false toc: true -weight: 903 +weight: 908 --- ## 工作流中多轮对话场景中如何使连续问题被问题分类节点正确的归类 diff --git a/docSite/content/zh-cn/docs/faq/chat.md b/docSite/content/zh-cn/docs/faq/chat.md index 758905b1c..93aeb1afc 100644 --- a/docSite/content/zh-cn/docs/faq/chat.md +++ b/docSite/content/zh-cn/docs/faq/chat.md @@ -4,7 +4,7 @@ description: 'FastGPT 常见聊天框问题' icon: 'quiz' draft: false toc: true -weight: 905 +weight: 906 --- ## 我修改了工作台的应用,为什么在“聊天”时没有更新配置? diff --git a/docSite/content/zh-cn/docs/faq/dataset.md b/docSite/content/zh-cn/docs/faq/dataset.md index 3a9130636..e66ebc01e 100644 --- a/docSite/content/zh-cn/docs/faq/dataset.md +++ b/docSite/content/zh-cn/docs/faq/dataset.md @@ -4,7 +4,7 @@ description: '常见知识库使用问题' icon: 'quiz' draft: false toc: true -weight: 904 +weight: 910 --- ## 上传的文件内容出现中文乱码 diff --git a/docSite/content/zh-cn/docs/faq/docker.md b/docSite/content/zh-cn/docs/faq/docker.md index c34491cac..8b1e6e375 100644 --- a/docSite/content/zh-cn/docs/faq/docker.md +++ b/docSite/content/zh-cn/docs/faq/docker.md @@ -4,7 +4,7 @@ description: 'FastGPT Docker 部署问题' icon: '' draft: false toc: true -weight: 901 +weight: 902 type: redirect target: /docs/development/docker/#faq --- diff --git a/docSite/content/zh-cn/docs/faq/error.md b/docSite/content/zh-cn/docs/faq/error.md index 330f47f81..f0a0ee3f8 100644 --- a/docSite/content/zh-cn/docs/faq/error.md +++ b/docSite/content/zh-cn/docs/faq/error.md @@ -1,7 +1,15 @@ --- -title: '常见错误' +title: '报错' icon: 'quiz' draft: false toc: true -weight: 920 ---- \ No newline at end of file +weight: 914 +--- + +1. ### 当前分组上游负载已饱和,请稍后再试(request id:202407100753411462086782835521) + +是oneapi渠道的问题,可以换个模型用or换一家中转站 + +1. ### 使用API时在日志中报错Connection Error + +大概率是api-key填写了openapi,然后部署的服务器在国内,不能访问海外的api,可以使用中转或者反代的手段解决访问不到的问题 \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/faq/external_channel_integration.md b/docSite/content/zh-cn/docs/faq/external_channel_integration.md new file mode 100644 index 000000000..2134bdc93 --- /dev/null +++ b/docSite/content/zh-cn/docs/faq/external_channel_integration.md @@ -0,0 +1,18 @@ +--- +title: "接入外部渠道" +description: "如何通过外部渠道与 FastGPT 集成,实现对多种平台的支持" +icon: "integration" +draft: false +toc: true +weight: 912 +--- + +1. ### 接入cow,图文对话无法直接显示图片 + +提示词给引导,不要以markdown格式输出。图片需要二开 cow 实现图片链接截取并发送。 + +1. ### 可以获取到用户发送问答的记录吗 + +在应用的对话日志里可以查看。 + +![](/imgs/integration1.png) \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/faq/other.md b/docSite/content/zh-cn/docs/faq/other.md index baf557a2e..b8adf64f2 100644 --- a/docSite/content/zh-cn/docs/faq/other.md +++ b/docSite/content/zh-cn/docs/faq/other.md @@ -3,7 +3,7 @@ title: '其他问题' icon: 'quiz' draft: false toc: true -weight: 925 +weight: 918 --- ## oneapi 官网是哪个 diff --git a/docSite/content/zh-cn/docs/faq/points_consumption.md b/docSite/content/zh-cn/docs/faq/points_consumption.md new file mode 100644 index 000000000..2eb0f6d5c --- /dev/null +++ b/docSite/content/zh-cn/docs/faq/points_consumption.md @@ -0,0 +1,14 @@ +--- +title: "积分消耗" +description: "了解 FastGPT 中的积分消耗机制和使用场景" +icon: "points" +draft: false +toc: true +weight: 916 +--- + +1. ### 接入oneapi后,为什么还会消耗fastgpt的积分 + +矢量数据库检索会默认消耗。可以查看看绑定提示和使用记录。 + +![](/imgs/points1.png) \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/faq/privateDeploy.md b/docSite/content/zh-cn/docs/faq/privateDeploy.md index 9f1643f58..1032ba989 100644 --- a/docSite/content/zh-cn/docs/faq/privateDeploy.md +++ b/docSite/content/zh-cn/docs/faq/privateDeploy.md @@ -4,7 +4,7 @@ description: "FastGPT 私有部署常见问题" icon: upgrade draft: false images: [] -weight: 902 +weight: 904 type: redirect target: /docs/development/faq/ --- \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/guide/_index.md b/docSite/content/zh-cn/docs/guide/_index.md new file mode 100644 index 000000000..a6c7ada72 --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/_index.md @@ -0,0 +1,9 @@ +--- +weight: 100 +title: '功能介绍' +description: 'FastGPT 的功能和使用指南' +icon: 'import_contacts' +draft: false +images: [] +--- + \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/course/_index.md b/docSite/content/zh-cn/docs/guide/course/_index.md similarity index 87% rename from docSite/content/zh-cn/docs/course/_index.md rename to docSite/content/zh-cn/docs/guide/course/_index.md index 3c6b4b37a..9a49870d0 100644 --- a/docSite/content/zh-cn/docs/course/_index.md +++ b/docSite/content/zh-cn/docs/guide/course/_index.md @@ -6,4 +6,4 @@ icon: 'import_contacts' draft: false images: [] --- - \ No newline at end of file + \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/course/ai_settings.md b/docSite/content/zh-cn/docs/guide/course/ai_settings.md similarity index 99% rename from docSite/content/zh-cn/docs/course/ai_settings.md rename to docSite/content/zh-cn/docs/guide/course/ai_settings.md index 3f206a5d4..b05961955 100644 --- a/docSite/content/zh-cn/docs/course/ai_settings.md +++ b/docSite/content/zh-cn/docs/guide/course/ai_settings.md @@ -4,7 +4,7 @@ description: "FastGPT AI 相关参数配置说明" icon: "sign_language" draft: false toc: true -weight: 102 +weight: 104 --- 在 FastGPT 的 AI 对话模块中,有一个 AI 高级配置,里面包含了 AI 模型的参数配置,本文详细介绍这些配置的含义。 diff --git a/docSite/content/zh-cn/docs/course/chat_input_guide.md b/docSite/content/zh-cn/docs/guide/course/chat_input_guide.md similarity index 98% rename from docSite/content/zh-cn/docs/course/chat_input_guide.md rename to docSite/content/zh-cn/docs/guide/course/chat_input_guide.md index 07c8436b0..155cdfdb3 100644 --- a/docSite/content/zh-cn/docs/course/chat_input_guide.md +++ b/docSite/content/zh-cn/docs/guide/course/chat_input_guide.md @@ -4,7 +4,7 @@ description: "FastGPT 对话问题引导" icon: "code" draft: false toc: true -weight: 108 +weight: 106 --- ![](/imgs/questionGuide.png) diff --git a/docSite/content/zh-cn/docs/course/collection_tags.md b/docSite/content/zh-cn/docs/guide/course/collection_tags.md similarity index 100% rename from docSite/content/zh-cn/docs/course/collection_tags.md rename to docSite/content/zh-cn/docs/guide/course/collection_tags.md diff --git a/docSite/content/zh-cn/docs/course/fileInput.md b/docSite/content/zh-cn/docs/guide/course/fileInput.md similarity index 100% rename from docSite/content/zh-cn/docs/course/fileInput.md rename to docSite/content/zh-cn/docs/guide/course/fileInput.md diff --git a/docSite/content/zh-cn/docs/course/quick-start.md b/docSite/content/zh-cn/docs/guide/course/quick-start.md similarity index 99% rename from docSite/content/zh-cn/docs/course/quick-start.md rename to docSite/content/zh-cn/docs/guide/course/quick-start.md index 6f6397b33..f9e0ac475 100644 --- a/docSite/content/zh-cn/docs/course/quick-start.md +++ b/docSite/content/zh-cn/docs/guide/course/quick-start.md @@ -4,7 +4,7 @@ description: '快速体验 FastGPT 基础功能' icon: 'rocket_launch' draft: false toc: true -weight: 101 +weight: 102 --- 更多使用技巧,[查看视屏教程](https://www.bilibili.com/video/BV1sH4y1T7s9) diff --git a/docSite/content/zh-cn/docs/course/RAG.md b/docSite/content/zh-cn/docs/guide/knowledge_base/RAG.md similarity index 99% rename from docSite/content/zh-cn/docs/course/RAG.md rename to docSite/content/zh-cn/docs/guide/knowledge_base/RAG.md index ef312ce0a..ad6d877f7 100644 --- a/docSite/content/zh-cn/docs/course/RAG.md +++ b/docSite/content/zh-cn/docs/guide/knowledge_base/RAG.md @@ -4,7 +4,7 @@ description: '本节详细介绍RAG模型的核心机制、应用场景及其在 icon: 'language' draft: false toc: true -weight: 106 +weight: 402 --- [RAG文档](https://huggingface.co/docs/transformers/model_doc/rag) @@ -83,7 +83,7 @@ RAG(检索增强生成)模型通过结合检索器和生成器,实现了 RAG模型的性能很大程度上取决于检索器返回的文档质量。由于生成器主要依赖检索器提供的上下文信息,如果检索到的文档片段不相关、不准确,生成的文本可能出现偏差,甚至产生误导性的结果。尤其在多模糊查询或跨领域检索的情况下,检索器可能无法找到合适的片段,这将直接影响生成内容的连贯性和准确性。 - 挑战:当知识库庞大且内容多样时,如何提高检索器在复杂问题下的精确度是一大挑战。当前的方法如BM25等在特定任务上有局限,尤其是在面对语义模糊的查询时,传统的关键词匹配方式可能无法提供语义上相关的内容。 -- 解决途径:引入混合检索技术,如结合稀疏检索(BM25)与密集检索(如向量检索)。例如,[Faiss](https://fael3z0zfze.feishu.cn/wiki/LULawsUufitGvWkDjx3cKJqHnle?from=from_copylink)的底层实现允许通过BERT等模型生成密集向量表示,显著提升语义级别的匹配效果。通过这种方式,检索器可以捕捉深层次的语义相似性,减少无关文档对生成器的负面影响。 +- 解决途径:引入混合检索技术,如结合稀疏检索(BM25)与密集检索(如向量检索)。例如,Faiss的底层实现允许通过BERT等模型生成密集向量表示,显著提升语义级别的匹配效果。通过这种方式,检索器可以捕捉深层次的语义相似性,减少无关文档对生成器的负面影响。 #### 4.2.2 生成器的计算复杂度与性能瓶颈 diff --git a/docSite/content/zh-cn/docs/guide/knowledge_base/_index.md b/docSite/content/zh-cn/docs/guide/knowledge_base/_index.md new file mode 100644 index 000000000..61d5b9279 --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/knowledge_base/_index.md @@ -0,0 +1,9 @@ +--- +weight: 400 +title: '知识库' +description: '知识库的基础原理、搜索方案、Web站点同步和外部文件知识库的使用方法。' +icon: 'book' +draft: false +images: [] +--- + \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/course/dataset_engine.md b/docSite/content/zh-cn/docs/guide/knowledge_base/dataset_engine.md similarity index 99% rename from docSite/content/zh-cn/docs/course/dataset_engine.md rename to docSite/content/zh-cn/docs/guide/knowledge_base/dataset_engine.md index bac049397..969e31108 100644 --- a/docSite/content/zh-cn/docs/course/dataset_engine.md +++ b/docSite/content/zh-cn/docs/guide/knowledge_base/dataset_engine.md @@ -4,7 +4,7 @@ description: '本节会详细介绍 FastGPT 知识库结构设计,理解其 QA icon: 'language' draft: false toc: true -weight: 106 +weight: 404 --- ## 理解向量 diff --git a/docSite/content/zh-cn/docs/course/externalFile.md b/docSite/content/zh-cn/docs/guide/knowledge_base/externalFile.md similarity index 99% rename from docSite/content/zh-cn/docs/course/externalFile.md rename to docSite/content/zh-cn/docs/guide/knowledge_base/externalFile.md index b1c056526..f7b8dc9b3 100644 --- a/docSite/content/zh-cn/docs/course/externalFile.md +++ b/docSite/content/zh-cn/docs/guide/knowledge_base/externalFile.md @@ -4,7 +4,7 @@ description: 'FastGPT 外部文件知识库功能介绍和使用方式' icon: 'language' draft: false toc: true -weight: 107 +weight: 408 --- 外部文件库是 FastGPT 商业版特有功能。它允许接入你现在的文件系统,无需将文件再导入一份到 FastGPT 中。 diff --git a/docSite/content/zh-cn/docs/course/websync.md b/docSite/content/zh-cn/docs/guide/knowledge_base/websync.md similarity index 99% rename from docSite/content/zh-cn/docs/course/websync.md rename to docSite/content/zh-cn/docs/guide/knowledge_base/websync.md index 8374f068c..1f4bf2bfc 100644 --- a/docSite/content/zh-cn/docs/course/websync.md +++ b/docSite/content/zh-cn/docs/guide/knowledge_base/websync.md @@ -4,7 +4,7 @@ description: 'FastGPT Web 站点同步功能介绍和使用方式' icon: 'language' draft: false toc: true -weight: 105 +weight: 406 --- ![](/imgs/webSync1.jpg) diff --git a/docSite/content/zh-cn/docs/guide/plugins/_index.md b/docSite/content/zh-cn/docs/guide/plugins/_index.md new file mode 100644 index 000000000..d192e5945 --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/plugins/_index.md @@ -0,0 +1,9 @@ +--- +weight: 300 +title: '系统插件' +description: '介绍如何使用和提交系统插件,以及各插件的填写说明' +icon: 'extension' +draft: false +images: [] +--- + \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/guide/plugins/bing_search_plugin.md b/docSite/content/zh-cn/docs/guide/plugins/bing_search_plugin.md new file mode 100644 index 000000000..25ae9521f --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/plugins/bing_search_plugin.md @@ -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) \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/guide/plugins/doc2x_plugin_guide.md b/docSite/content/zh-cn/docs/guide/plugins/doc2x_plugin_guide.md new file mode 100644 index 000000000..e1e70570b --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/plugins/doc2x_plugin_guide.md @@ -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) \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/guide/plugins/google_search_plugin_guide.md b/docSite/content/zh-cn/docs/guide/plugins/google_search_plugin_guide.md new file mode 100644 index 000000000..432e2cab0 --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/plugins/google_search_plugin_guide.md @@ -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) \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/guide/plugins/how_to_submit_system_plugin.md b/docSite/content/zh-cn/docs/guide/plugins/how_to_submit_system_plugin.md new file mode 100644 index 000000000..e8168bdee --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/plugins/how_to_submit_system_plugin.md @@ -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 和自定义输出的字段名。 + +由于目前插件会默认插件输出均作为“工具调用”的结果,无法单独指定某些字段作为工具输出,所以,请避免插件的自定义输出携带大量说明字段。 \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/guide/team_permissions/_index.md b/docSite/content/zh-cn/docs/guide/team_permissions/_index.md new file mode 100644 index 000000000..a85eed375 --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/team_permissions/_index.md @@ -0,0 +1,9 @@ +--- +weight: 450 +title: '团队与权限' +description: '团队管理、成员组与权限设置,确保团队协作中的数据安全和权限分配合理。' +icon: 'group' +draft: false +images: [] +--- + \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/guide/team_permissions/team_roles_permissions.md b/docSite/content/zh-cn/docs/guide/team_permissions/team_roles_permissions.md new file mode 100644 index 000000000..f76256a72 --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/team_permissions/team_roles_permissions.md @@ -0,0 +1,8 @@ +--- +title: "团队&成员组&权限" +description: "如何管理 FastGPT 团队、成员组及权限设置" +icon: "group" +draft: false +toc: true +weight: 450 +--- \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/guide/workbench/_index.md b/docSite/content/zh-cn/docs/guide/workbench/_index.md new file mode 100644 index 000000000..375fb800b --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/workbench/_index.md @@ -0,0 +1,9 @@ +--- +weight: 200 +title: '工作台' +description: 'FastGPT 工作台及工作流节点的使用说明' +icon: 'dashboard' +draft: false +images: [] +--- + \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/guide/workbench/basic-mode.md b/docSite/content/zh-cn/docs/guide/workbench/basic-mode.md new file mode 100644 index 000000000..8fb4353d4 --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/workbench/basic-mode.md @@ -0,0 +1,8 @@ +--- +weight: 202 +title: '简易模式' +description: '快速了解 FastGPT 工作台的简易模式' +icon: 'speed' +draft: false +images: [] +--- \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/use-cases/gapier.md b/docSite/content/zh-cn/docs/guide/workbench/gapier.md similarity index 99% rename from docSite/content/zh-cn/docs/use-cases/gapier.md rename to docSite/content/zh-cn/docs/guide/workbench/gapier.md index 0a38e6860..043a3a936 100644 --- a/docSite/content/zh-cn/docs/use-cases/gapier.md +++ b/docSite/content/zh-cn/docs/guide/workbench/gapier.md @@ -4,7 +4,7 @@ description: "FastGPT 使用 Gapier 快速导入Agent工具" icon: "build" draft: false toc: true -weight: 501 +weight: 300 --- FastGPT V4.7版本加入了工具调用,可以兼容 GPTs 的 Actions。这意味着,你可以直接导入兼容 GPTs 的 Agent 工具。 diff --git a/docSite/content/zh-cn/docs/workflow/intro.md b/docSite/content/zh-cn/docs/guide/workbench/intro.md similarity index 97% rename from docSite/content/zh-cn/docs/workflow/intro.md rename to docSite/content/zh-cn/docs/guide/workbench/intro.md index 43f90669c..e5d8b1c5c 100644 --- a/docSite/content/zh-cn/docs/workflow/intro.md +++ b/docSite/content/zh-cn/docs/guide/workbench/intro.md @@ -1,10 +1,10 @@ --- -title: "高级编排介绍" -description: "快速了解 FastGPT 高级编排" -icon: "circle" +title: "工作流&插件" +description: "快速了解 FastGPT 工作流和插件的使用" +icon: "extension" draft: false toc: true -weight: 301 +weight: 220 --- FastGPT 从 V4 版本开始采用新的交互方式来构建 AI 应用。使用了 Flow 节点编排(工作流)的方式来实现复杂工作流,提高可玩性和扩展性。但同时也提高了上手的门槛,有一定开发背景的用户使用起来会比较容易。 diff --git a/docSite/content/zh-cn/docs/guide/workbench/workflow/_index.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/_index.md new file mode 100644 index 000000000..d361afe8a --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/_index.md @@ -0,0 +1,9 @@ +--- +weight: 230 +title: '工作流节点' +description: 'FastGPT 工作流节点设置和使用指南' +icon: 'workflow' +draft: false +images: [] +--- + diff --git a/docSite/content/zh-cn/docs/workflow/modules/ai_chat.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/ai_chat.md similarity index 98% rename from docSite/content/zh-cn/docs/workflow/modules/ai_chat.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/ai_chat.md index 7f982998f..fd29f3368 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/ai_chat.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/ai_chat.md @@ -4,7 +4,7 @@ description: "FastGPT AI 对话模块介绍" icon: "chat" draft: false toc: true -weight: 351 +weight: 232 --- ## 特点 diff --git a/docSite/content/zh-cn/docs/workflow/modules/content_extract.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/content_extract.md similarity index 97% rename from docSite/content/zh-cn/docs/workflow/modules/content_extract.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/content_extract.md index 78677a1de..17eebfb2f 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/content_extract.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/content_extract.md @@ -1,10 +1,10 @@ --- -title: "内容提取" +title: "文本内容提取" description: "FastGPT 内容提取模块介绍" icon: "content_paste_go" draft: false toc: true -weight: 352 +weight: 240 --- ## 特点 diff --git a/docSite/content/zh-cn/docs/workflow/modules/coreferenceResolution.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/coreferenceResolution.md similarity index 95% rename from docSite/content/zh-cn/docs/workflow/modules/coreferenceResolution.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/coreferenceResolution.md index e8a06e4c2..f14ffb4a5 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/coreferenceResolution.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/coreferenceResolution.md @@ -1,10 +1,10 @@ --- -title: "问题优化(已合并到知识库搜索)" +title: "问题优化" description: "问题优化模块介绍和使用" icon: "input" draft: false toc: true -weight: 364 +weight: 264 --- ## 特点 diff --git a/docSite/content/zh-cn/docs/workflow/modules/custom_feedback.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/custom_feedback.md similarity index 98% rename from docSite/content/zh-cn/docs/workflow/modules/custom_feedback.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/custom_feedback.md index c6733e95b..cec0bbf04 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/custom_feedback.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/custom_feedback.md @@ -4,7 +4,7 @@ description: "自定义反馈模块介绍" icon: "feedback" draft: false toc: true -weight: 354 +weight: 268 --- 该模块为临时模块,后续会针对该模块进行更全面的设计。 diff --git a/docSite/content/zh-cn/docs/workflow/modules/dataset_search.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/dataset_search.md similarity index 98% rename from docSite/content/zh-cn/docs/workflow/modules/dataset_search.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/dataset_search.md index ecdb88200..df8767de8 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/dataset_search.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/dataset_search.md @@ -4,7 +4,7 @@ description: 'FastGPT AI 知识库搜索模块介绍' icon: 'chat' draft: false toc: true -weight: 357 +weight: 234 --- 知识库搜索具体参数说明,以及内部逻辑请移步:[FastGPT知识库搜索方案](/docs/course/data_search/) diff --git a/docSite/content/zh-cn/docs/guide/workbench/workflow/document_parsing.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/document_parsing.md new file mode 100644 index 000000000..1d84b385a --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/document_parsing.md @@ -0,0 +1,20 @@ +--- +title: "文档解析" +description: "FastGPT 文档解析模块介绍" +icon: "document_analysis" +draft: false +toc: true +weight: 250 +--- + +
+ 文档解析示例 1 + 文档解析示例 2 +
+ + +开启文件上传后,可使用文档解析组件。 + +## 功能 + +## 作用 \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/guide/workbench/workflow/form_input.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/form_input.md new file mode 100644 index 000000000..7fcb28c7d --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/form_input.md @@ -0,0 +1,8 @@ +--- +title: "表单输入" +description: "FastGPT 表单输入模块介绍" +icon: "form_input" +draft: false +toc: true +weight: 244 +--- \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/workflow/modules/http.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/http.md similarity index 99% rename from docSite/content/zh-cn/docs/workflow/modules/http.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/http.md index 0285bf849..a57b3ac64 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/http.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/http.md @@ -1,10 +1,10 @@ --- -title: "HTTP 模块" +title: "HTTP 请求" description: "FastGPT HTTP 模块介绍" icon: "http" draft: false toc: true -weight: 355 +weight: 252 --- ## 特点 diff --git a/docSite/content/zh-cn/docs/guide/workbench/workflow/knowledge_base_search_merge.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/knowledge_base_search_merge.md new file mode 100644 index 000000000..eafccd769 --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/knowledge_base_search_merge.md @@ -0,0 +1,29 @@ +--- +title: "知识库搜索引用合并" +description: "FastGPT 知识库搜索引用合并模块介绍" +icon: "knowledge_merge" +draft: false +toc: true +weight: 262 +--- + + +![](/imgs/knowledge_merge1.png) + +## 作用 + +将多个知识库搜索结果合并成一个结果进行输出,并会通过 RRF 进行重新排序(根据排名情况),并且支持最大 tokens 过滤。 + +## 使用方法 + +AI对话只能接收一个知识库引用内容。因此,如果调用了多个知识库,无法直接引用所有知识库(如下图) + +![](/imgs/knowledge_merge2.png) + +使用**知识库搜索引用合并**,可以把多个知识库的搜索结果合在一起。 + +![](/imgs/knowledge_merge3.png) + +## 可用例子: + +1. 经过问题分类后对不同知识库进行检索,然后统一给一个 AI 进行回答,此时可以用到合并,不需要每个分支都添加一个 AI 对话。 \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/workflow/modules/laf.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/laf.md similarity index 99% rename from docSite/content/zh-cn/docs/workflow/modules/laf.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/laf.md index 943e7ba4e..71b2d622e 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/laf.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/laf.md @@ -4,7 +4,7 @@ description: "FastGPT Laf 函数调用模块介绍" icon: "code" draft: false toc: true -weight: 355 +weight: 266 --- diff --git a/docSite/content/zh-cn/docs/workflow/modules/loop.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/loop.md similarity index 99% rename from docSite/content/zh-cn/docs/workflow/modules/loop.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/loop.md index 41f29fd94..7b32a91cd 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/loop.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/loop.md @@ -1,10 +1,10 @@ --- -title: "循环运行" +title: "循环执行" description: "FastGPT 循环运行节点介绍和使用" icon: "input" draft: false toc: true -weight: 366 +weight: 260 --- ## 节点概述 diff --git a/docSite/content/zh-cn/docs/workflow/modules/question_classify.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/question_classify.md similarity index 99% rename from docSite/content/zh-cn/docs/workflow/modules/question_classify.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/question_classify.md index c017238e3..54db28b1e 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/question_classify.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/question_classify.md @@ -4,7 +4,7 @@ description: "FastGPT 问题分类模块介绍" icon: "quiz" draft: false toc: true -weight: 358 +weight: 238 --- ## 特点 diff --git a/docSite/content/zh-cn/docs/workflow/modules/reply.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/reply.md similarity index 97% rename from docSite/content/zh-cn/docs/workflow/modules/reply.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/reply.md index b6d4b7071..2cfdbdfae 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/reply.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/reply.md @@ -4,7 +4,7 @@ description: "FastGPT 指定回复模块介绍" icon: "reply" draft: false toc: true -weight: 359 +weight: 248 --- ## 特点 diff --git a/docSite/content/zh-cn/docs/workflow/modules/sandbox.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/sandbox.md similarity index 99% rename from docSite/content/zh-cn/docs/workflow/modules/sandbox.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/sandbox.md index 5c968412f..4a6a7aad7 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/sandbox.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/sandbox.md @@ -4,7 +4,7 @@ description: "FastGPT 代码运行节点介绍" icon: "input" draft: false toc: true -weight: 364 +weight: 258 --- ![alt text](/imgs/image.png) diff --git a/docSite/content/zh-cn/docs/workflow/modules/text_editor.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/text_editor.md similarity index 94% rename from docSite/content/zh-cn/docs/workflow/modules/text_editor.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/text_editor.md index c1ca7b761..daad87a67 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/text_editor.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/text_editor.md @@ -1,10 +1,10 @@ --- -title: "文本加工" +title: "文本拼接" description: "FastGPT 文本加工模块介绍" icon: "input" draft: false toc: true -weight: 363 +weight: 246 --- ## 特点 diff --git a/docSite/content/zh-cn/docs/workflow/modules/tfswitch.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/tfswitch.md similarity index 98% rename from docSite/content/zh-cn/docs/workflow/modules/tfswitch.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/tfswitch.md index 9cb7a3983..2255a0506 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/tfswitch.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/tfswitch.md @@ -4,7 +4,7 @@ description: "FastGPT 判断器模块介绍" icon: "input" draft: false toc: true -weight: 362 +weight: 254 --- ## 特点 diff --git a/docSite/content/zh-cn/docs/workflow/modules/tool.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/tool.md similarity index 98% rename from docSite/content/zh-cn/docs/workflow/modules/tool.md rename to docSite/content/zh-cn/docs/guide/workbench/workflow/tool.md index ea3b1e82a..1b9c7322b 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/tool.md +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/tool.md @@ -1,10 +1,10 @@ --- -title: "工具调用" +title: "工具调用&终止" description: "FastGPT 工具调用模块介绍" icon: "build" draft: false toc: true -weight: 356 +weight: 236 --- ![](/imgs/flow-tool1.png) diff --git a/docSite/content/zh-cn/docs/guide/workbench/workflow/user-selection.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/user-selection.md new file mode 100644 index 000000000..ef7a6490e --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/user-selection.md @@ -0,0 +1,32 @@ +--- +title: "用户选择" +description: "FastGPT 用户选择模块的使用说明" +icon: "user_check" +draft: false +toc: true +weight: 242 +--- + +## 特点 + +- 用户交互 +- 可重复添加 +- 触发执行 + +![](/imgs/user-selection1.png) + +## 功能 + +「用户选择」节点属于用户交互节点,当触发这个节点时,对话会进入“交互”状态,会记录工作流的状态,等用户完成交互后,继续向下执行工作流 + +![](/imgs/user-selection2.png) + +比如上图中的例子,当触发用户选择节点时,对话框隐藏,对话进入“交互状态” + +![](/imgs/user-selection3.png) + +当用户做出选择时,节点会判断用户的选择,执行“是”的分支 + +## 作用 + +基础的用法为提出需要用户做抉择的问题,然后根据用户的反馈设计不同的工作流流程 \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/guide/workbench/workflow/variable_update.md b/docSite/content/zh-cn/docs/guide/workbench/workflow/variable_update.md new file mode 100644 index 000000000..e0c0be108 --- /dev/null +++ b/docSite/content/zh-cn/docs/guide/workbench/workflow/variable_update.md @@ -0,0 +1,38 @@ +--- +title: "变量更新" +description: "FastGPT 变量更新模块介绍" +icon: "variable_update" +draft: false +toc: true +weight: 256 +--- + +## 特点 + +- 可重复添加 +- 有外部输入 +- 触发执行 +- 手动配置 + +![](/imgs/variable_update1.png) + +## 功能 + +- 更新指定节点的输出值 + +![](/imgs/variable_update2.png) + +![](/imgs/variable_update3.png) + +- 更新全局变量 + +![](/imgs/variable_update4.png) + +![](/imgs/variable_update5.png) + +## 作用 + +最基础的使用场景为 + +- 给一个「自定义变量」类型的全局变量赋值,从而实现全局变量无需用户输入 +- 更新「变量更新」节点前的工作流节点输出,在后续使用中,使用的节点输出值为新的输出 \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/commercial/_index.md b/docSite/content/zh-cn/docs/shopping_cart/_index.md similarity index 100% rename from docSite/content/zh-cn/docs/commercial/_index.md rename to docSite/content/zh-cn/docs/shopping_cart/_index.md diff --git a/docSite/content/zh-cn/docs/commercial/intro.md b/docSite/content/zh-cn/docs/shopping_cart/intro.md similarity index 99% rename from docSite/content/zh-cn/docs/commercial/intro.md rename to docSite/content/zh-cn/docs/shopping_cart/intro.md index 4012972ec..70cd02531 100644 --- a/docSite/content/zh-cn/docs/commercial/intro.md +++ b/docSite/content/zh-cn/docs/shopping_cart/intro.md @@ -4,7 +4,7 @@ description: 'FastGPT 商业版相关说明' icon: 'shopping_cart' draft: false toc: true -weight: 1001 +weight: 1104 --- ## 简介 diff --git a/docSite/content/zh-cn/docs/commercial/saas.md b/docSite/content/zh-cn/docs/shopping_cart/saas.md similarity index 95% rename from docSite/content/zh-cn/docs/commercial/saas.md rename to docSite/content/zh-cn/docs/shopping_cart/saas.md index 6dcf3070d..f3c1d29cc 100644 --- a/docSite/content/zh-cn/docs/commercial/saas.md +++ b/docSite/content/zh-cn/docs/shopping_cart/saas.md @@ -4,7 +4,7 @@ description: 'FastGPT 线上版定价' icon: 'currency_yen' draft: false toc: true -weight: 1002 +weight: 1102 type: redirect target: https://cloud.tryfastgpt.ai/price --- diff --git a/docSite/content/zh-cn/docs/use-cases/app-cases/_index.md b/docSite/content/zh-cn/docs/use-cases/app-cases/_index.md new file mode 100644 index 000000000..84e64c71d --- /dev/null +++ b/docSite/content/zh-cn/docs/use-cases/app-cases/_index.md @@ -0,0 +1,8 @@ +--- +title: "应用搭建案例" +description: "FastGPT 应用场景及功能实现的搭建案例" +icon: "construction" +draft: false +weight: 600 +--- + diff --git a/docSite/content/zh-cn/docs/workflow/examples/dalle3.md b/docSite/content/zh-cn/docs/use-cases/app-cases/dalle3.md similarity index 99% rename from docSite/content/zh-cn/docs/workflow/examples/dalle3.md rename to docSite/content/zh-cn/docs/use-cases/app-cases/dalle3.md index d3f3c9a1f..7c214f8ae 100644 --- a/docSite/content/zh-cn/docs/workflow/examples/dalle3.md +++ b/docSite/content/zh-cn/docs/use-cases/app-cases/dalle3.md @@ -4,7 +4,7 @@ description: '使用 HTTP 模块绘制图片' icon: 'image' draft: false toc: true -weight: 408 +weight: 614 --- | | | diff --git a/docSite/content/zh-cn/docs/use-cases/app-cases/english_essay_correction_bot.md b/docSite/content/zh-cn/docs/use-cases/app-cases/english_essay_correction_bot.md new file mode 100644 index 000000000..1f11c8f5b --- /dev/null +++ b/docSite/content/zh-cn/docs/use-cases/app-cases/english_essay_correction_bot.md @@ -0,0 +1,97 @@ +--- +title: "英语作文纠错机器人" +description: "使用 FastGPT 创建一个用于英语作文纠错的机器人,帮助用户检测并纠正语言错误" +icon: "spellcheck" +draft: false +toc: true +weight: 608 +--- + +FastGPT 提供了一种基于 LLM Model 搭建应用的简便方式。 + +本文通过搭建一个英语作文纠错机器人,介绍一下如何使用 **工作流** + +## 搭建过程 + +### 1. 创建工作流 + +![](/imgs/spellcheck1.png) + +可以从 *多轮翻译机器人* 开始创建。 + +> 多轮翻译机器人是 @米开朗基杨 同学创建的,同样也是一个值得学习的工作流。 + +### 2. 获取输入,使用大模型进行分析 + +我们期望让大模型处理文字,返回一个结构化的数据,由我们自己处理。 + +![](/imgs/spellcheck2.png) + +**提示词** 是最重要的一个参数,这里提供的提示词仅供参考: + +~~~Markdown +## 角色 +资深英语写作专家 + +## 任务 +对输入的原文进行分析。 找出其中的各种错误, 包括但不限于单词拼写错误、 语法错误等。 +注意: 忽略标点符号前后空格的问题。 +注意: 对于存在错误的句子, 提出修改建议是指指出这个句子中的具体部分, 然后提出将这一个部分修改替换为什么。 + +## 输出格式 +不要使用 Markdown 语法, 输入 JSON 格式的内容。 +输出的"reason"的内容使用中文。 +直接输出一个列表, 其成员为一个相同类型的对象, 定义如下 +您正在找回 FastGPT 账号 +``` +{ +“raw”: string; // 表示原文 +“reason”: string; // 表示原因 +“suggestion”: string; // 修改建议 +} +``` +~~~ + +可以在模型选择的窗口中设置禁用 AI 回复。 + +这样就看不到输出的 json 格式的内容了。 + +![](/imgs/spellcheck3.png) + +### 3. 数据处理 + +上面的大模型输出了一个 json,这里要进行数据处理。数据处理可以使用代码执行组件。 + +![](/imgs/spellcheck4.png) + +```JavaScript +function main({data}){ + const array = JSON.parse(data) + return { + content: array.map( + (item, index) => { + return ` +## 分析${index+1} +- **错误**: ${item.raw} +- **分析**: ${item.reason} +- **修改建议**: ${item.suggestion} +` + } + ).join('') + } +} +``` + +上面的代码将 JSON 解析为 Object, 然后拼接成一串 Markdown 语法的字符串。 + +FastGPT 的指定回复组件可以将 Markdown 解析为 Html 返回。 + +## 发布 + +可以使用发布渠道进行发布。 + +![](/imgs/spellcheck5.png) + +可以选择通过 URL 访问,或者是直接嵌入你的网页中。 + +> [点我使用](https://share.fastgpt.in/chat/share?shareId=b4r173wkcjae7wpnexcvmyc3) \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/workflow/examples/feishu_webhook.md b/docSite/content/zh-cn/docs/use-cases/app-cases/feishu_webhook.md similarity index 99% rename from docSite/content/zh-cn/docs/workflow/examples/feishu_webhook.md rename to docSite/content/zh-cn/docs/use-cases/app-cases/feishu_webhook.md index 43b055ba6..67f588c02 100644 --- a/docSite/content/zh-cn/docs/workflow/examples/feishu_webhook.md +++ b/docSite/content/zh-cn/docs/use-cases/app-cases/feishu_webhook.md @@ -4,7 +4,7 @@ description: '利用工具调用模块,发送一个飞书webhook通知' icon: 'image' draft: false toc: true -weight: 409 +weight: 618 --- 该文章展示如何发送一个简单的飞书webhook通知,以此类推,发送其他类型的通知也可以这么操作。 diff --git a/docSite/content/zh-cn/docs/workflow/examples/fixingEvidence.md b/docSite/content/zh-cn/docs/use-cases/app-cases/fixingEvidence.md similarity index 99% rename from docSite/content/zh-cn/docs/workflow/examples/fixingEvidence.md rename to docSite/content/zh-cn/docs/use-cases/app-cases/fixingEvidence.md index ddb74d24e..6a8f08542 100644 --- a/docSite/content/zh-cn/docs/workflow/examples/fixingEvidence.md +++ b/docSite/content/zh-cn/docs/use-cases/app-cases/fixingEvidence.md @@ -4,7 +4,7 @@ description: '利用指定回复,创建固定的开头和结尾' icon: 'healing' draft: false toc: true -weight: 405 +weight: 610 --- ![](/imgs/demo-fix-evidence1.jpg) diff --git a/docSite/content/zh-cn/docs/workflow/examples/google_search.md b/docSite/content/zh-cn/docs/use-cases/app-cases/google_search.md similarity index 99% rename from docSite/content/zh-cn/docs/workflow/examples/google_search.md rename to docSite/content/zh-cn/docs/use-cases/app-cases/google_search.md index 9f01f4fd4..66f0f1152 100644 --- a/docSite/content/zh-cn/docs/workflow/examples/google_search.md +++ b/docSite/content/zh-cn/docs/use-cases/app-cases/google_search.md @@ -4,7 +4,7 @@ description: '将 FastGPT 接入谷歌搜索' icon: 'search' draft: false toc: true -weight: 406 +weight: 616 --- | | | diff --git a/docSite/content/zh-cn/docs/workflow/examples/lab_appointment.md b/docSite/content/zh-cn/docs/use-cases/app-cases/lab_appointment.md similarity index 99% rename from docSite/content/zh-cn/docs/workflow/examples/lab_appointment.md rename to docSite/content/zh-cn/docs/use-cases/app-cases/lab_appointment.md index b4b5bd5e4..e2f974e56 100644 --- a/docSite/content/zh-cn/docs/workflow/examples/lab_appointment.md +++ b/docSite/content/zh-cn/docs/use-cases/app-cases/lab_appointment.md @@ -4,7 +4,7 @@ description: '展示高级编排操作数据库的能力' icon: 'database' draft: false toc: true -weight: 407 +weight: 612 --- | | | diff --git a/docSite/content/zh-cn/docs/use-cases/app-cases/multi_turn_translation_bot.md b/docSite/content/zh-cn/docs/use-cases/app-cases/multi_turn_translation_bot.md new file mode 100644 index 000000000..a3f51303b --- /dev/null +++ b/docSite/content/zh-cn/docs/use-cases/app-cases/multi_turn_translation_bot.md @@ -0,0 +1,315 @@ +--- +title: "多轮翻译机器人" +description: "如何使用 FastGPT 构建一个多轮翻译机器人,实现连续的对话翻译功能" +icon: "translate" +draft: false +toc: true +weight: 606 +--- + +吴恩达老师提出了一种反思翻译的大语言模型(LLM)翻译工作流程——[GitHub - andrewyng/translation-agent](https://github.com/andrewyng/translation-agent),具体工作流程如下: + +1. 提示一个 LLM 将文本从 `source_language` 翻译到 `target_language`; +2. 让 LLM 反思翻译结果并提出建设性的改进建议; +3. 使用这些建议来改进翻译。 + +这个翻译流程应该是目前比较新的一种翻译方式,利用 LLM 对自己的翻译结果进行改进来获得较好的翻译效果 + +项目中展示了可以利用对长文本进行分片,然后分别进行反思翻译处理,以突破 LLM 对 tokens 数量的限制,真正实现长文本一键高效率高质量翻译。 + +项目还通过给大模型限定国家地区,已实现更精确的翻译,如美式英语、英式英语之分;同时提出一些可能能带来更好效果的优化,如对于一些 LLM 未曾训练到的术语(或有多种翻译方式的术语)建立术语表,进一步提升翻译的精确度等等 + +而这一切都能通过 Fastgpt 工作流轻松实现,本文将手把手教你如何复刻吴恩达老师的 translation-agent + +# 单文本块反思翻译 + +先从简单的开始,即不超出 LLM tokens 数量限制的单文本块翻译 + +## 初始翻译 + +第一步先让 LLM 对源文本块进行初始翻译(翻译的提示词在源项目中都有) + +![](/imgs/translate1.png) + +通过`文本拼接`模块引用 源语言、目标语言、源文本这三个参数,生成提示词,传给 LLM,让它给出第一版的翻译 + +## 反思 + +然后让 LLM 对第一步生成的初始翻译给出修改建议,称之为 反思 + +![](/imgs/translate2.png) + +这时的提示词接收 5 个参数,源文本、初始翻译、源语言、目标语言 以及限定词地区国家,这样 LLM 会对前面生成的翻译提出相当多的修改建议,为后续的提升翻译作准备 + +## 提升翻译 + +![](/imgs/translate3.png) + +在前文生成了初始翻译以及相应的反思后,将这二者输入给第三次 LLM 翻译,这样我们就能获得一个比较高质量的翻译结果 + +完整的工作流如下 + +![](/imgs/translate4.png) + +## 运行效果 + +由于考虑之后对这个反思翻译的复用,所以创建了一个插件,那么在下面我直接调用这个插件就能使用反思翻译,效果如下 + +随机挑选了一段哈利波特的文段 + +![](/imgs/translate5.png) + +![](/imgs/translate6.png) + +可以看到反思翻译后的效果还是好上不少的,其中反思的输出如下 + +![](/imgs/translate7.png) + +# 长文反思翻译 + +在掌握了对短文本块的反思翻译后,我们能轻松的通过分片和循环,实现对长文本也即多文本块的反思翻译 + +整体的逻辑是,首先对传入文本的 tokens数量做判断,如果不超过设置的 tokens 限制,那么直接调用单文本块反思翻译,如果超过设置的 tokens限制,那么切割为合理的大小,再分别进行对应的反思翻译处理 + +## 计算 tokens + +![](/imgs/translate8.png) + +首先,我使用了 Laf函数 模块来实现对输入文本的 tokens 的计算 + +laf函数的使用相当简单,即开即用,只需要在 laf 创建个应用,然后安装 tiktoken 依赖,导入如下代码即可 + +```TypeScript +const { Tiktoken } = require("tiktoken/lite"); +const cl100k_base = require("tiktoken/encoders/cl100k_base.json"); + +interface IRequestBody { + str: string +} + +interface RequestProps extends IRequestBody { + systemParams: { + appId: string, + variables: string, + histories: string, + cTime: string, + chatId: string, + responseChatItemId: string + } +} + +interface IResponse { + message: string; + tokens: number; +} + +export default async function (ctx: FunctionContext): Promise { + const { str = "" }: RequestProps = ctx.body + + const encoding = new Tiktoken( + cl100k_base.bpe_ranks, + cl100k_base.special_tokens, + cl100k_base.pat_str + ); + const tokens = encoding.encode(str); + encoding.free(); + + return { + message: 'ok', + tokens: tokens.length + }; +} +``` + +再回到 Fastgpt,点击“同步参数”,再连线将源文本传入,即可计算 tokens 数量 + +## 计算单文本块大小 + +![](/imgs/translate9.png) + +由于不涉及第三方包,只是一些数据处理,所以直接使用 代码运行 模块处理即可 + +```TypeScript +function main({tokenCount, tokenLimit}){ + const numChunks = Math.ceil(tokenCount / tokenLimit); + let chunkSize = Math.floor(tokenCount / numChunks); + + const remainingTokens = tokenCount % tokenLimit; + if (remainingTokens > 0) { + chunkSize += Math.floor(remainingTokens / numChunks); + } + + return {chunkSize}; +} +``` + +通过上面的代码,我们就能算出不超过 token限制的合理单文本块大小是多少了 + +## 获得切分后源文本块 + +![](/imgs/translate10.png) + +通过单文本块大小和源文本,我们再编写一个函数调用 langchain 的 textsplitters 包来实现文本分片,具体代码如下 + +```TypeScript +import cloud from '@lafjs/cloud' +import { TokenTextSplitter } from "@langchain/textsplitters"; + +interface IRequestBody { + text: string + chunkSize: number +} + +interface RequestProps extends IRequestBody { + systemParams: { + appId: string, + variables: string, + histories: string, + cTime: string, + chatId: string, + responseChatItemId: string + } +} + +interface IResponse { + output: string[]; +} + +export default async function (ctx: FunctionContext): Promise{ + const { text = '', chunkSize=1000 }: RequestProps = ctx.body; + + const splitter = new TokenTextSplitter({ + encodingName:"gpt2", + chunkSize: Number(chunkSize), + chunkOverlap: 0, + }); + + const output = await splitter.splitText(text); + + return { + output + } +} +``` + +这样我们就获得了切分好的文本,接下去的操作就类似单文本块反思翻译 + +## 多文本块翻译 + +这里应该还是不能直接调用前面的单文本块反思翻译,因为提示词中会涉及一些上下文的处理(或者可以修改下前面写好的插件,多传点参数进去) + +详细的和前面类似,就是提示词进行一些替换,以及需要做一些很简单的数据处理,整体效果如下 + +### 多文本块初始翻译 + +![](/imgs/translate11.png) + +### 多文本块反思 + +![](/imgs/translate12.png) + +### 多文本块提升翻译 + +![](/imgs/translate13.png) + +## 循环执行 + +长文反思翻译比较关键的一个部分,就是对多个文本块进行循环反思翻译 + +Fastgpt 提供了工作流线路可以返回去执行的功能,所以我们可以写一个很简单的判断函数,来判断结束或是接着执行 + +![](/imgs/translate14.png) + +也就是通过判断当前处理的这个文本块,是否是最后一个文本块,从而判断是否需要继续执行,就这样,我们实现了长文反思翻译的效果 + +完整工作流如下 + +![](/imgs/translate15.png) + +## 运行效果 + +首先输入全局设置 + +![](/imgs/translate16.png) + +然后输入需要翻译的文本,这里我选择了一章哈利波特的英文原文来做翻译,其文本长度通过 openai 对 tokens 数量的判断如下 + +![](/imgs/translate17.png) + +实际运行效果如下 + +![](/imgs/translate18.png) + +可以看到还是能满足阅读需求的 + +# 进一步调优 + +## 提示词调优 + +在源项目中,给 AI 的系统提示词还是比较的简略的,我们可以通过比较完善的提示词,来督促 LLM 返回更合适的翻译,进一步提升翻译的质量 + +比如初始翻译中, + +```TypeScript +# Role: 资深翻译专家 + +## Background: +你是一位经验丰富的翻译专家,精通{{source_lang}}和{{target_lang}}互译,尤其擅长将{{source_lang}}文章译成流畅易懂的{{target_lang}}。你曾多次带领团队完成大型翻译项目,译文广受好评。 + +## Attention: +- 翻译过程中要始终坚持"信、达、雅"的原则,但"达"尤为重要 +- 译文要符合{{target_lang}}的表达习惯,通俗易懂,连贯流畅 +- 避免使用过于文绉绉的表达和晦涩难懂的典故引用 + +## Constraints: +- 必须严格遵循四轮翻译流程:直译、意译、校审、定稿 +- 译文要忠实原文,准确无误,不能遗漏或曲解原意 + +## Goals: +- 通过四轮翻译流程,将{{source_lang}}原文译成高质量的{{target_lang}}译文 +- 译文要准确传达原文意思,语言表达力求浅显易懂,朗朗上口 +- 适度使用一些熟语俗语、流行网络用语等,增强译文的亲和力 +- 在直译的基础上,提供至少2个不同风格的意译版本供选择 + +## Skills: +- 精通{{source_lang}} {{target_lang}}两种语言,具有扎实的语言功底和丰富的翻译经验 +- 擅长将{{source_lang}}表达习惯转换为地道自然的{{target_lang}} +- 对当代{{target_lang}}语言的发展变化有敏锐洞察,善于把握语言流行趋势 + +## Workflow: +1. 第一轮直译:逐字逐句忠实原文,不遗漏任何信息 +2. 第二轮意译:在直译的基础上用通俗流畅的{{target_lang}}意译原文,至少提供2个不同风格的版本 +3. 第三轮校审:仔细审视译文,消除偏差和欠缺,使译文更加地道易懂 +4. 第四轮定稿:择优选取,反复修改润色,最终定稿出一个简洁畅达、符合大众阅读习惯的译文 + +## OutputFormat: +- 只需要输出第四轮定稿的回答 + +## Suggestions: +- 直译时力求忠实原文,但不要过于拘泥逐字逐句 +- 意译时在准确表达原意的基础上,用最朴实无华的{{target_lang}}来表达 +- 校审环节重点关注译文是否符合{{target_lang}}表达习惯,是否通俗易懂 +- 定稿时适度采用一些熟语谚语、网络流行语等,使译文更接地气- 善于利用{{target_lang}}的灵活性,用不同的表述方式展现同一内容,提高译文的可读性 +``` + +从而返回更准确更高质量的初始翻译,后续的反思和提升翻译也可以修改更准确的提示词,如下 + +![](/imgs/translate19.png) + +然后再让我们来看看运行效果 + +![](/imgs/translate20.png) + +给了和之前相同的一段文本进行测试,测试效果还是比较显著的,就比如红框部分,之前的翻译如下 + +![](/imgs/translate21.png) + +从“让你的猫头鹰给我写信”这样有失偏颇的翻译,变成“给我写信,你的猫头鹰会知道怎么找到我”这样较为准确的翻译 + +## 其他调优 + +比如限定词调优,源项目中已经做了示范,就是加上国家地区这个限定词,实测确实会有不少提升 + +出于 LLM 的卓越能力,我们能够通过设置不同的prompt来获取不同的翻译结果,也就是可以很轻松地通过设置特殊的限定词,来实现特定的,更精确的翻译 + +而对于一些超出 LLM 理解的术语等,也可以利用 Fastgpt 的知识库功能进行相应扩展,进一步完善翻译机器人的功能 \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/use-cases/app-cases/submit_application_template.md b/docSite/content/zh-cn/docs/use-cases/app-cases/submit_application_template.md new file mode 100644 index 000000000..1df015e97 --- /dev/null +++ b/docSite/content/zh-cn/docs/use-cases/app-cases/submit_application_template.md @@ -0,0 +1,86 @@ +--- +title: "如何提交应用模板" +description: "指南:如何向 FastGPT 提交应用模板" +icon: "template_submission" +draft: false +toc: true +weight: 602 +--- + + +## 什么模板可以合并 + +目前合并进仓库的应用模板,会在「模板市场」中全部展示给用户。 + +为了控制模板的质量以及避免数量过多带来的繁琐,并不是所有的模板都会被合并到开源仓库中,你可以提前 PR 与我们沟通模板的内容。 + +预估最后总体的数量不会很多,控制在 50 个左右,一半来自 FastGPT Team,一半来自社区用户。 + +## 如何写一个应用模板 + +1. ### 跑通 FastGPT dev 环境 + +需要在 dev 环境下执行下面的操作。 + +> 可参照 [FastGPT|快速开始本地开发](https://doc.fastgpt.in/docs/development/intro/) + +1. ### 在 FastGPT 工作台中,创建一个应用 + +创建空白工作流即可。 + +![](/imgs/template_submission1.png) + +1. ### 创建应用模板 + +应用模板配置以及相关资源,都会在 **projects/app/public/appMarketTemplates** 目录下。 + +![](/imgs/template_submission2.png) + +1. 在 **projects/app/public/appMarketTemplates** 目录下,创建一个文件夹,名称为模板对应的 id。 +2. 在刚刚创建的文件夹中,再创建一个 **template.json** 文件,复制粘贴并填写如下配置: + +```JSON +{ + "name": "模板名", + "intro": "模板描述,会展示在模板市场的展示页", + "author": "填写你的名字", + "avatar": "模板头像,可以将图片文件放在同一个文件夹中,然后填写相应路径", + + "tags": ["模板标签"], // writing(文本创作),image-generation(图片生成),web-search(联网搜索), + // roleplay(角色扮演), office-services(办公服务) 暂时分为 5 类,从中选择相应的标签 + + "type": "模板类别", // simple(简易应用), advanced(工作流), plugin(插件) + + "workflow": { // 这个对象先不管,待会直接粘贴导出的工作流即可 + "nodes": [], + "edges": [], + "chatConfig": {} + } +} +``` + +1. ### 完成应用编排并测试 + +完成应用编排后,可以点击右上角的发布。 + +1. ### 复制配置到 template.json + +鼠标放置在左上角应用的头像和名称上,会出现对于下拉框操作,可以导出工作流配置。 + +导出的配置,会自动复制到剪切板,可以直接到 template.json 文件中粘贴使用,替换步骤 2 中,**workflow** 的值。 + +![](/imgs/template_submission3.png) + +1. ### 验证模板是否加载成功 + +刷新页面,打开模板市场,看其是否成功加载,并点击「使用」测试其功能。 + +![](/imgs/template_submission4.png) + +1. ### 提交 PR + +如果你觉得你的模板需要提交到开源仓库,可以通过 PR 形式向我们提交。 + +- 写清楚模板的介绍和功能 +- 配上模板运行的效果图 +- 模板参数填写说明,需要在 PR 中写清楚。例如,有些模板需要去某个提供商申请 key,需要附上对应的地址和教程,后续我们会加入到文档中。 \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/workflow/examples/translate-subtitle-using-gpt.md b/docSite/content/zh-cn/docs/use-cases/app-cases/translate-subtitle-using-gpt.md similarity index 99% rename from docSite/content/zh-cn/docs/workflow/examples/translate-subtitle-using-gpt.md rename to docSite/content/zh-cn/docs/use-cases/app-cases/translate-subtitle-using-gpt.md index 5fc6f8305..fa12d31ce 100644 --- a/docSite/content/zh-cn/docs/workflow/examples/translate-subtitle-using-gpt.md +++ b/docSite/content/zh-cn/docs/use-cases/app-cases/translate-subtitle-using-gpt.md @@ -4,7 +4,7 @@ description: '利用 AI 自我反思提升翻译质量,同时循环迭代执 icon: 'translate' draft: false toc: true -weight: 401 +weight: 604 --- 直接使用 LLM 来翻译长字幕会遇到很多难点,这些难点也正是直接使用 AI 无法有效处理的问题: diff --git a/docSite/content/zh-cn/docs/use-cases/external-integration/_index.md b/docSite/content/zh-cn/docs/use-cases/external-integration/_index.md new file mode 100644 index 000000000..f9cdc5a96 --- /dev/null +++ b/docSite/content/zh-cn/docs/use-cases/external-integration/_index.md @@ -0,0 +1,9 @@ +--- +weight: 500 +title: "外部调用 FastGPT" +description: "外部应用通过多种方式调用 FastGPT 功能的教程" +icon: "cloud" +draft: false +images: [] +--- + diff --git a/docSite/content/zh-cn/docs/course/feishu.md b/docSite/content/zh-cn/docs/use-cases/external-integration/feishu.md similarity index 99% rename from docSite/content/zh-cn/docs/course/feishu.md rename to docSite/content/zh-cn/docs/use-cases/external-integration/feishu.md index 4c83499ca..2ad152467 100644 --- a/docSite/content/zh-cn/docs/course/feishu.md +++ b/docSite/content/zh-cn/docs/use-cases/external-integration/feishu.md @@ -4,7 +4,7 @@ description: "FastGPT 接入飞书机器人教程" icon: "chat" draft: false toc: true -weight: 111 +weight: 504 --- 从 4.8.10 版本起,FastGPT 商业版支持直接接入飞书机器人,无需额外的 API。 diff --git a/docSite/content/zh-cn/docs/use-cases/external-integration/iframe_integration.md b/docSite/content/zh-cn/docs/use-cases/external-integration/iframe_integration.md new file mode 100644 index 000000000..e88d55e47 --- /dev/null +++ b/docSite/content/zh-cn/docs/use-cases/external-integration/iframe_integration.md @@ -0,0 +1,8 @@ +--- +title: "iframe 接入" +description: "通过 iframe 嵌入 FastGPT 内容到其他网页或应用" +icon: "iframe" +draft: false +toc: true +weight: 512 +--- \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/course/official_account.md b/docSite/content/zh-cn/docs/use-cases/external-integration/official_account.md similarity index 99% rename from docSite/content/zh-cn/docs/course/official_account.md rename to docSite/content/zh-cn/docs/use-cases/external-integration/official_account.md index 04c5fa89b..b8cef67bb 100644 --- a/docSite/content/zh-cn/docs/course/official_account.md +++ b/docSite/content/zh-cn/docs/use-cases/external-integration/official_account.md @@ -4,7 +4,7 @@ description: 'FastGPT 接入微信公众号教程' icon: 'description' draft: false toc: true -weight: 113 +weight: 506 --- 从 4.8.10 版本起,FastGPT 商业版支持直接接入微信公众号,无需额外的 API。 diff --git a/docSite/content/zh-cn/docs/use-cases/onwechat.md b/docSite/content/zh-cn/docs/use-cases/external-integration/onwechat.md similarity index 99% rename from docSite/content/zh-cn/docs/use-cases/onwechat.md rename to docSite/content/zh-cn/docs/use-cases/external-integration/onwechat.md index bc8959bdd..958aea550 100644 --- a/docSite/content/zh-cn/docs/use-cases/onwechat.md +++ b/docSite/content/zh-cn/docs/use-cases/external-integration/onwechat.md @@ -4,7 +4,7 @@ description: "FastGPT 对接 chatgpt-on-wechat" icon: "chat" draft: false toc: true -weight: 504 +weight: 509 --- # 1 分钟对接 chatgpt-on-wechat diff --git a/docSite/content/zh-cn/docs/course/openapi.md b/docSite/content/zh-cn/docs/use-cases/external-integration/openapi.md similarity index 98% rename from docSite/content/zh-cn/docs/course/openapi.md rename to docSite/content/zh-cn/docs/use-cases/external-integration/openapi.md index 898e20138..0c62d3fd2 100644 --- a/docSite/content/zh-cn/docs/course/openapi.md +++ b/docSite/content/zh-cn/docs/use-cases/external-integration/openapi.md @@ -4,7 +4,7 @@ description: "通过 API 访问 FastGPT 应用" icon: "model_training" draft: false toc: true -weight: 112 +weight: 502 --- 在 FastGPT 中,你可以为每一个应用创建多个 API 密钥,用于访问应用的 API 接口。每个密钥仅能访问一个应用。完整的接口可以[查看应用对话接口](/docs/development/openapi/chat)。 diff --git a/docSite/content/zh-cn/docs/use-cases/wechat.md b/docSite/content/zh-cn/docs/use-cases/external-integration/wechat.md similarity index 99% rename from docSite/content/zh-cn/docs/use-cases/wechat.md rename to docSite/content/zh-cn/docs/use-cases/external-integration/wechat.md index 58d74ea4a..1746507f1 100644 --- a/docSite/content/zh-cn/docs/use-cases/wechat.md +++ b/docSite/content/zh-cn/docs/use-cases/external-integration/wechat.md @@ -4,7 +4,7 @@ description: "FastGPT 接入微信和企业微信 " icon: "chat" draft: false toc: true -weight: 506 +weight: 510 --- # FastGPT 三分钟接入微信/企业微信 diff --git a/docSite/content/zh-cn/docs/workflow/_index.md b/docSite/content/zh-cn/docs/workflow/_index.md deleted file mode 100644 index 706d7e466..000000000 --- a/docSite/content/zh-cn/docs/workflow/_index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -weight: 300 -title: '高级编排' -description: 'FastGPT 高级编排文档' -icon: 'family_history' -draft: false -images: [] ---- - diff --git a/docSite/content/zh-cn/docs/workflow/examples/_index.md b/docSite/content/zh-cn/docs/workflow/examples/_index.md deleted file mode 100644 index 70f4b3131..000000000 --- a/docSite/content/zh-cn/docs/workflow/examples/_index.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -weight: 400 -title: "编排示例" -description: "介绍 FastGPT 的高级编排实践案例" -icon: "list" -draft: false -images: [] ---- \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/workflow/modules/_index.md b/docSite/content/zh-cn/docs/workflow/modules/_index.md deleted file mode 100644 index a5d5551e0..000000000 --- a/docSite/content/zh-cn/docs/workflow/modules/_index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -weight: 350 -title: "模块介绍" -description: "介绍 FastGPT 的常用模块" -icon: "apps" -draft: false -images: [] ---- - - \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/workflow/modules/input.md b/docSite/content/zh-cn/docs/workflow/modules/input.md deleted file mode 100644 index 4a439838c..000000000 --- a/docSite/content/zh-cn/docs/workflow/modules/input.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "对话入口" -description: "FastGPT 对话入口模块介绍" -icon: "input" -draft: false -toc: true -weight: 356 ---- - -## 特点 - -- 流程入口 -- 无输入 -- 自动执行 - -![](/imgs/chatinput.png) \ No newline at end of file