diff --git a/docSite/assets/imgs/oneapi/step1.png b/docSite/assets/imgs/oneapi/step1.png new file mode 100644 index 000000000..3275014fd Binary files /dev/null and b/docSite/assets/imgs/oneapi/step1.png differ diff --git a/docSite/assets/imgs/oneapi/step2.png b/docSite/assets/imgs/oneapi/step2.png new file mode 100644 index 000000000..8a3ee144e Binary files /dev/null and b/docSite/assets/imgs/oneapi/step2.png differ diff --git a/docSite/assets/imgs/oneapi/step3.png b/docSite/assets/imgs/oneapi/step3.png new file mode 100644 index 000000000..1acf0a854 Binary files /dev/null and b/docSite/assets/imgs/oneapi/step3.png differ diff --git a/docSite/assets/imgs/oneapi/step4.png b/docSite/assets/imgs/oneapi/step4.png new file mode 100644 index 000000000..d5f2c7512 Binary files /dev/null and b/docSite/assets/imgs/oneapi/step4.png differ diff --git a/docSite/assets/imgs/oneapi/step5.png b/docSite/assets/imgs/oneapi/step5.png new file mode 100644 index 000000000..087bcfdeb Binary files /dev/null and b/docSite/assets/imgs/oneapi/step5.png differ diff --git a/docSite/assets/imgs/oneapi/step6.png b/docSite/assets/imgs/oneapi/step6.png new file mode 100644 index 000000000..4298efe16 Binary files /dev/null and b/docSite/assets/imgs/oneapi/step6.png differ diff --git a/docSite/assets/imgs/oneapi/step7.png b/docSite/assets/imgs/oneapi/step7.png new file mode 100644 index 000000000..638440cf7 Binary files /dev/null and b/docSite/assets/imgs/oneapi/step7.png differ diff --git a/docSite/assets/jsconfig.json b/docSite/assets/jsconfig.json index 8f397dcb4..034343a29 100644 --- a/docSite/assets/jsconfig.json +++ b/docSite/assets/jsconfig.json @@ -3,8 +3,8 @@ "baseUrl": ".", "paths": { "*": [ - "../../../../../.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2@v2.21100.20000/package/dist/cjs/popper.js/*", - "../../../../../.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/twbs/bootstrap@v5.3.0+incompatible/js/*" + "../../../../.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2@v2.21100.20000/package/dist/cjs/popper.js/*", + "../../../../.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/twbs/bootstrap@v5.3.0+incompatible/js/*" ] } } diff --git a/docSite/content/docs/_index.md b/docSite/content/docs/_index.md index 619919d8d..9baacd3fa 100644 --- a/docSite/content/docs/_index.md +++ b/docSite/content/docs/_index.md @@ -1,9 +1,9 @@ --- weight: 10 -title: "文档" -description: "FastGPT 官方文档" +title: '文档' +description: 'FastGPT 官方文档' icon: menu_book -lead: "" +lead: '' draft: false images: [] ---- \ No newline at end of file +--- diff --git a/docSite/content/docs/installation/docker.md b/docSite/content/docs/installation/docker.md index 548484b76..61c1e3c2c 100644 --- a/docSite/content/docs/installation/docker.md +++ b/docSite/content/docs/installation/docker.md @@ -150,7 +150,7 @@ docker-compose up -d ## 访问 FastGPT -目前可以通过 ` ip:3000`` 直接访问(注意防火墙)。登录用户名为 `root`,密码为刚刚环境变量里设置的 `DEFAULT_ROOT_PSW`。 +目前可以通过 `ip:3000` 直接访问(注意防火墙)。登录用户名为 `root`,密码为刚刚环境变量里设置的 `DEFAULT_ROOT_PSW`。 如果需要域名访问,请自行安装并配置 Nginx。 diff --git a/docSite/content/docs/installation/one-api.md b/docSite/content/docs/installation/one-api.md index 74481a5b6..fd27dabbe 100644 --- a/docSite/content/docs/installation/one-api.md +++ b/docSite/content/docs/installation/one-api.md @@ -1,7 +1,7 @@ --- -title: "部署 one-api,实现多模型支持" -description: "通过接入 one-api 来实现对各种大模型的支持" -icon: "Api" +title: '部署 one-api,实现多模型支持' +description: '通过接入 one-api 来实现对各种大模型的支持' +icon: 'Api' draft: false toc: true weight: 730 @@ -9,17 +9,65 @@ weight: 730 [one-api](https://github.com/songquanpeng/one-api) 是一个 OpenAI 接口管理 & 分发系统,可以通过标准的 OpenAI API 格式访问所有的大模型,开箱即用。 -FastGPT 可以通过接入 one-api 来实现对各种大模型的支持。部署方法也很简单,直接点击以下按钮即可一键部署 👇 +FastGPT 可以通过接入 one-api 来实现对各种大模型的支持。部署方法也很简单。 + +## MySQL 版本 + +MySQL 版本支持多实例,高并发。 + +直接点击以下按钮即可一键部署 👇 [![](https://cdn.jsdelivr.us/gh/labring-actions/templates@main/Deploy-on-Sealos.svg)](https://cloud.sealos.io/?openapp=system-fastdeploy%3FtemplateName%3Done-api) 部署完后会跳转「应用管理」,数据库在另一个应用「数据库」中。需要等待 1~3 分钟数据库运行后才能访问成功。 -配置好 one-api 的模型后,可以直接修改 FastGPT 的环境变量: +## SqlLite 版本 + +SqlLite 版本不支持多实例,适合个人小流量使用,但是价格非常便宜。 + +**1. [点击打开 Sealos 公有云](https://cloud.sealos.io/)** + +**2. 打开 AppLaunchpad(应用管理) 工具** + +![step1](/imgs/oneapi/step1.png) + +**3. 点击创建新应用** + +**4. 填写对应参数** + +镜像:ghcr.io/songquanpeng/one-api:latest + +![step2](/imgs/oneapi/step2.png) +打开外网访问开关后,Sealos 会自动分配一个可访问的地址,不需要自己配置。 + +![step3](/imgs/oneapi/step3.png) +填写完参数后,点击右上角部署即可。 + +## 使用步骤 + +**1. 登录 one-api** + +打开 【one-api 应用详情】,找到访问地址: +![step4](/imgs/oneapi/step4.png) + +登录 one-api +![step5](/imgs/oneapi/step5.png) + +**2. 创建渠道和令牌** + +在 one-api 中添加对应渠道,直接点击 【添加基础模型】,不要遗漏了向量模型 +![step6](/imgs/oneapi/step6.png) + +创建一个令牌 +![step7](/imgs/oneapi/step7.png) + +**3. 修改 FastGPT 的环境变量** + +有了 one-api 令牌后,FastGPT 可以通过修改 baseurl 和 key 去请求到 one-api,再由 one-api 去请求不同的模型。修改下面两个环境变量: ```bash -# 下面的地址是 Sealos 提供的,务必写上 v1 +# 下面的地址是 Sealos 提供的,务必写上 v1, 两个项目都在 sealos 部署时候,https://xxxx.cloud.sealos.io 可以改用内网地址 OPENAI_BASE_URL=https://xxxx.cloud.sealos.io/v1 -# 下面的 key 由 one-api 提供 +# 下面的 key 是由 one-api 提供的令牌 CHAT_API_KEY=sk-xxxxxx -``` \ No newline at end of file +``` diff --git a/docSite/content/docs/installation/reference/_index.md b/docSite/content/docs/installation/reference/_index.md index 95c1da567..87a3da882 100644 --- a/docSite/content/docs/installation/reference/_index.md +++ b/docSite/content/docs/installation/reference/_index.md @@ -1,8 +1,8 @@ --- weight: 750 -title: "配置说明" -description: "FastGPT 配置指南" +title: '配置文件' +description: 'FastGPT 配置指南' icon: quick_reference_all draft: false images: [] ---- \ No newline at end of file +--- diff --git a/docSite/content/docs/installation/reference/configuration.md b/docSite/content/docs/installation/reference/configuration.md index 9e3d0ead5..fb7872669 100644 --- a/docSite/content/docs/installation/reference/configuration.md +++ b/docSite/content/docs/installation/reference/configuration.md @@ -1,5 +1,5 @@ --- -title: '配置详解' +title: '配置文件介绍' description: 'FastGPT 配置参数介绍' icon: 'settings' draft: false @@ -11,12 +11,10 @@ weight: 751 **开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。 -**注意: 为了方便介绍,文档介绍里会把注释写到 json 文件,实际运行时候 json 文件不能包含注释。** - 这个配置文件中包含了前端页面定制、系统级参数、AI 对话的模型等…… {{% alert context="warning" %}} -注意:下面的配置介绍仅是局部介绍,你需要完整挂载整个 `config.json`,不能仅挂载一部分。你可以直接在默认的 config.json 基础上根据下面的介绍进行修改。 +注意:下面的配置介绍仅是局部介绍,你需要完整挂载整个 `config.json`,不能仅挂载一部分。你可以直接在默认的 config.json 基础上根据下面的介绍进行修改。挂载上去的配置文件不能包含注释。 {{% /alert %}} ## 基础字段粗略说明 diff --git a/docSite/content/docs/installation/reference/models.md b/docSite/content/docs/installation/reference/models.md index 778e69b5b..59078cc08 100644 --- a/docSite/content/docs/installation/reference/models.md +++ b/docSite/content/docs/installation/reference/models.md @@ -1,7 +1,7 @@ --- -title: "多模型支持" -description: "如何接入除了 GPT 以外的其他大模型" -icon: "model_training" +title: '多模型支持' +description: '快速接入除了 GPT 以外的其他大模型' +icon: 'model_training' draft: false toc: true weight: 752 @@ -11,11 +11,9 @@ weight: 752 ## 部署 one-api -首先你需要部署一个 [one-api](/docs/installation/one-api/),并添加对应的【渠道】 +首先你需要部署一个 [one-api](/docs/installation/one-api/),并添加对应的【渠道】和【令牌】,并修改 FastGPT 环境变量,具体可参考 [快速部署 one-api](/docs/installation/one-api) -![](/imgs/chatmodels1.png) - -## 添加 FastGPT 配置 +## 添加 FastGPT 配置文件 可以在 `/client/src/data/config.json` 里找到配置文件(本地开发需要复制成 config.local.json),配置文件中有一项是对话模型配置: @@ -52,7 +50,7 @@ weight: 752 ], ``` -### 添加新模型 +### 添加新的对话模型 以添加文心一言为例: @@ -71,4 +69,4 @@ weight: 752 ] ``` -添加完后,重启应用即可在选择文心一言模型进行对话。 \ No newline at end of file +添加完后,重启 FastGPT 即可在选择文心一言模型进行对话。 diff --git a/docSite/content/docs/workflow/examples/google_search.md b/docSite/content/docs/workflow/examples/google_search.md index e0020985b..81abef5b9 100644 --- a/docSite/content/docs/workflow/examples/google_search.md +++ b/docSite/content/docs/workflow/examples/google_search.md @@ -1,7 +1,7 @@ --- -title: "联网 GPT" -description: "将 FastGPT 外接搜索引擎" -icon: "search" +title: '联网 GPT' +description: '将 FastGPT 外接搜索引擎' +icon: 'search' draft: false toc: true weight: 441 @@ -11,11 +11,11 @@ weight: 441 ![](/imgs/google_search_2.png) -如上图,利用 HTTP 模块,你可以轻松的外接一个搜索引擎。这里以调用 Google Search API 为例。 +如上图,利用 HTTP 模块,你可以轻松的外接一个搜索引擎。这里以调用 Google Search API 为例。注意:本文主要是为了介绍 HTTP 模型,具体的搜索效果需要依赖提示词和搜索引擎,这两部分可能需要更多的调试。 ## 注册 Google Search API -[参考这篇文章](https://zhuanlan.zhihu.com/p/174666017) +[参考这篇文章](https://zhuanlan.zhihu.com/p/174666017),每天可以免费使用 100 次。 ## 写一个 Google Search 接口 @@ -453,4 +453,4 @@ export default async function (ctx: FunctionContext) { 1. 提取模块将用户的问题提取成搜索关键词。 2. 将搜索关键词传入 HTTP 模块。 3. HTTP 模块调用谷歌搜索接口,返回搜索内容。 -4. 将搜索内容传入【AI 对话】的提示词,引导模型进行回答。 \ No newline at end of file +4. 将搜索内容传入【AI 对话】的提示词,引导模型进行回答。