From 08a310c41ffb0ce475a2c923aaa5cf2656d05d07 Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Fri, 10 May 2024 10:13:48 +0800 Subject: [PATCH] Update doc (#1430) --- docSite/content/docs/development/faq.md | 2 +- .../ docker_mongo.md} | 14 ++++++++++---- .../content/docs/development/migration/_index.md | 9 +++++++++ .../docs/development/migration/docker_db.md | 15 +++++++++++++++ packages/service/core/ai/embedding/index.ts | 2 ++ 5 files changed, 37 insertions(+), 5 deletions(-) rename docSite/content/docs/development/{mongodump跨环境迁移数据库.md => migration/ docker_mongo.md} (96%) create mode 100644 docSite/content/docs/development/migration/_index.md create mode 100644 docSite/content/docs/development/migration/docker_db.md diff --git a/docSite/content/docs/development/faq.md b/docSite/content/docs/development/faq.md index 9223d6e9b..8733145db 100644 --- a/docSite/content/docs/development/faq.md +++ b/docSite/content/docs/development/faq.md @@ -104,7 +104,7 @@ OneAPI 账号的余额不足,默认 root 用户只有 200 刀,可以手动 FastGPT 模型配置文件中的 model 必须与 OneAPI 渠道中的模型对应上,否则就会提示这个错误。可检查下面内容: 1. OneAPI 中没有配置该模型渠道,或者被禁用了。 -2. 修改了 FastGPT 配置文件中一部分的模型,但没有全部修改,仍有模型是 OneAPI 没配置的。 +2. FastGPT 配置文件有 OneAPI 没有配置的模型。如果 OneAPI 没有配置对应模型的,配置文件中也不要写。 3. 使用旧的向量模型创建了知识库,后又更新了向量模型。这时候需要删除以前的知识库,重建。 如果OneAPI中,没有配置对应的模型,`config.json`中也不要配置,否则容易报错。 diff --git a/docSite/content/docs/development/mongodump跨环境迁移数据库.md b/docSite/content/docs/development/migration/ docker_mongo.md similarity index 96% rename from docSite/content/docs/development/mongodump跨环境迁移数据库.md rename to docSite/content/docs/development/migration/ docker_mongo.md index df273b8b2..2354b6315 100644 --- a/docSite/content/docs/development/mongodump跨环境迁移数据库.md +++ b/docSite/content/docs/development/migration/ docker_mongo.md @@ -1,12 +1,18 @@ --- -weight: 749 -title: "FastGPT mongodump跨环境迁移fastgpt数据库" -description: "FastGPT 私有部署数据迁移问题" -icon: upgrade +weight: 762 +title: "Docker Mongo迁移(dump模式)" +description: "FastGPT Docker Mongo迁移" +icon: database draft: false images: [] --- +## 作者 + +[https://github.com/samqin123](https://github.com/samqin123) + +[相关PR。有问题可打开这里与作者交流](https://github.com/labring/FastGPT/pull/1426) + ## 介绍 如何使用Mongodump来完成从A环境到B环境的Fastgpt的mongodb迁移 diff --git a/docSite/content/docs/development/migration/_index.md b/docSite/content/docs/development/migration/_index.md new file mode 100644 index 000000000..68cf8646f --- /dev/null +++ b/docSite/content/docs/development/migration/_index.md @@ -0,0 +1,9 @@ +--- +weight: 960 +title: "迁移&备份" +description: "FastGPT 迁移&备份" +icon: settings_backup_restore +draft: false +images: [] +--- + \ No newline at end of file diff --git a/docSite/content/docs/development/migration/docker_db.md b/docSite/content/docs/development/migration/docker_db.md new file mode 100644 index 000000000..019531353 --- /dev/null +++ b/docSite/content/docs/development/migration/docker_db.md @@ -0,0 +1,15 @@ +--- +weight: 762 +title: "Docker 数据库迁移(无脑操作)" +description: "FastGPT Docker 数据库备份和迁移" +icon: database +draft: false +images: [] +--- + +## Copy文件 + +Docker 部署数据库都会通过 volume 挂载本地的目录进入容器,如果要迁移,直接复制这些目录即可。 + +`PG 数据`: pg/data +`Mongo 数据`: mongo/data \ No newline at end of file diff --git a/packages/service/core/ai/embedding/index.ts b/packages/service/core/ai/embedding/index.ts index 005ad485e..d0573bf20 100644 --- a/packages/service/core/ai/embedding/index.ts +++ b/packages/service/core/ai/embedding/index.ts @@ -2,6 +2,7 @@ import { VectorModelItemType } from '@fastgpt/global/core/ai/model.d'; import { getAIApi } from '../config'; import { countPromptTokens } from '../../../common/string/tiktoken/index'; import { EmbeddingTypeEnm } from '@fastgpt/global/core/ai/constants'; +import { addLog } from '../../../common/system/log'; type GetVectorProps = { model: VectorModelItemType; @@ -32,6 +33,7 @@ export async function getVectorsByText({ model, input, type }: GetVectorProps) { }) .then(async (res) => { if (!res.data) { + addLog.error('Embedding API is not responding', res); return Promise.reject('Embedding API is not responding'); } if (!res?.data?.[0]?.embedding) {