diff --git a/.github/ISSUE_TEMPLATE/bugs.md b/.github/ISSUE_TEMPLATE/bugs.md index 5988823b5d1..e8d208ede10 100644 --- a/.github/ISSUE_TEMPLATE/bugs.md +++ b/.github/ISSUE_TEMPLATE/bugs.md @@ -11,7 +11,7 @@ assignees: '' [//]: # '方框内填 x 表示打钩' - [ ] 我已确认目前没有类似 issue -- [ ] 我已完整查看过项目 README,以及[项目文档](https://doc.fastgpt.in/docs/intro/) +- [ ] 我已完整查看过项目 README,以及[项目文档](https://doc.tryfastgpt.ai/docs/intro/) - [ ] 我使用了自己的 key,并确认我的 key 是可正常使用的 - [ ] 我理解并愿意跟进此 issue,协助测试和提供反馈 - [x] 我理解并认可上述内容,并理解项目维护者精力有限,**不遵循规则的 issue 可能会被无视或直接关闭** diff --git a/README.md b/README.md index fb05fe246e4..02ece15d040 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-fastgpt logo +fastgpt logo # FastGPT @@ -15,13 +15,13 @@ FastGPT 是一个基于 LLM 大语言模型的知识库问答系统,提供开

- + cloud - + document - + development @@ -36,7 +36,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b ## 🛸 在线使用 -- 🌍 海外版:[fastgpt.in](https://fastgpt.in/) +- 🌍 国际版:[tryfastgpt.ai](https://tryfastgpt.ai/) | | | | ---------------------------------- | ---------------------------------- | @@ -50,22 +50,22 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b ## 💡 RoadMap `1` 应用编排能力 - - [x] 提供简易模式,无需操作编排 - - [x] 工作流编排 + - [x] 对话工作流、插件工作流 - [x] 工具调用 - - [x] 插件 - 工作流封装能力 - [x] Code sandbox - - [ ] 循环调用 + - [x] 循环调用 + - [x] 用户选择 + - [ ] 表单输入 `2` 知识库能力 - [x] 多库复用,混用 - [x] chunk 记录修改和删除 - - [x] 源文件存储 - [x] 支持手动输入,直接分段,QA 拆分导入 - [x] 支持 txt,md,html,pdf,docx,pptx,csv,xlsx (有需要更多可 PR file loader) - [x] 支持 url 读取、CSV 批量导入 - [x] 混合检索 & 重排 - - [ ] 标签过滤 + - [ ] 自定义文件读取服务 + - [ ] 自定义分块服务 `3` 应用调试能力 - [x] 知识库单点搜索测试 @@ -88,7 +88,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b `6` 其他 - [x] 支持语音输入和输出 (可配置语音输入语音回答) - [x] 模糊输入提示 - - [ ] 模板市场 + - [x] 模板市场 # @@ -102,15 +102,15 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b > 使用 [Sealos](https://sealos.io) 服务,无需采购服务器、无需域名,支持高并发 & 动态伸缩,并且数据库应用采用 kubeblocks 的数据库,在 IO 性能方面,远超于简单的 Docker 容器部署。 - [点击查看 Sealos 一键部署 FastGPT 教程](https://doc.fastgpt.in/docs/development/sealos/) + [点击查看 Sealos 一键部署 FastGPT 教程](https://doc.tryfastgpt.ai/docs/development/sealos/) -* [快速开始本地开发](https://doc.fastgpt.in/docs/development/intro/) -* [部署 FastGPT](https://doc.fastgpt.in/docs/development/sealos) -* [系统配置文件说明](https://doc.fastgpt.in/docs/development/configuration/) -* [多模型配置](https://doc.fastgpt.in/docs/development/one-api/) -* [版本更新/升级介绍](https://doc.fastgpt.in/docs/development/upgrading) -* [OpenAPI API 文档](https://doc.fastgpt.in/docs/development/openapi/) -* [知识库结构详解](https://doc.fastgpt.in/docs/course/dataset_engine/) +* [快速开始本地开发](https://doc.tryfastgpt.ai/docs/development/intro/) +* [部署 FastGPT](https://doc.tryfastgpt.ai/docs/development/sealos) +* [系统配置文件说明](https://doc.tryfastgpt.ai/docs/development/configuration/) +* [多模型配置](https://doc.tryfastgpt.ai/docs/development/one-api/) +* [版本更新/升级介绍](https://doc.tryfastgpt.ai/docs/development/upgrading) +* [OpenAPI API 文档](https://doc.tryfastgpt.ai/docs/development/openapi/) +* [知识库结构详解](https://doc.tryfastgpt.ai/docs/course/dataset_engine/) # @@ -149,7 +149,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b ## 🌿 第三方生态 -- [OnWeChat 个人微信/企微机器人](https://doc.fastgpt.in/docs/use-cases/onwechat/) +- [OnWeChat 个人微信/企微机器人](https://doc.tryfastgpt.ai/docs/use-cases/onwechat/) # @@ -212,4 +212,4 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b 1. 允许作为后台服务直接商用,但不允许提供 SaaS 服务。 2. 未经商业授权,任何形式的商用服务均需保留相关版权信息。 3. 完整请查看 [FastGPT Open Source License](./LICENSE) -4. 联系方式:Dennis@sealos.io,[点击查看商业版定价策略](https://doc.fastgpt.in/docs/commercial) +4. 联系方式:Dennis@sealos.io,[点击查看商业版定价策略](https://doc.tryfastgpt.ai/docs/commercial) diff --git a/README_en.md b/README_en.md index 7572f17ad64..a34e3123950 100644 --- a/README_en.md +++ b/README_en.md @@ -1,6 +1,6 @@

-fastgpt logo +fastgpt logo # FastGPT @@ -15,13 +15,13 @@ FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive

- + cloud - + document - + development @@ -39,7 +39,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b ## 🛸 Use Cloud Services -Cloud: [fastgpt.in](https://fastgpt.in/) +Cloud: [tryfastgpt.ai](https://tryfastgpt.ai/) | | | | ---------------------------------- | ---------------------------------- | @@ -113,16 +113,16 @@ Project tech stack: NextJs + TS + ChakraUI + Mongo + Postgres (Vector plugin) Give it a 2-4 minute wait after deployment as it sets up the database. Initially, it might be a tad slow since we're using the basic settings. -- [Getting Started with Local Development](https://doc.fastgpt.in/docs/development) -- [Deploying FastGPT](https://doc.fastgpt.in/docs/installation) -- [Guide on System Configs](https://doc.fastgpt.in/docs/installation/reference) -- [Configuring Multiple Models](https://doc.fastgpt.in/docs/installation/reference/models) -- [Version Updates & Upgrades](https://doc.fastgpt.in/docs/installation/upgrading) +- [Getting Started with Local Development](https://doc.tryfastgpt.ai/docs/development) +- [Deploying FastGPT](https://doc.tryfastgpt.ai/docs/installation) +- [Guide on System Configs](https://doc.tryfastgpt.ai/docs/installation/reference) +- [Configuring Multiple Models](https://doc.tryfastgpt.ai/docs/installation/reference/models) +- [Version Updates & Upgrades](https://doc.tryfastgpt.ai/docs/installation/upgrading) ## 🏘️ Community & support -+ 🌐 Visit the [FastGPT website](https://fastgpt.in/) for full documentation and useful links. ++ 🌐 Visit the [FastGPT website](https://tryfastgpt.ai/) for full documentation and useful links. + 💬 Join our [Discord server](https://discord.gg/mp68xkZn2Q) is to chat with FastGPT developers and other FastGPT users. This is a good place to learn about FastGPT, ask questions, and share your experiences. + 🐞 Create [GitHub Issues](https://github.com/labring/FastGPT/issues/new/choose) for bug reports and feature requests. diff --git a/README_ja.md b/README_ja.md index a9f4b619251..8ead634dc77 100644 --- a/README_ja.md +++ b/README_ja.md @@ -1,6 +1,6 @@

-fastgpt logo +fastgpt logo # FastGPT @@ -15,13 +15,13 @@ FastGPT は、LLM 上 に 構築 された 知識 ベースの Q&A システム

- + cloud - + document - + development @@ -36,7 +36,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b ## 🛸 クラウドサービスの 利用 -[fastgpt.in](https://fastgpt.in/) +[tryfastgpt.ai](https://tryfastgpt.ai/) | | | | ---------------------------------- | ---------------------------------- | @@ -98,11 +98,11 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b デプロイ 後、データベースをセットアップするので、2~4分待 ってください。基本設定 を 使 っているので、最初 は 少 し 遅 いかもしれません。 -- [ローカル 開発入門](https://doc.fastgpt.in/docs/development) -- [FastGPT のデプロイ](https://doc.fastgpt.in/docs/installation) -- [システム 設定 ガイド](https://doc.fastgpt.in/docs/installation/reference) -- [複数 モデルの 設定](https://doc.fastgpt.in/docs/installation/reference/models) -- [バージョン 更新 とアップグレード](https://doc.fastgpt.in/docs/installation/upgrading) +- [ローカル 開発入門](https://doc.tryfastgpt.ai/docs/development) +- [FastGPT のデプロイ](https://doc.tryfastgpt.ai/docs/installation) +- [システム 設定 ガイド](https://doc.tryfastgpt.ai/docs/installation/reference) +- [複数 モデルの 設定](https://doc.tryfastgpt.ai/docs/installation/reference/models) +- [バージョン 更新 とアップグレード](https://doc.tryfastgpt.ai/docs/installation/upgrading) diff --git a/docSite/content/zh-cn/docs/agreement/open-source.md b/docSite/content/zh-cn/docs/agreement/open-source.md index fcdb9d6f969..8bd37235352 100644 --- a/docSite/content/zh-cn/docs/agreement/open-source.md +++ b/docSite/content/zh-cn/docs/agreement/open-source.md @@ -11,7 +11,7 @@ FastGPT 项目在 Apache License 2.0 许可下开源,同时包含以下附加 + FastGPT 允许被用于商业化,例如作为其他应用的“后端即服务”使用,或者作为应用开发平台提供给企业。然而,当满足以下条件时,必须联系作者获得商业许可: - + 多租户 SaaS 服务:除非获得 FastGPT 的明确书面授权,否则不得使用 fastgpt.in 的源码来运营与 fastgpt.in 服务类似的多租户 SaaS 服务。 + + 多租户 SaaS 服务:除非获得 FastGPT 的明确书面授权,否则不得使用 tryfastgpt.ai 的源码来运营与 tryfastgpt.ai 服务类似的多租户 SaaS 服务。 + LOGO 及版权信息:在使用 FastGPT 的过程中,不得移除或修改 FastGPT 控制台内的 LOGO 或版权信息。 请通过电子邮件 yujinlong@sealos.io 联系我们咨询许可事宜。 diff --git a/docSite/content/zh-cn/docs/course/openapi.md b/docSite/content/zh-cn/docs/course/openapi.md index 898e20138bf..5f473789303 100644 --- a/docSite/content/zh-cn/docs/course/openapi.md +++ b/docSite/content/zh-cn/docs/course/openapi.md @@ -27,7 +27,7 @@ Tips: 安全起见,你可以设置一个额度或者过期时间,放置 key ## 替换三方应用的变量 ```bash -OPENAI_API_BASE_URL: https://api.fastgpt.in/api (改成自己部署的域名) +OPENAI_API_BASE_URL: https://api.tryfastgpt.ai/api (改成自己部署的域名) OPENAI_API_KEY = 上一步获取到的密钥 ``` diff --git a/docSite/content/zh-cn/docs/course/websync.md b/docSite/content/zh-cn/docs/course/websync.md index b3f70a1f133..8374f068c4a 100644 --- a/docSite/content/zh-cn/docs/course/websync.md +++ b/docSite/content/zh-cn/docs/course/websync.md @@ -18,7 +18,7 @@ Web 站点同步利用爬虫的技术,可以通过一个入口网站,自动 Tips: 国内的媒体站点基本不可用,公众号、csdn、知乎等。可以通过终端发送`curl`请求检测是否为静态站点,例如: ```bash -curl https://doc.fastgpt.in/docs/intro/ +curl https://doc.tryfastgpt.ai/docs/intro/ ``` ## 如何使用 diff --git a/docSite/content/zh-cn/docs/development/configuration.md b/docSite/content/zh-cn/docs/development/configuration.md index 652a1293b30..4d24415045c 100644 --- a/docSite/content/zh-cn/docs/development/configuration.md +++ b/docSite/content/zh-cn/docs/development/configuration.md @@ -13,9 +13,7 @@ weight: 708 这个配置文件中包含了系统参数和各个模型配置: -## 4.6.8+ 版本新配置文件 - -llm模型全部合并 +## 4.6.8+ 版本新配置文件示例 ```json { @@ -29,16 +27,16 @@ llm模型全部合并 }, "llmModels": [ { - "model": "gpt-3.5-turbo", // 模型名(对应OneAPI中渠道的模型名) - "name": "gpt-3.5-turbo", // 别名 + "model": "gpt-4o-mini", // 模型名(对应OneAPI中渠道的模型名) + "name": "gpt-4o-mini", // 模型别名 "avatar": "/imgs/model/openai.svg", // 模型的logo - "maxContext": 16000, // 最大上下文 - "maxResponse": 4000, // 最大回复 - "quoteMaxToken": 13000, // 最大引用内容 + "maxContext": 125000, // 最大上下文 + "maxResponse": 16000, // 最大回复 + "quoteMaxToken": 120000, // 最大引用内容 "maxTemperature": 1.2, // 最大温度 - "charsPointsPrice": 0, // n积分/1k token(商业版) + "charsPointsPrice": 0, // n积分/1k token(商业版) "censor": false, // 是否开启敏感校验(商业版) - "vision": false, // 是否支持图片输入 + "vision": true, // 是否支持图片输入 "datasetProcess": true, // 是否设置为知识库处理模型(QA),务必保证至少有一个为true,否则知识库会报错 "usedInClassify": true, // 是否用于问题分类(务必保证至少有一个为true) "usedInExtractFields": true, // 是否用于内容提取(务必保证至少有一个为true) @@ -49,19 +47,19 @@ llm模型全部合并 "customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型 "customExtractPrompt": "", // 自定义内容提取提示词 "defaultSystemChatPrompt": "", // 对话默认携带的系统提示词 - "defaultConfig":{} // 请求API时,挟带一些默认配置(比如 GLM4 的 top_p) + "defaultConfig": {} // 请求API时,挟带一些默认配置(比如 GLM4 的 top_p) }, { - "model": "gpt-4-0125-preview", - "name": "gpt-4-turbo", + "model": "gpt-4o", + "name": "gpt-4o", "avatar": "/imgs/model/openai.svg", "maxContext": 125000, "maxResponse": 4000, - "quoteMaxToken": 100000, + "quoteMaxToken": 120000, "maxTemperature": 1.2, "charsPointsPrice": 0, "censor": false, - "vision": false, + "vision": true, "datasetProcess": false, "usedInClassify": true, "usedInExtractFields": true, @@ -72,30 +70,61 @@ llm模型全部合并 "customCQPrompt": "", "customExtractPrompt": "", "defaultSystemChatPrompt": "", - "defaultConfig":{} + "defaultConfig": {} }, { - "model": "gpt-4-vision-preview", - "name": "gpt-4-vision", + "model": "o1-mini", + "name": "o1-mini", "avatar": "/imgs/model/openai.svg", - "maxContext": 128000, + "maxContext": 125000, "maxResponse": 4000, - "quoteMaxToken": 100000, + "quoteMaxToken": 120000, "maxTemperature": 1.2, "charsPointsPrice": 0, "censor": false, - "vision": true, + "vision": false, "datasetProcess": false, - "usedInClassify": false, - "usedInExtractFields": false, - "usedInToolCall": false, - "usedInQueryExtension": false, - "toolChoice": true, + "usedInClassify": true, + "usedInExtractFields": true, + "usedInToolCall": true, + "usedInQueryExtension": true, + "toolChoice": false, "functionCall": false, "customCQPrompt": "", "customExtractPrompt": "", "defaultSystemChatPrompt": "", - "defaultConfig":{} + "defaultConfig": { + "temperature": 1, + "max_tokens": null, + "stream": false + } + }, + { + "model": "o1-preview", + "name": "o1-preview", + "avatar": "/imgs/model/openai.svg", + "maxContext": 125000, + "maxResponse": 4000, + "quoteMaxToken": 120000, + "maxTemperature": 1.2, + "charsPointsPrice": 0, + "censor": false, + "vision": false, + "datasetProcess": false, + "usedInClassify": true, + "usedInExtractFields": true, + "usedInToolCall": true, + "usedInQueryExtension": true, + "toolChoice": false, + "functionCall": false, + "customCQPrompt": "", + "customExtractPrompt": "", + "defaultSystemChatPrompt": "", + "defaultConfig": { + "temperature": 1, + "max_tokens": null, + "stream": false + } } ], "vectorModels": [ @@ -107,9 +136,30 @@ llm模型全部合并 "defaultToken": 700, // 默认文本分割时候的 token "maxToken": 3000, // 最大 token "weight": 100, // 优先训练权重 - "defaultConfig":{}, // 自定义额外参数。例如,如果希望使用 embedding3-large 的话,可以传入 dimensions:1024,来返回1024维度的向量。(目前必须小于1536维度) + "defaultConfig": {}, // 自定义额外参数。例如,如果希望使用 embedding3-large 的话,可以传入 dimensions:1024,来返回1024维度的向量。(目前必须小于1536维度) "dbConfig": {}, // 存储时的额外参数(非对称向量模型时候需要用到) "queryConfig": {} // 参训时的额外参数 + }, + { + "model": "text-embedding-3-large", + "name": "text-embedding-3-large", + "avatar": "/imgs/model/openai.svg", + "charsPointsPrice": 0, + "defaultToken": 512, + "maxToken": 3000, + "weight": 100, + "defaultConfig": { + "dimensions": 1024 + } + }, + { + "model": "text-embedding-3-small", + "name": "text-embedding-3-small", + "avatar": "/imgs/model/openai.svg", + "charsPointsPrice": 0, + "defaultToken": 512, + "maxToken": 3000, + "weight": 100 } ], "reRankModels": [], diff --git a/docSite/content/zh-cn/docs/development/faq.md b/docSite/content/zh-cn/docs/development/faq.md index 9bae37d4caa..dc167d49a20 100644 --- a/docSite/content/zh-cn/docs/development/faq.md +++ b/docSite/content/zh-cn/docs/development/faq.md @@ -121,4 +121,150 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并 1. 模型服务不可用 2. 模型接口参数异常(温度、max token等可能不适配) -3. .... \ No newline at end of file +3. .... + + +## 四、常见模型问题 + +### 报错 - 模型响应为空 + +该错误是由于 stream 模式下,oneapi 直接结束了流请求,并且未返回任何内容导致。 + +4.8.10 版本新增了错误日志,报错时,会在日志中打印出实际发送的 Body 参数,可以复制该参数后,通过 curl 向 oneapi 发起请求测试。 + +由于 oneapi 在 stream 模式下,无法正确捕获错误,可以设置成 `stream=false` 后进行测试。 + +### 如何测试模型是否支持工具调用 + +需要模型提供商和 oneapi 同时支持工具调用才可使用,测试方法如下: + +1. 通过 `curl` 向 `oneapi` 发起第一轮 stream 模式的 tool 测试。 + +```bash +curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \ +--header 'Authorization: Bearer sk-xxxx' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "model": "gpt-4o-mini", + "temperature": 0.01, + "max_completion_tokens": 8000, + "max_tokens": 8000, + "stream": true, + "messages": [ + { + "role": "user", + "content": "几点了" + } + ], + "tools": [ + { + "type": "function", + "function": { + "name": "hCVbIY", + "description": "获取用户当前时区的时间。", + "parameters": { + "type": "object", + "properties": {}, + "required": [] + } + } + } + ], + "tool_choice": "auto" +}' +``` + +2. 检查响应参数 + +如果能正常调用工具,会返回对应 `tool_calls` 参数。 + +```json +{ + "id": "chatcmpl-A7kwo1rZ3OHYSeIFgfWYxu8X2koN3", + "object": "chat.completion.chunk", + "created": 1726412126, + "model": "gpt-4o-mini-2024-07-18", + "system_fingerprint": "fp_483d39d857", + "choices": [ + { + "index": 0, + "delta": { + "role": "assistant", + "content": null, + "tool_calls": [ + { + "index": 0, + "id": "call_0n24eiFk8OUyIyrdEbLdirU7", + "type": "function", + "function": { + "name": "mEYIcFl84rYC", + "arguments": "" + } + } + ], + "refusal": null + }, + "logprobs": null, + "finish_reason": null + } + ], + "usage": null +} +``` + +3. 通过 `curl` 向 `oneapi` 发起第二轮 stream 模式的 tool 测试。 + +第二轮请求是把工具结果发送给模型。发起后会得到模型回答的结果。 + +```bash +curl --location --request POST 'https://oneapi.xxxx/v1/chat/completions' \ +--header 'Authorization: Bearer sk-xxx' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "model": "gpt-4o-mini", + "temperature": 0.01, + "max_completion_tokens": 8000, + "max_tokens": 8000, + "stream": true, + "messages": [ + { + "role": "user", + "content": "几点了" + }, + { + "role": "assistant", + "tool_calls": [ + { + "id": "kDia9S19c4RO", + "type": "function", + "function": { + "name": "hCVbIY", + "arguments": "{}" + } + } + ] + }, + { + "tool_call_id": "kDia9S19c4RO", + "role": "tool", + "name": "hCVbIY", + "content": "{\n \"time\": \"2024-09-14 22:59:21 Sunday\"\n}" + } + ], + "tools": [ + { + "type": "function", + "function": { + "name": "hCVbIY", + "description": "获取用户当前时区的时间。", + "parameters": { + "type": "object", + "properties": {}, + "required": [] + } + } + } + ], + "tool_choice": "auto" +}' +``` \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/development/intro.md b/docSite/content/zh-cn/docs/development/intro.md index c4faba4dc94..e38d3c55639 100644 --- a/docSite/content/zh-cn/docs/development/intro.md +++ b/docSite/content/zh-cn/docs/development/intro.md @@ -7,11 +7,11 @@ toc: true weight: 705 --- -本文档介绍了如何设置开发环境以构建和测试 [FastGPT](https://fastgpt.in),。 +本文档介绍了如何设置开发环境以构建和测试 [FastGPT](https://tryfastgpt.ai),。 ## 前置依赖项 -您需要在计算机上安装和配置以下依赖项才能构建 [FastGPT](https://fastgpt.in): +您需要在计算机上安装和配置以下依赖项才能构建 [FastGPT](https://tryfastgpt.ai): - [Git](http://git-scm.com/) - [Docker](https://www.docker.com/)(构建镜像) diff --git a/docSite/content/zh-cn/docs/development/openapi/auth.md b/docSite/content/zh-cn/docs/development/openapi/auth.md index cea42082521..13d2203b067 100644 --- a/docSite/content/zh-cn/docs/development/openapi/auth.md +++ b/docSite/content/zh-cn/docs/development/openapi/auth.md @@ -32,7 +32,7 @@ FastGPT 的 API Key **有 2 类**,一类是全局通用的 key (无法直接 OpenAPI 中,所有的接口都通过 Header.Authorization 进行鉴权。 ``` -baseUrl: "https://api.fastgpt.in/api" +baseUrl: "https://api.tryfastgpt.ai/api" headers: { Authorization: "Bearer {{apikey}}" } @@ -41,7 +41,7 @@ headers: { **发起应用对话示例** ```sh -curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions' \ +curl --location --request POST 'https://api.tryfastgpt.ai/api/v1/chat/completions' \ --header 'Authorization: Bearer fastgpt-xxxxxx' \ --header 'Content-Type: application/json' \ --data-raw '{ diff --git a/docSite/content/zh-cn/docs/development/openapi/chat.md b/docSite/content/zh-cn/docs/development/openapi/chat.md index 19e436db62f..53b8dc88fa1 100644 --- a/docSite/content/zh-cn/docs/development/openapi/chat.md +++ b/docSite/content/zh-cn/docs/development/openapi/chat.md @@ -29,7 +29,7 @@ weight: 852 {{< markdownify >}} ```bash -curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions' \ +curl --location --request POST 'https://api.tryfastgpt.ai/api/v1/chat/completions' \ --header 'Authorization: Bearer fastgpt-xxxxxx' \ --header 'Content-Type: application/json' \ --data-raw '{ diff --git a/docSite/content/zh-cn/docs/development/openapi/dataset.md b/docSite/content/zh-cn/docs/development/openapi/dataset.md index d0fc0b50812..27a7f3f5adc 100644 --- a/docSite/content/zh-cn/docs/development/openapi/dataset.md +++ b/docSite/content/zh-cn/docs/development/openapi/dataset.md @@ -22,7 +22,7 @@ weight: 853 **新例子** ```bash -curl --location --request POST 'https://api.fastgpt.in/api/support/wallet/usage/createTrainingUsage' \ +curl --location --request POST 'https://api.tryfastgpt.ai/api/support/wallet/usage/createTrainingUsage' \ --header 'Authorization: Bearer {{apikey}}' \ --header 'Content-Type: application/json' \ --data-raw '{ @@ -34,7 +34,7 @@ curl --location --request POST 'https://api.fastgpt.in/api/support/wallet/usage/ **x例子** ```bash -curl --location --request POST 'https://api.fastgpt.in/api/support/wallet/bill/createTrainingBill' \ +curl --location --request POST 'https://api.tryfastgpt.ai/api/support/wallet/bill/createTrainingBill' \ --header 'Authorization: Bearer {{apikey}}' \ --header 'Content-Type: application/json' \ --data-raw '{ @@ -466,7 +466,7 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio --header 'Authorization: Bearer {{authorization}}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "link":"https://doc.fastgpt.in/docs/course/quick-start/", + "link":"https://doc.tryfastgpt.ai/docs/course/quick-start/", "datasetId":"6593e137231a2be9c5603ba7", "parentId": null, @@ -718,7 +718,7 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio "tmbId": "65422be6aa44b7da77729ec9", "type": "link", "name": "快速上手 | FastGPT", - "rawLink": "https://doc.fastgpt.in/docs/course/quick-start/", + "rawLink": "https://doc.tryfastgpt.ai/docs/course/quick-start/", "updateTime": "2024-01-20T13:54:53.031Z", "dataAmount": 3, "trainingAmount": 0, @@ -935,7 +935,7 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/collect {{< markdownify >}} ```bash -curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/data/pushData' \ +curl --location --request POST 'https://api.tryfastgpt.ai/api/core/dataset/data/pushData' \ --header 'Authorization: Bearer apikey' \ --header 'Content-Type: application/json' \ --data-raw '{ @@ -1272,7 +1272,7 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/data/de {{< markdownify >}} ```bash -curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/searchTest' \ +curl --location --request POST 'https://api.tryfastgpt.ai/api/core/dataset/searchTest' \ --header 'Authorization: Bearer fastgpt-xxxxx' \ --header 'Content-Type: application/json' \ --data-raw '{ diff --git a/docSite/content/zh-cn/docs/development/openapi/share.md b/docSite/content/zh-cn/docs/development/openapi/share.md index f65ddcd0d8d..730e8565edd 100644 --- a/docSite/content/zh-cn/docs/development/openapi/share.md +++ b/docSite/content/zh-cn/docs/development/openapi/share.md @@ -53,9 +53,9 @@ weight: 860 在分享链接的地址中,增加一个额外的参数: authToken。例如: -原始的链接:`https://share.fastgpt.in/chat/share?shareId=648aaf5ae121349a16d62192` +原始的链接:`https://share.tryfastgpt.ai/chat/share?shareId=648aaf5ae121349a16d62192` -完整链接: `https://share.fastgpt.in/chat/share?shareId=648aaf5ae121349a16d62192&authToken=userid12345` +完整链接: `https://share.tryfastgpt.ai/chat/share?shareId=648aaf5ae121349a16d62192&authToken=userid12345` 这个`authToken`通常是你系统生成的用户唯一凭证(Token之类的)。FastGPT 会在鉴权接口的`body`中携带 token={{authToken}} 的参数。 @@ -387,9 +387,9 @@ export default async function (ctx: FunctionContext) { ### 3. 修改分享链接参数 -源分享链接:`https://share.fastgpt.in/chat/share?shareId=64be36376a438af0311e599c` +源分享链接:`https://share.tryfastgpt.ai/chat/share?shareId=64be36376a438af0311e599c` -修改后:`https://share.fastgpt.in/chat/share?shareId=64be36376a438af0311e599c&authToken=fastgpt` +修改后:`https://share.tryfastgpt.ai/chat/share?shareId=64be36376a438af0311e599c&authToken=fastgpt` ### 4. 测试效果 diff --git a/docSite/content/zh-cn/docs/development/sealos.md b/docSite/content/zh-cn/docs/development/sealos.md index ca7e14a5b94..eaebf7305ec 100644 --- a/docSite/content/zh-cn/docs/development/sealos.md +++ b/docSite/content/zh-cn/docs/development/sealos.md @@ -89,7 +89,7 @@ FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据 点击右侧的详情,可以查看对应应用的详细信息。 ### 如何更新/升级 FastGPT -[升级脚本文档](https://doc.fastgpt.in/docs/development/upgrading/)先看下文档,看下需要升级哪个版本。注意,不要跨版本升级!!!!! +[升级脚本文档](https://doc.tryfastgpt.ai/docs/development/upgrading/)先看下文档,看下需要升级哪个版本。注意,不要跨版本升级!!!!! 例如,目前是4.5 版本,要升级到4.5.1,就先把镜像版本改成v4.5.1,执行一下升级脚本,等待完成后再继续升级。如果目标版本不需要执行初始化,则可以跳过。 @@ -124,7 +124,7 @@ FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据 ![](/imgs/onsealos5.png) -[配置文件参考](https://doc.fastgpt.in/docs/development/configuration/) +[配置文件参考](https://doc.tryfastgpt.ai/docs/development/configuration/) ### 修改站点名称以及 favicon 修改应用的环境变量,增加 diff --git a/docSite/content/zh-cn/docs/development/upgrading/4810.md b/docSite/content/zh-cn/docs/development/upgrading/4810.md index 6b694f2e8e5..66e033337c3 100644 --- a/docSite/content/zh-cn/docs/development/upgrading/4810.md +++ b/docSite/content/zh-cn/docs/development/upgrading/4810.md @@ -1,5 +1,5 @@ --- -title: 'V4.8.10' +title: 'V4.8.10(需要初始化)' description: 'FastGPT V4.8.10 更新说明' icon: 'upgrade' draft: false diff --git a/docSite/content/zh-cn/docs/development/upgrading/4811.md b/docSite/content/zh-cn/docs/development/upgrading/4811.md index 600023c2c68..18649f9a5a0 100644 --- a/docSite/content/zh-cn/docs/development/upgrading/4811.md +++ b/docSite/content/zh-cn/docs/development/upgrading/4811.md @@ -11,17 +11,85 @@ weight: 813 ### 1. 做好数据备份 +### 2. 修改配置文件 + +如需增加 openai o1 模型,可添加如下配置: + +```json +{ + "model": "o1-mini", + "name": "o1-mini", + "avatar": "/imgs/model/openai.svg", + "maxContext": 125000, + "maxResponse": 4000, + "quoteMaxToken": 120000, + "maxTemperature": 1.2, + "charsPointsPrice": 0, + "censor": false, + "vision": false, + "datasetProcess": false, + "usedInClassify": true, + "usedInExtractFields": true, + "usedInToolCall": true, + "usedInQueryExtension": true, + "toolChoice": false, + "functionCall": false, + "customCQPrompt": "", + "customExtractPrompt": "", + "defaultSystemChatPrompt": "", + "defaultConfig": { + "temperature": 1, + "max_tokens": null, + "stream": false + } +}, +{ + "model": "o1-preview", + "name": "o1-preview", + "avatar": "/imgs/model/openai.svg", + "maxContext": 125000, + "maxResponse": 4000, + "quoteMaxToken": 120000, + "maxTemperature": 1.2, + "charsPointsPrice": 0, + "censor": false, + "vision": false, + "datasetProcess": false, + "usedInClassify": true, + "usedInExtractFields": true, + "usedInToolCall": true, + "usedInQueryExtension": true, + "toolChoice": false, + "functionCall": false, + "customCQPrompt": "", + "customExtractPrompt": "", + "defaultSystemChatPrompt": "", + "defaultConfig": { + "temperature": 1, + "max_tokens": null, + "stream": false + } +} +``` + ------- +### 3. 修改镜像 tag 并重启 + + + ## V4.8.11 更新说明 1. -2. 新增 - 聊天记录滚动加载,不再只加载 30 条。 -3. 新增 - 工作流增加触摸板优先模式。 -4. 新增 - 沙盒增加字符串转 base64 全局方法。 -5. 优化 - 工作流嵌套层级限制 20 层,避免因编排不合理导致的无限死循环。 -5. 优化 - 工作流 handler 性能优化。 -6. 优化 - 工作流快捷键,避免调试测试时也会触发。 -7. 优化 - 流输出,切换 tab 时仍可以继续输出。 -8. 修复 - 知识库选择权限问题。 -9. 修复 - 空 chatId 发起对话,首轮携带用户选择时会异常。 +2. 新增 - 循环运行节点,可传入数组进行批量调用,目前最多支持 50 长度的数组串行执行。 +3. 新增 - 聊天记录滚动加载,不再只加载 30 条。 +4. 新增 - 工作流增加触摸板优先模式。 +5. 新增 - 沙盒增加字符串转 base64 全局方法。 +6. 新增 - 支持 Openai o1 模型,需增加模型的 `defaultConfig` 配置,覆盖 `temperature`、`max_tokens` 和 `stream`配置,o1 不支持 stream 模式, 详细可重新拉取 `config.json` 配置文件查看。 +7. 优化 - 工作流嵌套层级限制 20 层,避免因编排不合理导致的无限死循环。 +8. 优化 - 工作流 handler 性能优化。 +9. 优化 - 工作流快捷键,避免调试测试时也会触发。 +10. 优化 - 流输出,切换 tab 时仍可以继续输出。 +11. 修复 - 知识库选择权限问题。 +12. 修复 - 空 chatId 发起对话,首轮携带用户选择时会异常。 +13. 修复 - createDataset 接口,intro 为赋值。 diff --git a/docSite/content/zh-cn/docs/development/upgrading/intro.md b/docSite/content/zh-cn/docs/development/upgrading/intro.md index 4ed36536fa0..1bd3d5b53a2 100644 --- a/docSite/content/zh-cn/docs/development/upgrading/intro.md +++ b/docSite/content/zh-cn/docs/development/upgrading/intro.md @@ -60,6 +60,11 @@ docker-compose up -d ## QA +### 为什么需要初始化 + +数据表出现大幅度变更,无法通过设置默认值,或复杂度较高时,会通过初始化来更新部分数据表字段。 +严格按初始化步骤进行操作,不会造成旧数据丢失。但在初始化过程中,如果数据量大,需要初始化的时间较长,这段时间可能会造成服务无法正常使用。 + ### {{host}} 是什么 {{}} 代表变量, {{host}}代表一个名为 host 的变量。指的是你服务器的域名或 IP。 @@ -85,4 +90,4 @@ sealos 中可以从上图左侧的环境变量中获取。 4. 修改镜像到4.6,执行初始化 5. ..... -逐一升级 \ No newline at end of file +逐一升级 diff --git a/docSite/content/zh-cn/docs/intro.md b/docSite/content/zh-cn/docs/intro.md index 40fbe36f430..5f060c939e6 100644 --- a/docSite/content/zh-cn/docs/intro.md +++ b/docSite/content/zh-cn/docs/intro.md @@ -10,7 +10,7 @@ weight: -10 FastGPT 是一个基于 LLM 大语言模型的知识库问答系统,提供开箱即用的数据处理、模型调用等能力。同时可以通过 Flow 可视化进行工作流编排,从而实现复杂的问答场景! {{% alert icon="🤖 " context="success" %}} -FastGPT 在线使用:[https://fastgpt.in](https://fastgpt.in) +FastGPT 在线使用:[https://tryfastgpt.ai](https://tryfastgpt.ai) {{% /alert %}} | | | diff --git a/docSite/content/zh-cn/docs/pricing.md b/docSite/content/zh-cn/docs/pricing.md index 6dd14694673..b4bd054c609 100644 --- a/docSite/content/zh-cn/docs/pricing.md +++ b/docSite/content/zh-cn/docs/pricing.md @@ -6,7 +6,7 @@ draft: false toc: true weight: 1200 type: redirect -target: https://cloud.fastgpt.in/price +target: https://cloud.tryfastgpt.ai/price --- -线上版价格请查看:[https://cloud.fastgpt.in/price](https://cloud.fastgpt.in/price) \ No newline at end of file +线上版价格请查看:[https://cloud.tryfastgpt.ai/price](https://cloud.tryfastgpt.ai/price) \ No newline at end of file diff --git a/docSite/content/zh-cn/docs/use-cases/onwechat.md b/docSite/content/zh-cn/docs/use-cases/onwechat.md index bc8959bdd4b..51549b1ce03 100644 --- a/docSite/content/zh-cn/docs/use-cases/onwechat.md +++ b/docSite/content/zh-cn/docs/use-cases/onwechat.md @@ -26,7 +26,7 @@ weight: 504 ## 3. 创建 docker-compose.yml 文件 -只需要修改 `OPEN_AI_API_KEY` 和 `OPEN_AI_API_BASE` 两个环境变量即可。其中 `OPEN_AI_API_KEY` 为第一步获取的密钥,`OPEN_AI_API_BASE` 为 FastGPT 的 OpenAPI 地址,例如:`https://api.fastgpt.in/api/v1`。 +只需要修改 `OPEN_AI_API_KEY` 和 `OPEN_AI_API_BASE` 两个环境变量即可。其中 `OPEN_AI_API_KEY` 为第一步获取的密钥,`OPEN_AI_API_BASE` 为 FastGPT 的 OpenAPI 地址,例如:`https://api.tryfastgpt.ai/api/v1`。 随便找一个目录,创建一个 docker-compose.yml 文件,将下面的代码复制进去。 @@ -40,7 +40,7 @@ services: - seccomp:unconfined environment: OPEN_AI_API_KEY: 'fastgpt-z51pkjqm9nrk03a1rx2funoy' - OPEN_AI_API_BASE: 'https://api.fastgpt.in/api/v1' + OPEN_AI_API_BASE: 'https://api.tryfastgpt.ai/api/v1' MODEL: 'gpt-3.5-turbo' CHANNEL_TYPE: 'wx' PROXY: '' diff --git a/docSite/content/zh-cn/docs/workflow/modules/http.md b/docSite/content/zh-cn/docs/workflow/modules/http.md index 19a26e52f0e..9b0dc84c8a5 100644 --- a/docSite/content/zh-cn/docs/workflow/modules/http.md +++ b/docSite/content/zh-cn/docs/workflow/modules/http.md @@ -70,7 +70,7 @@ HTTP 模块会向对应的地址发送一个 `HTTP` 请求,实际操作与 Pos "array": [1, 2, 3], "obj": { "name": "FastGPT", - "url": "https://fastgpt.in" + "url": "https://tryfastgpt.ai" } } ``` @@ -109,7 +109,7 @@ HTTP 模块会向对应的地址发送一个 `HTTP` 请求,实际操作与 Pos "array2": [1, 2, 3], "object": { "name": "FastGPT", - "url": "https://fastgpt.in" + "url": "https://tryfastgpt.ai" } } ``` diff --git a/docSite/hugo.toml b/docSite/hugo.toml index e7f9b64c8d7..dd0b6cd3c4b 100644 --- a/docSite/hugo.toml +++ b/docSite/hugo.toml @@ -113,7 +113,7 @@ defaultContentLanguageInSubdir = false # Link behaviour intLinkTooltip = true # Enable a tooltip for internal links that displays info about the destination? default false # extLinkNewTab = false # Open external links in a new Tab? default true - logoLinkURL = "https://fastgpt.in/" # Set a custom URL destination for the top header logo link. + logoLinkURL = "https://tryfastgpt.ai/" # Set a custom URL destination for the top header logo link. [params.flexsearch] # Parameters for FlexSearch # enabled = true diff --git a/packages/global/core/chat/adapt.ts b/packages/global/core/chat/adapt.ts index 472dd290ab6..6eb712876ef 100644 --- a/packages/global/core/chat/adapt.ts +++ b/packages/global/core/chat/adapt.ts @@ -344,7 +344,7 @@ export const runtimePrompt2ChatsValue = ( return value; }; -export const getSystemPrompt = (prompt?: string): ChatItemType[] => { +export const getSystemPrompt_ChatItemType = (prompt?: string): ChatItemType[] => { if (!prompt) return []; return [ { diff --git a/packages/global/core/workflow/constants.ts b/packages/global/core/workflow/constants.ts index eab81402362..82e2ee20377 100644 --- a/packages/global/core/workflow/constants.ts +++ b/packages/global/core/workflow/constants.ts @@ -24,6 +24,7 @@ export enum WorkflowIOValueTypeEnum { arrayNumber = 'arrayNumber', arrayBoolean = 'arrayBoolean', arrayObject = 'arrayObject', + arrayAny = 'arrayAny', any = 'any', chatHistory = 'chatHistory', @@ -135,7 +136,17 @@ export enum NodeInputKeyEnum { fileUrlList = 'fileUrlList', // user select - userSelectOptions = 'userSelectOptions' + userSelectOptions = 'userSelectOptions', + + // loop + loopInputArray = 'loopInputArray', + childrenNodeIdList = 'childrenNodeIdList', + nodeWidth = 'nodeWidth', + nodeHeight = 'nodeHeight', + // loop start + loopStartInput = 'loopStartInput', + // loop end + loopEndInput = 'loopEndInput' } export enum NodeOutputKeyEnum { @@ -178,7 +189,13 @@ export enum NodeOutputKeyEnum { ifElseResult = 'ifElseResult', //user select - selectResult = 'selectResult' + selectResult = 'selectResult', + + // loop + loopArray = 'loopArray', + + // loop start + loopStartInput = 'loopStartInput' } export enum VariableInputEnum { diff --git a/packages/global/core/workflow/node/constant.ts b/packages/global/core/workflow/node/constant.ts index e34813f1b5e..34e2a6f1217 100644 --- a/packages/global/core/workflow/node/constant.ts +++ b/packages/global/core/workflow/node/constant.ts @@ -125,7 +125,10 @@ export enum FlowNodeTypeEnum { textEditor = 'textEditor', customFeedback = 'customFeedback', readFiles = 'readFiles', - userSelect = 'userSelect' + userSelect = 'userSelect', + loop = 'loop', + loopStart = 'loopStart', + loopEnd = 'loopEnd' } // node IO value type @@ -162,6 +165,10 @@ export const FlowValueTypeMap = { label: 'array', value: WorkflowIOValueTypeEnum.arrayObject }, + [WorkflowIOValueTypeEnum.arrayAny]: { + label: 'array', + value: WorkflowIOValueTypeEnum.arrayAny + }, [WorkflowIOValueTypeEnum.any]: { label: 'any', value: WorkflowIOValueTypeEnum.any diff --git a/packages/global/core/workflow/runtime/type.d.ts b/packages/global/core/workflow/runtime/type.d.ts index 2339fd3ef0c..55f4776a0c5 100644 --- a/packages/global/core/workflow/runtime/type.d.ts +++ b/packages/global/core/workflow/runtime/type.d.ts @@ -172,6 +172,15 @@ export type DispatchNodeResponseType = { // update var updateVarResult?: any[]; + + // loop + loopResult?: any[]; + loopInput?: any[]; + loopDetail?: ChatHistoryItemResType[]; + // loop start + loopInputValue?: any; + // loop end + loopOutputValue?: any; }; export type DispatchNodeResultType = { diff --git a/packages/global/core/workflow/template/constants.ts b/packages/global/core/workflow/template/constants.ts index 2d2dcb038fc..76439e3b3fd 100644 --- a/packages/global/core/workflow/template/constants.ts +++ b/packages/global/core/workflow/template/constants.ts @@ -29,6 +29,9 @@ import { TextEditorNode } from './system/textEditor'; import { CustomFeedbackNode } from './system/customFeedback'; import { ReadFilesNodes } from './system/readFiles'; import { UserSelectNode } from './system/userSelect/index'; +import { LoopNode } from './system/loop/loop'; +import { LoopStartNode } from './system/loop/loopStart'; +import { LoopEndNode } from './system/loop/loopEnd'; const systemNodes: FlowNodeTemplateType[] = [ AiChatModule, @@ -46,7 +49,8 @@ const systemNodes: FlowNodeTemplateType[] = [ LafModule, IfElseNode, VariableUpdateNode, - CodeNode + CodeNode, + LoopNode ]; /* app flow module templates */ export const appSystemModuleTemplates: FlowNodeTemplateType[] = [ @@ -74,5 +78,7 @@ export const moduleTemplatesFlat: FlowNodeTemplateType[] = [ EmptyNode, RunPluginModule, RunAppNode, - RunAppModule + RunAppModule, + LoopStartNode, + LoopEndNode ]; diff --git a/packages/global/core/workflow/template/input.ts b/packages/global/core/workflow/template/input.ts index a3dce032f8e..cfb7bb39519 100644 --- a/packages/global/core/workflow/template/input.ts +++ b/packages/global/core/workflow/template/input.ts @@ -83,3 +83,25 @@ export const Input_Template_File_Link: FlowNodeInputItemType = { description: i18nT('app:workflow.user_file_input_desc'), valueType: WorkflowIOValueTypeEnum.arrayString }; + +export const Input_Template_Children_Node_List: FlowNodeInputItemType = { + key: NodeInputKeyEnum.childrenNodeIdList, + renderTypeList: [FlowNodeInputTypeEnum.hidden], + valueType: WorkflowIOValueTypeEnum.arrayString, + label: '', + value: [] +}; +export const Input_Template_Node_Width: FlowNodeInputItemType = { + key: NodeInputKeyEnum.nodeWidth, + renderTypeList: [FlowNodeInputTypeEnum.hidden], + valueType: WorkflowIOValueTypeEnum.number, + label: '', + value: 900 +}; +export const Input_Template_Node_Height: FlowNodeInputItemType = { + key: NodeInputKeyEnum.nodeHeight, + renderTypeList: [FlowNodeInputTypeEnum.hidden], + valueType: WorkflowIOValueTypeEnum.number, + label: '', + value: 900 +}; diff --git a/packages/global/core/workflow/template/system/loop/loop.ts b/packages/global/core/workflow/template/system/loop/loop.ts new file mode 100644 index 00000000000..b99a1453f48 --- /dev/null +++ b/packages/global/core/workflow/template/system/loop/loop.ts @@ -0,0 +1,54 @@ +import { + FlowNodeInputTypeEnum, + FlowNodeOutputTypeEnum, + FlowNodeTypeEnum +} from '../../../node/constant'; +import { FlowNodeTemplateType } from '../../../type/node'; +import { + FlowNodeTemplateTypeEnum, + NodeInputKeyEnum, + NodeOutputKeyEnum, + WorkflowIOValueTypeEnum +} from '../../../constants'; +import { getHandleConfig } from '../../utils'; +import { i18nT } from '../../../../../../web/i18n/utils'; +import { + Input_Template_Children_Node_List, + Input_Template_Node_Height, + Input_Template_Node_Width +} from '../../input'; + +export const LoopNode: FlowNodeTemplateType = { + id: FlowNodeTypeEnum.loop, + templateType: FlowNodeTemplateTypeEnum.tools, + flowNodeType: FlowNodeTypeEnum.loop, + sourceHandle: getHandleConfig(true, true, true, true), + targetHandle: getHandleConfig(true, true, true, true), + avatar: 'core/workflow/template/loop', + name: i18nT('workflow:loop'), + intro: i18nT('workflow:intro_loop'), + showStatus: true, + version: '4811', + inputs: [ + { + key: NodeInputKeyEnum.loopInputArray, + renderTypeList: [FlowNodeInputTypeEnum.reference], + valueType: WorkflowIOValueTypeEnum.arrayAny, + required: true, + label: i18nT('workflow:loop_input_array'), + value: [] + }, + Input_Template_Children_Node_List, + Input_Template_Node_Width, + Input_Template_Node_Height + ], + outputs: [ + { + id: NodeOutputKeyEnum.loopArray, + key: NodeOutputKeyEnum.loopArray, + label: i18nT('workflow:loop_result'), + type: FlowNodeOutputTypeEnum.static, + valueType: WorkflowIOValueTypeEnum.arrayAny + } + ] +}; diff --git a/packages/global/core/workflow/template/system/loop/loopEnd.ts b/packages/global/core/workflow/template/system/loop/loopEnd.ts new file mode 100644 index 00000000000..02633bf7726 --- /dev/null +++ b/packages/global/core/workflow/template/system/loop/loopEnd.ts @@ -0,0 +1,34 @@ +import { i18nT } from '../../../../../../web/i18n/utils'; +import { + FlowNodeTemplateTypeEnum, + NodeInputKeyEnum, + WorkflowIOValueTypeEnum +} from '../../../constants'; +import { FlowNodeInputTypeEnum, FlowNodeTypeEnum } from '../../../node/constant'; +import { FlowNodeTemplateType } from '../../../type/node'; +import { getHandleConfig } from '../../utils'; + +export const LoopEndNode: FlowNodeTemplateType = { + id: FlowNodeTypeEnum.loopEnd, + templateType: FlowNodeTemplateTypeEnum.systemInput, + flowNodeType: FlowNodeTypeEnum.loopEnd, + sourceHandle: getHandleConfig(false, false, false, false), + targetHandle: getHandleConfig(false, false, false, true), + unique: true, + forbidDelete: true, + avatar: 'core/workflow/template/loopEnd', + name: i18nT('workflow:loop_end'), + showStatus: false, + version: '4811', + inputs: [ + { + key: NodeInputKeyEnum.loopEndInput, + renderTypeList: [FlowNodeInputTypeEnum.reference], + valueType: WorkflowIOValueTypeEnum.any, + label: '', + required: true, + value: [] + } + ], + outputs: [] +}; diff --git a/packages/global/core/workflow/template/system/loop/loopStart.ts b/packages/global/core/workflow/template/system/loop/loopStart.ts new file mode 100644 index 00000000000..96ded8e69b9 --- /dev/null +++ b/packages/global/core/workflow/template/system/loop/loopStart.ts @@ -0,0 +1,34 @@ +import { FlowNodeInputTypeEnum, FlowNodeTypeEnum } from '../../../node/constant'; +import { FlowNodeTemplateType } from '../../../type/node.d'; +import { + FlowNodeTemplateTypeEnum, + NodeInputKeyEnum, + WorkflowIOValueTypeEnum +} from '../../../constants'; +import { getHandleConfig } from '../../utils'; +import { i18nT } from '../../../../../../web/i18n/utils'; + +export const LoopStartNode: FlowNodeTemplateType = { + id: FlowNodeTypeEnum.loopStart, + templateType: FlowNodeTemplateTypeEnum.systemInput, + flowNodeType: FlowNodeTypeEnum.loopStart, + sourceHandle: getHandleConfig(false, true, false, false), + targetHandle: getHandleConfig(false, false, false, false), + avatar: 'core/workflow/template/loopStart', + name: i18nT('workflow:loop_start'), + unique: true, + forbidDelete: true, + showStatus: false, + version: '4811', + inputs: [ + { + key: NodeInputKeyEnum.loopStartInput, + renderTypeList: [FlowNodeInputTypeEnum.hidden], + valueType: WorkflowIOValueTypeEnum.any, + label: '', + required: true, + value: '' + } + ], + outputs: [] +}; diff --git a/packages/global/core/workflow/type/node.d.ts b/packages/global/core/workflow/type/node.d.ts index 26fdb868194..a5f121418ca 100644 --- a/packages/global/core/workflow/type/node.d.ts +++ b/packages/global/core/workflow/type/node.d.ts @@ -95,6 +95,7 @@ export type NodeTemplateListType = { // react flow node type export type FlowNodeItemType = FlowNodeTemplateType & { nodeId: string; + parentNodeId?: string; isError?: boolean; debugResult?: { status: 'running' | 'success' | 'skipped' | 'failed'; diff --git a/packages/global/package.json b/packages/global/package.json index 6852d7777b1..faaab7015b4 100644 --- a/packages/global/package.json +++ b/packages/global/package.json @@ -11,7 +11,7 @@ "jschardet": "3.1.1", "nanoid": "^4.0.1", "next": "14.2.5", - "openai": "4.57.0", + "openai": "4.61.0", "openapi-types": "^12.1.3", "timezones-list": "^3.0.2" }, diff --git a/packages/service/core/ai/functions/queryExtension.ts b/packages/service/core/ai/functions/queryExtension.ts index c316d61ebb5..ad1322fc101 100644 --- a/packages/service/core/ai/functions/queryExtension.ts +++ b/packages/service/core/ai/functions/queryExtension.ts @@ -4,13 +4,17 @@ import { ChatItemType } from '@fastgpt/global/core/chat/type'; import { countGptMessagesTokens } from '../../../common/string/tiktoken/index'; import { ChatCompletionMessageParam } from '@fastgpt/global/core/ai/type'; import { chatValue2RuntimePrompt } from '@fastgpt/global/core/chat/adapt'; +import { getLLMModel } from '../model'; /* query extension - 问题扩展 可以根据上下文,消除指代性问题以及扩展问题,利于检索。 */ -const defaultPrompt = `作为一个向量检索助手,你的任务是结合历史记录,从不同角度,为“原问题”生成个不同版本的“检索词”,从而提高向量检索的语义丰富度,提高向量检索的精度。生成的问题要求指向对象清晰明确,并与“原问题语言相同”。 +const title = global.feConfigs?.systemTitle || 'FastAI'; +const defaultPrompt = `作为一个向量检索助手,你的任务是结合历史记录,从不同角度,为“原问题”生成个不同版本的“检索词”,从而提高向量检索的语义丰富度,提高向量检索的精度。 +生成的问题要求指向对象清晰明确,并与“原问题语言相同”。 + 参考 标中的示例来完成任务。 @@ -49,49 +53,50 @@ A: 护产假的天数根据员工所在的城市而定。请提供您所在的 历史记录: """ Q: 作者是谁? -A: FastGPT 的作者是 labring。 +A: ${title} 的作者是 labring。 """ 原问题: Tell me about him -检索词: ["Introduce labring, the author of FastGPT." ," Background information on author labring." "," Why does labring do FastGPT?"] +检索词: ["Introduce labring, the author of ${title}." ," Background information on author labring." "," Why does labring do ${title}?"] ---------------- 历史记录: """ Q: 对话背景。 -A: 关于 FatGPT 的介绍和使用等问题。 +A: 关于 ${title} 的介绍和使用等问题。 """ 原问题: 你好。 检索词: ["你好"] ---------------- 历史记录: """ -Q: FastGPT 如何收费? -A: FastGPT 收费可以参考…… +Q: ${title} 如何收费? +A: ${title} 收费可以参考…… """ 原问题: 你知道 laf 么? 检索词: ["laf 的官网地址是多少?","laf 的使用教程。","laf 有什么特点和优势。"] ---------------- 历史记录: """ -Q: FastGPT 的优势 +Q: ${title} 的优势 A: 1. 开源 2. 简便 3. 扩展性强 """ 原问题: 介绍下第2点。 -检索词: ["介绍下 FastGPT 简便的优势", "从哪些方面,可以体现出 FastGPT 的简便"]。 +检索词: ["介绍下 ${title} 简便的优势", "从哪些方面,可以体现出 ${title} 的简便"]。 ---------------- 历史记录: """ -Q: 什么是 FastGPT? -A: FastGPT 是一个 RAG 平台。 +Q: 什么是 ${title}? +A: ${title} 是一个 RAG 平台。 Q: 什么是 Laf? A: Laf 是一个云函数开发平台。 """ 原问题: 它们有什么关系? -检索词: ["FastGPT和Laf有什么关系?","介绍下FastGPT","介绍下Laf"] +检索词: ["${title}和Laf有什么关系?","介绍下${title}","介绍下Laf"] ----------------- +----- + 下面是正式的任务: 历史记录: @@ -130,6 +135,8 @@ A: ${chatBg} .join('\n'); const concatFewShot = `${systemFewShot}${historyFewShot}`.trim(); + const modelData = getLLMModel(model); + const ai = getAIApi({ timeout: 480000 }); @@ -144,11 +151,12 @@ A: ${chatBg} } ] as ChatCompletionMessageParam[]; const result = await ai.chat.completions.create({ - model: model, + model: modelData.model, temperature: 0.01, // @ts-ignore messages, - stream: false + stream: false, + ...modelData.defaultConfig }); let answer = result.choices?.[0]?.message?.content || ''; @@ -161,6 +169,8 @@ A: ${chatBg} }; } + // Intercept the content of [] and retain [] + answer = answer.match(/\[.*?\]/)?.[0] || ''; answer = answer.replace(/\\"/g, '"'); try { diff --git a/packages/service/core/workflow/dispatch/abandoned/runApp.ts b/packages/service/core/workflow/dispatch/abandoned/runApp.ts index a8fb32ef825..49693d5b90a 100644 --- a/packages/service/core/workflow/dispatch/abandoned/runApp.ts +++ b/packages/service/core/workflow/dispatch/abandoned/runApp.ts @@ -93,6 +93,7 @@ export const dispatchAppRequest = async (props: Props): Promise => { const { text } = chatValue2RuntimePrompt(assistantResponses); return { + assistantResponses, [DispatchNodeResponseKeyEnum.nodeResponse]: { moduleLogo: appData.avatar, query: userChatInput, diff --git a/packages/service/core/workflow/dispatch/agent/classifyQuestion.ts b/packages/service/core/workflow/dispatch/agent/classifyQuestion.ts index 94715db1f9f..88956a42854 100644 --- a/packages/service/core/workflow/dispatch/agent/classifyQuestion.ts +++ b/packages/service/core/workflow/dispatch/agent/classifyQuestion.ts @@ -128,7 +128,8 @@ const completions = async ({ model: cqModel.model, temperature: 0.01, messages: requestMessages, - stream: false + stream: false, + ...cqModel.defaultConfig }); const answer = data.choices?.[0].message?.content || ''; diff --git a/packages/service/core/workflow/dispatch/agent/extract.ts b/packages/service/core/workflow/dispatch/agent/extract.ts index a3754092077..1efd9eb91d7 100644 --- a/packages/service/core/workflow/dispatch/agent/extract.ts +++ b/packages/service/core/workflow/dispatch/agent/extract.ts @@ -355,7 +355,8 @@ Human: ${content}` model: extractModel.model, temperature: 0.01, messages: requestMessages, - stream: false + stream: false, + ...extractModel.defaultConfig }); const answer = data.choices?.[0].message?.content || ''; diff --git a/packages/service/core/workflow/dispatch/agent/runTool/index.ts b/packages/service/core/workflow/dispatch/agent/runTool/index.ts index 44a66391b73..22ca5e75de6 100644 --- a/packages/service/core/workflow/dispatch/agent/runTool/index.ts +++ b/packages/service/core/workflow/dispatch/agent/runTool/index.ts @@ -14,7 +14,7 @@ import { GPTMessages2Chats, chatValue2RuntimePrompt, chats2GPTMessages, - getSystemPrompt, + getSystemPrompt_ChatItemType, runtimePrompt2ChatsValue } from '@fastgpt/global/core/chat/adapt'; import { formatModelChars2Points } from '../../../../../support/wallet/usage/utils'; @@ -95,7 +95,8 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise< }); const messages: ChatItemType[] = [ - ...getSystemPrompt(systemPrompt), + ...getSystemPrompt_ChatItemType(toolModel.defaultSystemChatPrompt), + ...getSystemPrompt_ChatItemType(systemPrompt), // Add file input prompt to histories ...chatHistories.map((item) => { if (item.obj === ChatRoleEnum.Human) { diff --git a/packages/service/core/workflow/dispatch/agent/runTool/promptCall.ts b/packages/service/core/workflow/dispatch/agent/runTool/promptCall.ts index 74ffb9bd8d2..0fba2b6780f 100644 --- a/packages/service/core/workflow/dispatch/agent/runTool/promptCall.ts +++ b/packages/service/core/workflow/dispatch/agent/runTool/promptCall.ts @@ -114,15 +114,16 @@ export const runToolWithPromptCall = async ( }) ]); const requestBody = { - ...toolModel?.defaultConfig, model: toolModel.model, temperature: computedTemperature({ model: toolModel, temperature }), + max_completion_tokens: max_tokens, max_tokens, stream, - messages: requestMessages + messages: requestMessages, + ...toolModel?.defaultConfig }; // console.log(JSON.stringify(requestBody, null, 2)); @@ -135,9 +136,13 @@ export const runToolWithPromptCall = async ( Accept: 'application/json, text/plain, */*' } }); + const isStreamResponse = + typeof aiResponse === 'object' && + aiResponse !== null && + ('iterator' in aiResponse || 'controller' in aiResponse); const answer = await (async () => { - if (res && stream) { + if (res && isStreamResponse) { const { answer } = await streamResponse({ res, toolNodes, @@ -164,6 +169,17 @@ export const runToolWithPromptCall = async ( }) }); } + + // 不支持 stream 模式的模型的流失响应 + if (stream && !isStreamResponse) { + workflowStreamResponse?.({ + event: SseResponseEventEnum.fastAnswer, + data: textAdaptGptResponse({ + text: replaceAnswer + }) + }); + } + // No tool is invoked, indicating that the process is over const gptAssistantResponse: ChatCompletionAssistantMessageParam = { role: ChatCompletionRequestMessageRoleEnum.Assistant, diff --git a/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts b/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts index b36cd96a637..b03654759a7 100644 --- a/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts +++ b/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts @@ -128,17 +128,18 @@ export const runToolWithToolChoice = async ( }) ]); const requestBody: any = { - ...toolModel?.defaultConfig, model: toolModel.model, temperature: computedTemperature({ model: toolModel, temperature }), + max_completion_tokens: max_tokens, max_tokens, stream, messages: requestMessages, tools, - tool_choice: 'auto' + tool_choice: 'auto', + ...toolModel?.defaultConfig }; // console.log(JSON.stringify(requestBody, null, 2)); @@ -153,9 +154,13 @@ export const runToolWithToolChoice = async ( Accept: 'application/json, text/plain, */*' } }); + const isStreamResponse = + typeof aiResponse === 'object' && + aiResponse !== null && + ('iterator' in aiResponse || 'controller' in aiResponse); const { answer, toolCalls } = await (async () => { - if (res && stream) { + if (res && isStreamResponse) { return streamResponse({ res, workflowStreamResponse, @@ -165,6 +170,7 @@ export const runToolWithToolChoice = async ( } else { const result = aiResponse as ChatCompletion; const calls = result.choices?.[0]?.message?.tool_calls || []; + const answer = result.choices?.[0]?.message?.content || ''; // 加上name和avatar const toolCalls = calls.map((tool) => { @@ -176,8 +182,33 @@ export const runToolWithToolChoice = async ( }; }); + // 不支持 stream 模式的模型的流失响应 + toolCalls.forEach((tool) => { + workflowStreamResponse?.({ + event: SseResponseEventEnum.toolCall, + data: { + tool: { + id: tool.id, + toolName: tool.toolName, + toolAvatar: tool.toolAvatar, + functionName: tool.function.name, + params: tool.function?.arguments ?? '', + response: '' + } + } + }); + }); + if (answer) { + workflowStreamResponse?.({ + event: SseResponseEventEnum.fastAnswer, + data: textAdaptGptResponse({ + text: answer + }) + }); + } + return { - answer: result.choices?.[0]?.message?.content || '', + answer, toolCalls: toolCalls }; } @@ -239,7 +270,7 @@ export const runToolWithToolChoice = async ( toolName: '', toolAvatar: '', params: '', - response: sliceStrStartEnd(stringToolResponse, 500, 500) + response: sliceStrStartEnd(stringToolResponse, 2000, 2000) } } }); diff --git a/packages/service/core/workflow/dispatch/chat/oneapi.ts b/packages/service/core/workflow/dispatch/chat/oneapi.ts index 763cb7f8217..5d2e06036d2 100644 --- a/packages/service/core/workflow/dispatch/chat/oneapi.ts +++ b/packages/service/core/workflow/dispatch/chat/oneapi.ts @@ -19,7 +19,7 @@ import { countMessagesTokens } from '../../../../common/string/tiktoken/index'; import { chats2GPTMessages, chatValue2RuntimePrompt, - getSystemPrompt, + getSystemPrompt_ChatItemType, GPTMessages2Chats, runtimePrompt2ChatsValue } from '@fastgpt/global/core/chat/adapt'; @@ -153,15 +153,16 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise { - if (res && stream) { + if (res && isStreamResponse) { // sse response const { answer } = await streamResponse({ res, @@ -195,6 +201,16 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise = { [FlowNodeTypeEnum.workflowStart]: dispatchWorkflowStart, @@ -91,6 +94,9 @@ const callbackMap: Record = { [FlowNodeTypeEnum.customFeedback]: dispatchCustomFeedback, [FlowNodeTypeEnum.readFiles]: dispatchReadFiles, [FlowNodeTypeEnum.userSelect]: dispatchUserSelect, + [FlowNodeTypeEnum.loop]: dispatchLoop, + [FlowNodeTypeEnum.loopStart]: dispatchLoopStart, + [FlowNodeTypeEnum.loopEnd]: dispatchLoopEnd, // none [FlowNodeTypeEnum.systemConfig]: dispatchSystemConfig, @@ -160,7 +166,7 @@ export async function dispatchWorkFlow(data: Props): Promise; + [NodeInputKeyEnum.childrenNodeIdList]: string[]; +}>; +type Response = DispatchNodeResultType<{ + [NodeOutputKeyEnum.loopArray]: Array; +}>; + +export const dispatchLoop = async (props: Props): Promise => { + const { + params, + runtimeNodes, + user, + node: { name } + } = props; + const { loopInputArray = [], childrenNodeIdList } = params; + + if (!Array.isArray(loopInputArray)) { + return Promise.reject('Input value is not an array'); + } + if (loopInputArray.length > 50) { + return Promise.reject('Input array length cannot be greater than 50'); + } + + const runNodes = runtimeNodes.filter((node) => childrenNodeIdList.includes(node.nodeId)); + + const outputValueArr = []; + const loopDetail: ChatHistoryItemResType[] = []; + let assistantResponses: AIChatItemValueItemType[] = []; + let totalPoints = 0; + + for await (const item of loopInputArray) { + const response = await dispatchWorkFlow({ + ...props, + runtimeNodes: runNodes.map((node) => + node.flowNodeType === FlowNodeTypeEnum.loopStart + ? { + ...node, + isEntry: true, + inputs: node.inputs.map((input) => + input.key === NodeInputKeyEnum.loopStartInput + ? { + ...input, + value: item + } + : input + ) + } + : { + ...node, + isEntry: false + } + ) + }); + + const loopOutputValue = response.flowResponses.find( + (res) => res.moduleType === FlowNodeTypeEnum.loopEnd + )?.loopOutputValue; + + outputValueArr.push(loopOutputValue); + loopDetail.push(...response.flowResponses); + assistantResponses.push(...response.assistantResponses); + + totalPoints = response.flowUsages.reduce((acc, usage) => acc + usage.totalPoints, 0); + } + + return { + [DispatchNodeResponseKeyEnum.assistantResponses]: assistantResponses, + [DispatchNodeResponseKeyEnum.nodeResponse]: { + totalPoints: totalPoints, + loopInput: loopInputArray, + loopResult: outputValueArr, + loopDetail: loopDetail + }, + [DispatchNodeResponseKeyEnum.nodeDispatchUsages]: [ + { + totalPoints: user.openaiAccount?.key ? 0 : totalPoints, + moduleName: name + } + ], + [NodeOutputKeyEnum.loopArray]: outputValueArr + }; +}; diff --git a/packages/service/core/workflow/dispatch/loop/runLoopEnd.ts b/packages/service/core/workflow/dispatch/loop/runLoopEnd.ts new file mode 100644 index 00000000000..9fda4337c75 --- /dev/null +++ b/packages/service/core/workflow/dispatch/loop/runLoopEnd.ts @@ -0,0 +1,21 @@ +import { NodeInputKeyEnum } from '@fastgpt/global/core/workflow/constants'; +import { DispatchNodeResponseKeyEnum } from '@fastgpt/global/core/workflow/runtime/constants'; +import { + DispatchNodeResultType, + ModuleDispatchProps +} from '@fastgpt/global/core/workflow/runtime/type'; + +type Props = ModuleDispatchProps<{ + [NodeInputKeyEnum.loopEndInput]: any; +}>; +type Response = DispatchNodeResultType<{}>; + +export const dispatchLoopEnd = async (props: Props): Promise => { + const { params } = props; + + return { + [DispatchNodeResponseKeyEnum.nodeResponse]: { + loopOutputValue: params.loopEndInput + } + }; +}; diff --git a/packages/service/core/workflow/dispatch/loop/runLoopStart.ts b/packages/service/core/workflow/dispatch/loop/runLoopStart.ts new file mode 100644 index 00000000000..c7c4cfb2409 --- /dev/null +++ b/packages/service/core/workflow/dispatch/loop/runLoopStart.ts @@ -0,0 +1,23 @@ +import { NodeInputKeyEnum, NodeOutputKeyEnum } from '@fastgpt/global/core/workflow/constants'; +import { DispatchNodeResponseKeyEnum } from '@fastgpt/global/core/workflow/runtime/constants'; +import { + DispatchNodeResultType, + ModuleDispatchProps +} from '@fastgpt/global/core/workflow/runtime/type'; + +type Props = ModuleDispatchProps<{ + [NodeInputKeyEnum.loopStartInput]: any; +}>; +type Response = DispatchNodeResultType<{ + [NodeOutputKeyEnum.loopStartInput]: any; +}>; + +export const dispatchLoopStart = async (props: Props): Promise => { + const { params } = props; + return { + [DispatchNodeResponseKeyEnum.nodeResponse]: { + loopInputValue: params.loopStartInput + }, + [NodeOutputKeyEnum.loopStartInput]: params.loopStartInput + }; +}; diff --git a/packages/service/core/workflow/dispatch/plugin/runApp.ts b/packages/service/core/workflow/dispatch/plugin/runApp.ts index b7ba0bafa77..31feb75b4e2 100644 --- a/packages/service/core/workflow/dispatch/plugin/runApp.ts +++ b/packages/service/core/workflow/dispatch/plugin/runApp.ts @@ -107,6 +107,7 @@ export const dispatchRunAppNode = async (props: Props): Promise => { const { text } = chatValue2RuntimePrompt(assistantResponses); return { + assistantResponses, [DispatchNodeResponseKeyEnum.runTimes]: runTimes, [DispatchNodeResponseKeyEnum.nodeResponse]: { moduleLogo: appData.avatar, diff --git a/packages/service/core/workflow/dispatch/tools/answer.ts b/packages/service/core/workflow/dispatch/tools/answer.ts index f11420cbb65..c8fc09ecd44 100644 --- a/packages/service/core/workflow/dispatch/tools/answer.ts +++ b/packages/service/core/workflow/dispatch/tools/answer.ts @@ -20,7 +20,7 @@ export const dispatchAnswer = (props: Record): AnswerResponse => { } = props as AnswerProps; const formatText = typeof text === 'string' ? text : JSON.stringify(text, null, 2); - const responseText = `\n${formatText}`; + const responseText = `\n${formatText}`.replaceAll('\\n', '\n'); workflowStreamResponse?.({ event: SseResponseEventEnum.fastAnswer, diff --git a/packages/web/components/common/EmptyTip/index.tsx b/packages/web/components/common/EmptyTip/index.tsx index 80b06955826..e8f450281b0 100644 --- a/packages/web/components/common/EmptyTip/index.tsx +++ b/packages/web/components/common/EmptyTip/index.tsx @@ -5,13 +5,14 @@ import { useTranslation } from 'next-i18next'; type Props = FlexProps & { text?: string | React.ReactNode; + iconSize?: string | number; }; -const EmptyTip = ({ text, ...props }: Props) => { +const EmptyTip = ({ text, iconSize = '48px', ...props }: Props) => { const { t } = useTranslation(); return ( - + {text || t('common:common.empty.Common Tip')} diff --git a/packages/web/components/common/Icon/constants.ts b/packages/web/components/common/Icon/constants.ts index d3ee88a17f5..00fd25f5a93 100644 --- a/packages/web/components/common/Icon/constants.ts +++ b/packages/web/components/common/Icon/constants.ts @@ -177,6 +177,7 @@ export const iconPaths = { 'core/workflow/debugResult': () => import('./icons/core/workflow/debugResult.svg'), 'core/workflow/edgeArrow': () => import('./icons/core/workflow/edgeArrow.svg'), 'core/workflow/grout': () => import('./icons/core/workflow/grout.svg'), + 'core/workflow/inputType/array': () => import('./icons/core/workflow/inputType/array.svg'), 'core/workflow/inputType/customVariable': () => import('./icons/core/workflow/inputType/customVariable.svg'), 'core/workflow/inputType/dynamic': () => import('./icons/core/workflow/inputType/dynamic.svg'), @@ -226,6 +227,9 @@ export const iconPaths = { 'core/workflow/template/ifelse': () => import('./icons/core/workflow/template/ifelse.svg'), 'core/workflow/template/lafDispatch': () => import('./icons/core/workflow/template/lafDispatch.svg'), + 'core/workflow/template/loop': () => import('./icons/core/workflow/template/loop.svg'), + 'core/workflow/template/loopEnd': () => import('./icons/core/workflow/template/loopEnd.svg'), + 'core/workflow/template/loopStart': () => import('./icons/core/workflow/template/loopStart.svg'), 'core/workflow/template/mathCall': () => import('./icons/core/workflow/template/mathCall.svg'), 'core/workflow/template/pluginOutput': () => import('./icons/core/workflow/template/pluginOutput.svg'), diff --git a/packages/web/components/common/Icon/icons/core/workflow/inputType/array.svg b/packages/web/components/common/Icon/icons/core/workflow/inputType/array.svg new file mode 100644 index 00000000000..9e3bf1b2df7 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/inputType/array.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/loop.svg b/packages/web/components/common/Icon/icons/core/workflow/template/loop.svg new file mode 100644 index 00000000000..548dba9a7b6 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/loop.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/loopEnd.svg b/packages/web/components/common/Icon/icons/core/workflow/template/loopEnd.svg new file mode 100644 index 00000000000..ca8fc3c9145 --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/loopEnd.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/web/components/common/Icon/icons/core/workflow/template/loopStart.svg b/packages/web/components/common/Icon/icons/core/workflow/template/loopStart.svg new file mode 100644 index 00000000000..546a3ecd5df --- /dev/null +++ b/packages/web/components/common/Icon/icons/core/workflow/template/loopStart.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/web/components/common/MySelect/MultipleRowSelect.tsx b/packages/web/components/common/MySelect/MultipleRowSelect.tsx index c3efd53ba93..73f630bf016 100644 --- a/packages/web/components/common/MySelect/MultipleRowSelect.tsx +++ b/packages/web/components/common/MySelect/MultipleRowSelect.tsx @@ -13,6 +13,7 @@ const MultipleRowSelect = ({ emptyTip, maxH = 300, onSelect, + popDirection = 'bottom', styles }: MultipleSelectProps) => { const { t } = useTranslation(); @@ -124,7 +125,13 @@ const MultipleRowSelect = ({ {isOpen && ( = { maxH?: number; onSelect: (val: any[]) => void; styles?: ButtonProps; + popDirection?: 'top' | 'bottom'; }; diff --git a/packages/web/components/common/Textarea/PromptEditor/plugins/VariablePickerPlugin/index.tsx b/packages/web/components/common/Textarea/PromptEditor/plugins/VariablePickerPlugin/index.tsx index 03158b4fd63..45632b03edc 100644 --- a/packages/web/components/common/Textarea/PromptEditor/plugins/VariablePickerPlugin/index.tsx +++ b/packages/web/components/common/Textarea/PromptEditor/plugins/VariablePickerPlugin/index.tsx @@ -101,7 +101,7 @@ export default function VariablePickerPlugin({ {item.key} - {item.key !== item.label && `(${item.label})`} + {item.key !== item.label && `(${t(item.label as any)})`} ))} diff --git a/packages/web/i18n/en/common.json b/packages/web/i18n/en/common.json index e73c180d774..9d4004e0699 100644 --- a/packages/web/i18n/en/common.json +++ b/packages/web/i18n/en/common.json @@ -81,7 +81,7 @@ "un_auth": "Unauthorized to Operate This Plugin" }, "system_error": { - "community_version_num_limit": "Exceeded Open Source Version Limit, Please Upgrade to Commercial Version: https://fastgpt.in" + "community_version_num_limit": "Exceeded Open Source Version Limit, Please Upgrade to Commercial Version: https://tryfastgpt.ai" }, "team_error": { "ai_points_not_enough": "Insufficient AI Points", @@ -272,7 +272,7 @@ "submitted": "Submitted", "support": "Support", "system": { - "Commercial version function": "Please Upgrade to the Commercial Version to Use This Feature: https://fastgpt.in", + "Commercial version function": "Please Upgrade to the Commercial Version to Use This Feature: https://tryfastgpt.ai", "Help Chatbot": "Help Chatbot", "Use Helper": "Use Helper" }, @@ -552,7 +552,11 @@ "search using reRank": "Result Re-Rank", "text output": "Text Output", "update_var_result": "Variable Update Result (Displays Multiple Variable Update Results in Order)", - "user_select_result": "User Selection Result" + "user_select_result": "User Selection Result", + "loop_input": "Loop Input Array", + "loop_output": "Loop Output Array", + "loop_input_element": "Loop Input Element", + "loop_output_element": "Loop Output Element" }, "retry": "Regenerate", "tts": { diff --git a/packages/web/i18n/en/workflow.json b/packages/web/i18n/en/workflow.json index c3c166f8e23..5fee7a5485e 100644 --- a/packages/web/i18n/en/workflow.json +++ b/packages/web/i18n/en/workflow.json @@ -1,10 +1,12 @@ { + "Array_element": "Array element", "Code": "Code", "about_xxx_question": "Question regarding xxx", "add_new_input": "Add New Input", "append_application_reply_to_history_as_new_context": "Append the application's reply to the history as new context", "application_call": "Application Call", "assigned_reply": "Assigned Reply", + "can_not_loop": "This node can't loop.", "choose_another_application_to_call": "Select another application to call", "classification_result": "Classification Result", "code": { @@ -88,6 +90,8 @@ "length_not_equal_to": "Length Not Equal To", "less_than": "Less Than", "less_than_or_equal_to": "Less Than or Equal To", + "loop": "Batch execution", + "loop_start_tip": "Not input array", "max_dialog_rounds": "Maximum Number of Dialog Rounds", "max_tokens": "Maximum Tokens", "mouse_priority": "Mouse first", diff --git a/packages/web/i18n/zh/common.json b/packages/web/i18n/zh/common.json index e7d2ced721f..5e643e43e89 100644 --- a/packages/web/i18n/zh/common.json +++ b/packages/web/i18n/zh/common.json @@ -85,7 +85,7 @@ "un_auth": "无权操作该插件" }, "system_error": { - "community_version_num_limit": "超出开源版数量限制,请升级商业版: https://fastgpt.in" + "community_version_num_limit": "超出开源版数量限制,请升级商业版: https://tryfastgpt.ai" }, "team_error": { "ai_points_not_enough": "", @@ -276,7 +276,7 @@ "submitted": "已提交", "support": "支持", "system": { - "Commercial version function": "请升级商业版后使用该功能:https://fastgpt.in", + "Commercial version function": "请升级商业版后使用该功能:https://tryfastgpt.ai", "Help Chatbot": "机器人助手", "Use Helper": "使用帮助" }, @@ -552,7 +552,11 @@ "search using reRank": "结果重排", "text output": "文本输出", "update_var_result": "变量更新结果(按顺序展示多个变量更新结果)", - "user_select_result": "用户选择结果" + "user_select_result": "用户选择结果", + "loop_input": "输入数组", + "loop_output": "输出数组", + "loop_input_element": "输入数组元素", + "loop_output_element": "输出数组元素" }, "retry": "重新生成", "tts": { diff --git a/packages/web/i18n/zh/workflow.json b/packages/web/i18n/zh/workflow.json index f67c152c2ac..ff7f27578de 100644 --- a/packages/web/i18n/zh/workflow.json +++ b/packages/web/i18n/zh/workflow.json @@ -1,10 +1,12 @@ { + "Array_element": "数组元素", "Code": "代码", "about_xxx_question": "关于 xxx 的问题", "add_new_input": "新增输入", "append_application_reply_to_history_as_new_context": "将该应用回复内容拼接到历史记录中,作为新的上下文返回", "application_call": "应用调用", "assigned_reply": "指定回复", + "can_not_loop": "该节点不支持循环嵌套", "choose_another_application_to_call": "选择一个其他应用进行调用", "classification_result": "分类结果", "code": { @@ -66,6 +68,7 @@ "intro_http_request": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)", "intro_knowledge_base_search_merge": "可以将多个知识库搜索结果进行合并输出。使用 RRF 的合并方式进行最终排序输出。", "intro_laf_function_call": "可以调用Laf账号下的云函数。", + "intro_loop": "可以输入一个数组,数组内元素将独立执行循环体,并将所有结果作为数组输出。", "intro_plugin_input": "可以配置插件需要哪些输入,利用这些输入来运行插件", "intro_question_classification": "根据用户的历史记录和当前问题判断该次提问的类型。可以添加多组问题类型,下面是一个模板例子:\n类型1: 打招呼\n类型2: 关于商品“使用”问题\n类型3: 关于商品“购买”问题\n类型4: 其他问题", "intro_question_optimization": "使用问题优化功能,可以提高知识库连续对话时搜索的精度。使用该功能后,会先利用 AI 根据上下文构建一个或多个新的检索词,这些检索词更利于进行知识库搜索。该模块已内置在知识库搜索模块中,如果您仅进行一次知识库搜索,可直接使用知识库内置的补全功能。", @@ -88,6 +91,13 @@ "length_not_equal_to": "长度不等于", "less_than": "小于", "less_than_or_equal_to": "小于等于", + "loop": "循环运行(测试)", + "loop_body": "循环体", + "loop_end": "循环体结束", + "loop_input_array": "数组", + "loop_result": "数组执行结果", + "loop_start": "循环体开始", + "loop_start_tip": "未输入数组", "max_dialog_rounds": "最多携带多少轮对话记录", "max_tokens": "最大 Tokens", "mouse_priority": "鼠标优先", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 69cd7d90f58..8fc0382d1af 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,7 +22,7 @@ importers: version: 13.3.0 next-i18next: specifier: 15.3.0 - version: 15.3.0(i18next@23.11.5)(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) + version: 15.3.0(i18next@23.11.5)(next@14.2.5(@babel/core@7.24.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) prettier: specifier: 3.2.4 version: 3.2.4 @@ -63,8 +63,8 @@ importers: specifier: 14.2.5 version: 14.2.5(@babel/core@7.24.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8) openai: - specifier: 4.57.0 - version: 4.57.0(encoding@0.1.13) + specifier: 4.61.0 + version: 4.61.0(encoding@0.1.13) openapi-types: specifier: ^12.1.3 version: 12.1.3 @@ -250,7 +250,7 @@ importers: version: 2.1.1(@chakra-ui/system@2.6.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(react@18.3.1))(react@18.3.1) '@chakra-ui/next-js': specifier: 2.1.5 - version: 2.1.5(@chakra-ui/react@2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1) + version: 2.1.5(@chakra-ui/react@2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(next@14.2.5(@babel/core@7.24.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1) '@chakra-ui/react': specifier: 2.8.1 version: 2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -313,7 +313,7 @@ importers: version: 4.17.21 next-i18next: specifier: 15.3.0 - version: 15.3.0(i18next@23.11.5)(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) + version: 15.3.0(i18next@23.11.5)(next@14.2.5(@babel/core@7.24.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) papaparse: specifier: ^5.4.1 version: 5.4.1 @@ -374,7 +374,7 @@ importers: version: 2.1.1(@chakra-ui/system@2.6.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(react@18.3.1))(react@18.3.1) '@chakra-ui/next-js': specifier: 2.1.5 - version: 2.1.5(@chakra-ui/react@2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1) + version: 2.1.5(@chakra-ui/react@2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(next@14.2.5(@babel/core@7.24.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1) '@chakra-ui/react': specifier: 2.8.1 version: 2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -470,7 +470,7 @@ importers: version: 14.2.5(@babel/core@7.24.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8) next-i18next: specifier: 15.3.0 - version: 15.3.0(i18next@23.11.5)(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) + version: 15.3.0(i18next@23.11.5)(next@14.2.5(@babel/core@7.24.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) nextjs-node-loader: specifier: ^1.1.5 version: 1.1.5(webpack@5.92.1) @@ -6992,8 +6992,8 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} - openai@4.57.0: - resolution: {integrity: sha512-JnwBSIYqiZ3jYjB5f2in8hQ0PRA092c6m+/6dYB0MzK0BEbn+0dioxZsPLBm5idJbg9xzLNOiGVm2OSuhZ+BdQ==} + openai@4.61.0: + resolution: {integrity: sha512-xkygRBRLIUumxzKGb1ug05pWmJROQsHkGuj/N6Jiw2dj0dI19JvbFpErSZKmJ/DA+0IvpcugZqCAyk8iLpyM6Q==} hasBin: true peerDependencies: zod: ^3.23.8 @@ -10087,7 +10087,7 @@ snapshots: transitivePeerDependencies: - '@types/react' - '@chakra-ui/next-js@2.1.5(@chakra-ui/react@2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1)': + '@chakra-ui/next-js@2.1.5(@chakra-ui/react@2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(next@14.2.5(@babel/core@7.24.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1)': dependencies: '@chakra-ui/react': 2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@emotion/cache': 11.11.0 @@ -16690,7 +16690,7 @@ snapshots: neo-async@2.6.2: {} - next-i18next@15.3.0(i18next@23.11.5)(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1): + next-i18next@15.3.0(i18next@23.11.5)(next@14.2.5(@babel/core@7.24.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.24.8 '@types/hoist-non-react-statics': 3.3.5 @@ -16887,7 +16887,7 @@ snapshots: dependencies: mimic-fn: 4.0.0 - openai@4.57.0(encoding@0.1.13): + openai@4.61.0(encoding@0.1.13): dependencies: '@types/node': 18.19.40 '@types/node-fetch': 2.6.11 diff --git a/projects/app/data/config.json b/projects/app/data/config.json index fcba250ebb8..dbe489918d4 100644 --- a/projects/app/data/config.json +++ b/projects/app/data/config.json @@ -54,6 +54,60 @@ "customExtractPrompt": "", "defaultSystemChatPrompt": "", "defaultConfig": {} + }, + { + "model": "o1-mini", + "name": "o1-mini", + "avatar": "/imgs/model/openai.svg", + "maxContext": 125000, + "maxResponse": 4000, + "quoteMaxToken": 120000, + "maxTemperature": 1.2, + "charsPointsPrice": 0, + "censor": false, + "vision": false, + "datasetProcess": false, + "usedInClassify": true, + "usedInExtractFields": true, + "usedInToolCall": true, + "usedInQueryExtension": true, + "toolChoice": false, + "functionCall": false, + "customCQPrompt": "", + "customExtractPrompt": "", + "defaultSystemChatPrompt": "", + "defaultConfig": { + "temperature": 1, + "max_tokens": null, + "stream": false + } + }, + { + "model": "o1-preview", + "name": "o1-preview", + "avatar": "/imgs/model/openai.svg", + "maxContext": 125000, + "maxResponse": 4000, + "quoteMaxToken": 120000, + "maxTemperature": 1.2, + "charsPointsPrice": 0, + "censor": false, + "vision": false, + "datasetProcess": false, + "usedInClassify": true, + "usedInExtractFields": true, + "usedInToolCall": true, + "usedInQueryExtension": true, + "toolChoice": false, + "functionCall": false, + "customCQPrompt": "", + "customExtractPrompt": "", + "defaultSystemChatPrompt": "", + "defaultConfig": { + "temperature": 1, + "max_tokens": null, + "stream": false + } } ], "vectorModels": [ diff --git a/projects/app/public/docs/chatProblem.md b/projects/app/public/docs/chatProblem.md index 6c2f304e6a3..6484d4a5e1d 100644 --- a/projects/app/public/docs/chatProblem.md +++ b/projects/app/public/docs/chatProblem.md @@ -1,12 +1,12 @@ ### 常见问题 - [**Git 地址**,点击查看项目地址](https://github.com/labring/FastGPT) -- [本地部署 FastGPT](https://doc.fastgpt.in/docs/installation) -- [API 文档](https://doc.fastgpt.in/docs/development/openapi?pre_pathname=%2Fdrive%2Fhome%2F) +- [本地部署 FastGPT](https://doc.tryfastgpt.ai/docs/installation) +- [API 文档](https://doc.tryfastgpt.ai/docs/development/openapi?pre_pathname=%2Fdrive%2Fhome%2F) - **反馈问卷**: 如果你遇到任何使用问题或有期望的功能,可以[填写该问卷](https://www.wjx.cn/vm/rLIw1uD.aspx#) - **问题文档**: [先看文档,再提问](https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh) -- [点击查看商业版文档](https://doc.fastgpt.in/docs/commercial) -- [计费规则](https://doc.fastgpt.in/docs/pricing/) +- [点击查看商业版文档](https://doc.tryfastgpt.ai/docs/commercial) +- [计费规则](https://doc.tryfastgpt.ai/docs/pricing/) **其他问题** | 扫码进入交流群 | diff --git a/projects/app/public/openapi/index.html b/projects/app/public/openapi/index.html index 8c6775faed5..345a53b0a8d 100644 --- a/projects/app/public/openapi/index.html +++ b/projects/app/public/openapi/index.html @@ -45,11 +45,12 @@ .hbTOAm:before{content:'';width:15px;height:15px;background-size:contain;background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbDkwLjUtOTAuNWMyNS0yNSAyNS02NS42IDAtOTAuNSAtMjQuOS0yNS02NS41LTI1LTkwLjUgMGwtMzIuMiAzMi4yYy0yNi4xLTEwLjItNTQuMi0xMi45LTgxLjYtOC45bDY4LjYtNjguNmM1MC01MCAxMzEtNTAgMTgxIDBDNTA5LjYgMTAyLjMgNTA5LjYgMTgzLjQgNDU5LjcgMjMzLjR6TTIyMC4zIDM4Mi4ybC0zMi4yIDMyLjJjLTI1IDI0LjktNjUuNiAyNC45LTkwLjUgMCAtMjUtMjUtMjUtNjUuNiAwLTkwLjVsOTAuNS05MC41YzI1LTI1IDY1LjUtMjUgOTAuNSAwIDcuOCA3LjggMTIuOSAxNy4yIDE1LjggMjcuMSAyLjQtMS40IDQuOC0yLjUgNi44LTQuNWw0Mi4xLTQyYy01LjQtOS4yLTExLjYtMTgtMTkuNC0yNS44IC01MC01MC0xMzEtNTAtMTgxIDBsLTkwLjUgOTAuNWMtNTAgNTAtNTAgMTMxIDAgMTgxIDUwIDUwIDEzMSA1MCAxODEgMGw2OC42LTY4LjZDMjc0LjYgMzk1LjEgMjQ2LjQgMzkyLjMgMjIwLjMgMzgyLjJ6Ii8+PC9zdmc+Cg==');opacity:0.5;visibility:hidden;display:inline-block;vertical-align:middle;}/*!sc*/ h1:hover>.hbTOAm::before,h2:hover>.hbTOAm::before,.hbTOAm:hover::before{visibility:visible;}/*!sc*/ data-styled.g14[id="sc-jwIPbr"]{content:"hbTOAm,"}/*!sc*/ +.bEpxpV{height:1.3em;width:1.3em;min-width:1.3em;vertical-align:middle;transition:transform 0.2s ease-out;transform:rotateZ(-90deg);}/*!sc*/ .hmCwJW{height:1.5em;width:1.5em;min-width:1.5em;vertical-align:middle;float:left;transition:transform 0.2s ease-out;transform:rotateZ(-90deg);}/*!sc*/ .hmCwJW polygon{fill:#1d8127;}/*!sc*/ .fmmJjS{height:20px;width:20px;min-width:20px;vertical-align:middle;float:right;transition:transform 0.2s ease-out;transform:rotateZ(0);}/*!sc*/ .fmmJjS polygon{fill:white;}/*!sc*/ -data-styled.g15[id="sc-cHqXqK"]{content:"hmCwJW,fmmJjS,"}/*!sc*/ +data-styled.g15[id="sc-cHqXqK"]{content:"bEpxpV,hmCwJW,fmmJjS,"}/*!sc*/ .iyKqKI{border-left:1px solid #7c7cbb;box-sizing:border-box;position:relative;padding:10px 10px 10px 0;}/*!sc*/ @media screen and (max-width: 50rem){.iyKqKI{display:block;overflow:hidden;}}/*!sc*/ tr:first-of-type>.iyKqKI,tr.last>.iyKqKI{border-left-width:0;background-position:top left;background-repeat:no-repeat;background-size:1px 100%;}/*!sc*/ @@ -217,6 +218,29 @@ data-styled.g60[id="sc-gQkENW"]{content:"bIEFFi,"}/*!sc*/ .feFoaC{color:#d41f1c;font-size:0.9em;font-weight:normal;margin-left:20px;line-height:1;}/*!sc*/ data-styled.g62[id="sc-hGZxvd"]{content:"feFoaC,"}/*!sc*/ +.dIXVzO:after{content:' and ';font-weight:normal;}/*!sc*/ +.dIXVzO:last-child:after{content:none;}/*!sc*/ +.dIXVzO a{text-decoration:auto;color:#32329f;}/*!sc*/ +.dIXVzO a:visited{color:#32329f;}/*!sc*/ +.dIXVzO a:hover{color:#6868cf;text-decoration:auto;}/*!sc*/ +data-styled.g80[id="sc-bqvdXA"]{content:"dIXVzO,"}/*!sc*/ +.eqXCjK{white-space:nowrap;}/*!sc*/ +.eqXCjK:after{content:' or ';white-space:pre;}/*!sc*/ +.eqXCjK:last-child:after,.eqXCjK:only-child:after{content:none;}/*!sc*/ +.eqXCjK a{text-decoration:auto;color:#32329f;}/*!sc*/ +.eqXCjK a:visited{color:#32329f;}/*!sc*/ +.eqXCjK a:hover{color:#6868cf;text-decoration:auto;}/*!sc*/ +data-styled.g81[id="sc-irPVuy"]{content:"eqXCjK,"}/*!sc*/ +.jXOga-d{flex:1 1 auto;cursor:pointer;}/*!sc*/ +data-styled.g82[id="sc-jWJSSj"]{content:"jXOga-d,"}/*!sc*/ +.gQOXJB{width:75%;text-overflow:ellipsis;border-radius:4px;overflow:hidden;}/*!sc*/ +@media screen and (max-width: 50rem){.gQOXJB{margin-top:10px;}}/*!sc*/ +data-styled.g83[id="sc-iCjFWQ"]{content:"gQOXJB,"}/*!sc*/ +.ffSXYc{display:inline-block;margin:0;}/*!sc*/ +data-styled.g84[id="sc-khdDuB"]{content:"ffSXYc,"}/*!sc*/ +.dyzdIR{width:100%;display:flex;margin:1em 0;flex-direction:row;}/*!sc*/ +@media screen and (max-width: 50rem){.dyzdIR{flex-direction:column;}}/*!sc*/ +data-styled.g85[id="sc-hGNhLO"]{content:"dyzdIR,"}/*!sc*/ .dZsYqS{margin-top:0;margin-bottom:0.5em;}/*!sc*/ data-styled.g91[id="sc-geoRQH"]{content:"dZsYqS,"}/*!sc*/ .enkzRg{border:1px solid #32329f;color:#32329f;font-weight:normal;margin-left:0.5em;padding:4px 8px 4px;display:inline-block;text-decoration:none;cursor:pointer;}/*!sc*/ @@ -314,7 +338,7 @@
get/core/app/version/detail

FastGPT OpenAPI (1.0.0)

Download OpenAPI specification:Download

/common/file/previewContent

Responses

Response samples

Content type
application/json
{ }

/common/file/read

Responses

Response samples

Content type
application/json
{ }

/common/file/upload

Responses

Response samples

Content type
application/json
{ }

/common/file/uploadImage

Responses

Response samples

Content type
application/json
{ }

/common/system/getInitData

Responses

Response samples

Content type
application/json
{ }

/common/system/unlockTask

Responses

Response samples

Content type
application/json
{ }

/common/tools/urlFetch

Responses

Response samples

Content type
application/json
{ }

/core/ai/agent/createQuestionGuide

Responses

Response samples

Content type
application/json
{ }

/core/ai/token

Responses

Response samples

Content type
application/json
{ }

/core/app/copy

Responses

Response samples

Content type
application/json
{
  • "string": null
}

/core/app/create

Responses

Response samples

Content type
application/json
{ }

/core/app/del

Responses

Response samples

Content type
application/json
{ }

获取我的模型

FastGPT OpenAPI (1.0.0)

Download OpenAPI specification:Download

/common/file/previewContent

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/common/file/read

Responses

Response samples

Content type
application/json
{ }

/common/file/upload

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/common/file/uploadImage

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/common/system/getInitData

Responses

Response samples

Content type
application/json
{ }

/common/system/unlockTask

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/common/tools/urlFetch

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/ai/agent/createQuestionGuide

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/ai/token

Responses

Response samples

Content type
application/json
{ }

/core/app/copy

Authorizations:
token

Responses

Response samples

Content type
application/json
{
  • "string": null
}

/core/app/create

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/del

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

获取我的模型

获取我的模型

-

Responses

Response samples

Content type
application/json
{ }

/core/app/folder/create

Responses

Response samples

Content type
application/json
{ }

/core/app/folder/path

Responses

Response samples

Content type
application/json
{ }

/core/app/getChatLogs

Responses

Response samples

Content type
application/json
{ }

/core/app/httpPlugin/create

Responses

Response samples

Content type
application/json
{ }

/core/app/httpPlugin/getApiSchemaByUrl

Responses

Response samples

Content type
application/json
{ }

/core/app/httpPlugin/update

Responses

Response samples

Content type
application/json
{ }

/core/app/list

Responses

Response samples

Content type
application/json
{ }

/core/app/plugin/getPreviewNode

query Parameters
appId
required
string

Responses

Response samples

Content type
application/json
{ }

/core/app/plugin/getSystemPluginTemplates

Responses

Response samples

Content type
application/json
{ }

/core/app/plugin/path

query Parameters
parentId
required
ParentIdType

Responses

Response samples

Content type
application/json
null

resume the app's inherit permission.

Response samples

Content type
application/json
{ }

/core/app/folder/create

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/folder/path

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/getChatLogs

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/httpPlugin/create

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/httpPlugin/getApiSchemaByUrl

Responses

Response samples

Content type
application/json
{ }

/core/app/httpPlugin/update

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/list

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/plugin/getPreviewNode

Authorizations:
token
query Parameters
appId
required
string

Responses

Response samples

Content type
application/json
{ }

/core/app/plugin/getSystemPluginTemplates

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/plugin/path

query Parameters
parentId
required
ParentIdType

Responses

Response samples

Content type
application/json
null

resume the app's inherit permission.

resume the app's inherit permission.

-
query Parameters
appId
required
string

Responses

Response samples

Content type
application/json
{ }

/core/app/template/detail

Responses

Response samples

Content type
application/json
{ }

/core/app/template/list

Responses

Response samples

Content type
application/json
{ }

/core/app/transitionWorkflow

Responses

Response samples

Content type
application/json
{
  • "string": null
}

修改默认权限 +

Response samples

Content type
application/json
{ }

/core/app/template/detail

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/template/list

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/transitionWorkflow

Authorizations:
token

Responses

Response samples

Content type
application/json
{
  • "string": null
}

修改默认权限 1. 继承态目录:关闭继承态,修改权限,同步子目录默认权限 2. 继承态资源:

Responses

Response samples

Content type
application/json
{ }

/core/app/version/detail

Responses

Response samples

Content type
application/json
{ }

/core/app/version/latest

query Parameters
appId
required
string

Responses

Response samples

Content type
application/json
{
  • "StoreNodeItemType[]": null,
  • "StoreEdgeItemType[]": null,
  • "AppChatConfigType": null
}

/core/app/version/list

Responses

Response samples

Content type
application/json
{ }

/core/app/version/listWorkflowx

Responses

Response samples

Content type
application/json
{
  • "string": null,
  • "Date": null,
  • "boolean | TSUndefinedKeyword": null
}

/core/app/version/publish

Responses

Response samples

Content type
application/json
{ }

/core/app/version/revert

Responses

Response samples

Content type
application/json
{ }

/core/app/version/update

Responses

Response samples

Content type
application/json
{ }

/core/chat/chatTest

Responses

Response samples

Content type
application/json
{ }

clear chat history

Response samples

Content type
application/json
{ }

/core/app/version/detail

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/version/list

Responses

Response samples

Content type
application/json
{ }

/core/app/version/listWorkflowx

Responses

Response samples

Content type
application/json
{
  • "string": null,
  • "Date": null,
  • "boolean | TSUndefinedKeyword": null
}

/core/app/version/publish

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/version/revert

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/app/version/update

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/chat/chatTest

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

clear chat history

clear chat history

-

Responses

Response samples

Content type
application/json
{ }

clear chat history

Response samples

Content type
application/json
{ }

clear chat history

clear chat history

-

Responses

Response samples

Content type
application/json
{ }

/core/chat/feedback/closeCustom

Responses

Response samples

Content type
application/json
{ }

/core/chat/feedback/updateUserFeedback

Responses

Response samples

Content type
application/json
{ }

/core/chat/getHistories

Responses

Response samples

Content type
application/json
{ }

/core/chat/getResData

query Parameters
OutLinkChatAuthProps & TSTypeLiteral

Responses

Response samples

Content type
application/json
null

/core/chat/init

Responses

Response samples

Content type
application/json
{ }

/core/chat/inputGuide/countTotal

query Parameters
appId
required
string

Responses

Response samples

Content type
application/json
{
  • "number": null
}

/core/chat/inputGuide/create

Responses

Response samples

Content type
application/json
{
  • "number": null
}

/core/chat/inputGuide/delete

Responses

Response samples

Content type
application/json
{ }

/core/chat/inputGuide/deleteAll

Responses

Response samples

Content type
application/json
{ }

/core/chat/inputGuide/list

Responses

Response samples

Content type
application/json
null

/core/chat/inputGuide/query

Responses

Response samples

Content type
application/json
null

/core/chat/inputGuide/update

Responses

Response samples

Content type
application/json
{ }

/core/chat/item/delete

Responses

Response samples

Content type
application/json
{ }

/core/chat/item/getSpeech

Responses

Response samples

Content type
application/json
{ }

/core/chat/outLink/init

Responses

Response samples

Content type
application/json
{ }

/core/chat/team/init

Responses

Response samples

Content type
application/json
{ }

update chat top, custom title

Response samples

Content type
application/json
{ }

/core/chat/feedback/closeCustom

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/chat/feedback/updateUserFeedback

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/chat/getHistories

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/chat/getResData

Authorizations:
token
query Parameters
OutLinkChatAuthProps & TSTypeLiteral

Responses

Response samples

Content type
application/json
null

/core/chat/init

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/chat/inputGuide/countTotal

Authorizations:
token
query Parameters
appId
required
string

Responses

Response samples

Content type
application/json
{
  • "number": null
}

/core/chat/inputGuide/create

Authorizations:
token

Responses

Response samples

Content type
application/json
{
  • "number": null
}

/core/chat/inputGuide/delete

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/chat/inputGuide/deleteAll

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/chat/inputGuide/list

Authorizations:
token

Responses

Response samples

Content type
application/json
null

/core/chat/inputGuide/query

Authorizations:
token

Responses

Response samples

Content type
application/json
null

/core/chat/inputGuide/update

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/chat/item/delete

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/chat/item/getSpeech

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/chat/outLink/init

Responses

Response samples

Content type
application/json
{ }

/core/chat/team/init

Responses

Response samples

Content type
application/json
{ }

update chat top, custom title

update chat top, custom title

-

Responses

Response samples

Content type
application/json
{ }

get all dataset by teamId or tmbId

Response samples

Content type
application/json
{ }

get all dataset by teamId or tmbId

get all dataset by teamId or tmbId

-

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/create/csvTable

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/create/fileId

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/create/link

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/create/localFile

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/create/text

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/create

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/delete

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/detail

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/list

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/paths

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/read

query Parameters
collectionId
required
string

Responses

Response samples

Content type
application/json
{
  • "url": null,
  • "string": null
}

/core/dataset/collection/scrollList

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/sync/link

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/update

Responses

Response samples

Content type
application/json
{ }

/core/dataset/create

Responses

Response samples

Content type
application/json
"string"

/core/dataset/data/delete

Responses

Response samples

Content type
application/json
{ }

/core/dataset/data/detail

Responses

Response samples

Content type
application/json
{
  • "string": null
}

/core/dataset/data/insertData

Responses

Response samples

Content type
application/json
{ }

/core/dataset/data/list

Responses

Response samples

Content type
application/json
{ }

/core/dataset/data/pushData

Responses

Response samples

Content type
application/json
{ }

/core/dataset/data/update

Responses

Response samples

Content type
application/json
{ }

/core/dataset/delete

Responses

Response samples

Content type
application/json
{ }

/core/dataset/detail

Responses

Response samples

Content type
application/json
{ }

/core/dataset/exportAll

Responses

Response samples

Content type
application/json
{ }

/core/dataset/file/getPreviewChunks

Responses

Response samples

Content type
application/json
null

/core/dataset/folder/create

Responses

Response samples

Content type
application/json
{ }

/core/dataset/list

Responses

Response samples

Content type
application/json
{ }

/core/dataset/paths

Responses

Response samples

Content type
application/json
{ }

resume the dataset's inherit permission.

Response samples

Content type
application/json
{ }

/core/dataset/collection/create/csvTable

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/create/fileId

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/create/link

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/create/localFile

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/create/text

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/create

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/delete

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/detail

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/list

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/paths

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/read

Authorizations:
apiKey
query Parameters
collectionId
required
string

Responses

Response samples

Content type
application/json
{
  • "url": null,
  • "string": null
}

/core/dataset/collection/scrollList

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/sync/link

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/dataset/collection/update

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/create

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
"string"

/core/dataset/data/delete

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/data/detail

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{
  • "string": null
}

/core/dataset/data/insertData

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/data/list

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/data/pushData

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/data/update

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/delete

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/detail

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/exportAll

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/dataset/file/getPreviewChunks

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
null

/core/dataset/folder/create

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/dataset/list

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/paths

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

resume the dataset's inherit permission.

resume the dataset's inherit permission.

-
query Parameters
datasetId
required
string

Responses

Response samples

Content type
application/json
{ }

/core/dataset/searchTest

Responses

Response samples

Content type
application/json
{ }

/core/dataset/training/getDatasetTrainingQueue

Responses

Response samples

Content type
application/json
{
  • "number": null
}

/core/dataset/training/getQueueLen

Responses

Response samples

Content type
application/json
{ }

/core/dataset/training/rebuildEmbedding

Responses

Response samples

Content type
application/json
{ }

/core/dataset/update

Responses

Response samples

Content type
application/json
null

/core/workflow/debug

Responses

Response samples

Content type
application/json
{ }

/lafApi/[...path]

Responses

Response samples

Content type
application/json
{ }

/plugins/TFSwitch/index

Responses

Response samples

Content type
application/json
{ }

/plugins/customFeedback/index

Responses

Response samples

Content type
application/json
{ }

/plugins/customFeedback/v2/index

Responses

Response samples

Content type
application/json
{ }

/plugins/textEditor/index

Responses

Response samples

Content type
application/json
{ }

/plugins/textEditor/v2/index

Responses

Response samples

Content type
application/json
{ }

/support/openapi/create

Responses

Response samples

Content type
application/json
{ }

/support/openapi/delete

query Parameters
id
required
string

Responses

Response samples

Content type
application/json
{ }

/support/openapi/list

Responses

Response samples

Content type
application/json
{ }

/support/openapi/update

Responses

Response samples

Content type
application/json
{ }

/support/outLink/create

Responses

Response samples

Content type
application/json
"string"

delete a shareChat by shareChatId

Response samples

Content type
application/json
{ }

/core/dataset/searchTest

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/training/getDatasetTrainingQueue

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{
  • "number": null
}

/core/dataset/training/getQueueLen

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/core/dataset/training/rebuildEmbedding

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/core/dataset/update

Authorizations:
token

Responses

Response samples

Content type
application/json
null

/core/workflow/debug

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/lafApi/[...path]

Responses

Response samples

Content type
application/json
{ }

/plugins/TFSwitch/index

Responses

Response samples

Content type
application/json
{ }

/plugins/customFeedback/index

Responses

Response samples

Content type
application/json
{ }

/plugins/customFeedback/v2/index

Responses

Response samples

Content type
application/json
{ }

/plugins/textEditor/index

Responses

Response samples

Content type
application/json
{ }

/plugins/textEditor/v2/index

Responses

Response samples

Content type
application/json
{ }

/support/openapi/create

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/openapi/delete

Authorizations:
token
query Parameters
id
required
string

Responses

Response samples

Content type
application/json
{ }

/support/openapi/list

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/openapi/update

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/outLink/create

Authorizations:
token

Responses

Response samples

Content type
application/json
"string"

delete a shareChat by shareChatId

delete a shareChat by shareChatId

-
query Parameters
id
required
string

Responses

Response samples

Content type
application/json
{ }

/support/outLink/feishu/[token]

query Parameters
TSAnyKeyword

Responses

Response samples

Content type
application/json
{ }

查询应用内全部 Outlink

Response samples

Content type
application/json
{ }

/support/outLink/feishu/[token]

query Parameters
TSAnyKeyword

Responses

Response samples

Content type
application/json
{ }

查询应用内全部 Outlink

查询应用内全部 Outlink

-
query Parameters
appId
required
string
Authorizations:
token
query Parameters
appId
required
string

应用 ID

type
required
string

响应: 应用内全部 Outlink 查询应用内全部 Outlink

-

Response samples

Content type
application/json
null

/support/outLink/offiaccount/[token]

query Parameters
TSAnyKeyword

Responses

Response samples

Content type
application/json
{ }

/support/outLink/update

Responses

Response samples

Content type
application/json
{ }

/support/outLink/wecom/[token]

query Parameters
TSAnyKeyword

Responses

Response samples

Content type
application/json
{ }

/support/user/account/loginByPassword

Responses

Response samples

Content type
application/json
{ }

/support/user/account/loginout

Responses

Response samples

Content type
application/json
{ }

/support/user/account/tokenLogin

Responses

Response samples

Content type
application/json
{ }

/support/user/account/update

Responses

Response samples

Content type
application/json
{ }

/support/user/account/updatePasswordByOld

Responses

Response samples

Content type
application/json
{ }

/support/user/team/limit/datasetSizeLimit

Responses

Response samples

Content type
application/json
{ }

/support/user/team/limit/exportDatasetLimit

Responses

Response samples

Content type
application/json
{ }

/support/user/team/limit/webSyncLimit

Responses

Response samples

Content type
application/json
{ }

/support/user/team/plan/getTeamPlanStatus

Responses

Response samples

Content type
application/json
{ }

/support/user/team/update

Responses

Response samples

Content type
application/json
{ }

/support/wallet/usage/createTrainingUsage

Responses

Response samples

Content type
application/json
{ }

/system/img/[id]

Responses

Response samples

Content type
application/json
{ }

/v1/audio/transcriptions

Responses

Response samples

Content type
application/json
{ }

/v1/chat/completions

Responses

Response samples

Content type
application/json
{ }

/v1/embeddings

Responses

Response samples

Content type
application/json
{ }
+

Response samples

Content type
application/json
null

/support/outLink/offiaccount/[token]

query Parameters
TSAnyKeyword

Responses

Response samples

Content type
application/json
{ }

/support/outLink/update

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/outLink/wecom/[token]

query Parameters
TSAnyKeyword

Responses

Response samples

Content type
application/json
{ }

/support/user/account/loginByPassword

Responses

Response samples

Content type
application/json
{ }

/support/user/account/loginout

Responses

Response samples

Content type
application/json
{ }

/support/user/account/tokenLogin

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/user/account/update

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/user/account/updatePasswordByOld

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/user/team/limit/datasetSizeLimit

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/user/team/limit/exportDatasetLimit

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/user/team/limit/webSyncLimit

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/user/team/plan/getTeamPlanStatus

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/user/team/update

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/support/wallet/usage/createTrainingUsage

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/system/img/[id]

Responses

Response samples

Content type
application/json
{ }

/v1/audio/transcriptions

Authorizations:
token

Responses

Response samples

Content type
application/json
{ }

/v1/chat/completions

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }

/v1/embeddings

Authorizations:
apiKey

Responses

Response samples

Content type
application/json
{ }