Compare commits
74 Commits
v4.8.15
...
v4.8.19-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c97757e4d | ||
|
|
9f33729ca9 | ||
|
|
a8d456f448 | ||
|
|
59177d307e | ||
|
|
bfb598d686 | ||
|
|
b780fbd6a7 | ||
|
|
7861229325 | ||
|
|
5b0516c28b | ||
|
|
740e8eb30c | ||
|
|
05a357dffe | ||
|
|
781fd45e39 | ||
|
|
80c8897e10 | ||
|
|
e933dacb05 | ||
|
|
cdf4f0e67d | ||
|
|
4dfeb21da3 | ||
|
|
d0d1a2cae8 | ||
|
|
f1f0ae2839 | ||
|
|
10d8c56e23 | ||
|
|
bb669ca3ff | ||
|
|
72ed72e595 | ||
|
|
e5735fddd1 | ||
|
|
fa92ef86b9 | ||
|
|
f39ea04178 | ||
|
|
bd4893ced9 | ||
|
|
b75e807f24 | ||
|
|
b2fdefdc0c | ||
|
|
896fec4b82 | ||
|
|
50bf7f9a3b | ||
|
|
da2831b948 | ||
|
|
b520988c64 | ||
|
|
a209856d48 | ||
|
|
f7942655a2 | ||
|
|
108e1b92ef | ||
|
|
f646ef8595 | ||
|
|
a7f25994d5 | ||
|
|
58fbf78c6e | ||
|
|
ae149069bf | ||
|
|
e5b8dea9ae | ||
|
|
b48eff4212 | ||
|
|
87e7c23da4 | ||
|
|
e6d53e3daa | ||
|
|
922cb433d3 | ||
|
|
a997f277ad | ||
|
|
1f4e5f6d71 | ||
|
|
ce2e926d76 | ||
|
|
bd79e7701f | ||
|
|
82871be054 | ||
|
|
8ba339e78f | ||
|
|
8e9c030600 | ||
|
|
9b8779ba08 | ||
|
|
bfac393ab1 | ||
|
|
76d20b2b76 | ||
|
|
b4933471cd | ||
|
|
c995bccef8 | ||
|
|
3deac290bf | ||
|
|
b7eb4c15de | ||
|
|
41a8536c16 | ||
|
|
1e618502c7 | ||
|
|
e9297c2c6a | ||
|
|
30a89fe4cb | ||
|
|
c41def5fbb | ||
|
|
b596976a96 | ||
|
|
e71708ee76 | ||
|
|
ddddd998c8 | ||
|
|
181b854342 | ||
|
|
40af63b1dd | ||
|
|
d2a56a2fed | ||
|
|
4b9b0dbbb9 | ||
|
|
c0135f5f21 | ||
|
|
8a4715293e | ||
|
|
69dc927a5a | ||
|
|
d5752ddbaa | ||
|
|
048f5a2d53 | ||
|
|
096afef629 |
83
.github/workflows/fastgpt-image.yml
vendored
@@ -173,3 +173,86 @@ jobs:
|
||||
-t ${Docker_Hub_Tag} \
|
||||
-t ${Docker_Hub_Latest} \
|
||||
.
|
||||
build-fastgpt-images-sub-route-gchat:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
# install env
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt update && sudo apt install -y nodejs npm
|
||||
- name: Set up QEMU (optional)
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
driver-opts: network=host
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
# login docker
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GH_PAT }}
|
||||
- name: Login to Ali Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: registry.cn-hangzhou.aliyuncs.com
|
||||
username: ${{ secrets.ALI_HUB_USERNAME }}
|
||||
password: ${{ secrets.ALI_HUB_PASSWORD }}
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_NAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||
|
||||
# Set tag
|
||||
- name: Set image name and tag
|
||||
run: |
|
||||
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
||||
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
else
|
||||
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Build and publish image for main branch or tag push event
|
||||
env:
|
||||
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
|
||||
run: |
|
||||
docker buildx build \
|
||||
-f projects/app/Dockerfile \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--build-arg base_url=/gchat \
|
||||
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \
|
||||
--label "org.opencontainers.image.description=fastgpt-sub-route-gchat image" \
|
||||
--push \
|
||||
--cache-from=type=local,src=/tmp/.buildx-cache \
|
||||
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
||||
-t ${Git_Tag} \
|
||||
-t ${Git_Latest} \
|
||||
-t ${Ali_Tag} \
|
||||
-t ${Ali_Latest} \
|
||||
-t ${Docker_Hub_Tag} \
|
||||
-t ${Docker_Hub_Latest} \
|
||||
.
|
||||
|
||||
21
.github/workflows/preview-fastgpt-image.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
password: ${{ secrets.GH_PAT }}
|
||||
- name: Set DOCKER_REPO_TAGGED based on branch or tag
|
||||
run: |
|
||||
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-pr:${{ github.event.pull_request.number }}" >> $GITHUB_ENV
|
||||
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-pr:${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
|
||||
- name: Build image for PR
|
||||
env:
|
||||
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
|
||||
@@ -44,13 +44,30 @@ jobs:
|
||||
docker buildx build \
|
||||
-f projects/app/Dockerfile \
|
||||
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \
|
||||
--label "org.opencontainers.image.description=fastgpt-pr imae" \
|
||||
--label "org.opencontainers.image.description=fastgpt-pr image" \
|
||||
--label "org.opencontainers.image.licenses=Apache" \
|
||||
--push \
|
||||
--cache-from=type=local,src=/tmp/.buildx-cache \
|
||||
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
||||
-t ${DOCKER_REPO_TAGGED} \
|
||||
.
|
||||
# Add write md step after build
|
||||
- name: Write md
|
||||
run: |
|
||||
echo "# 🤖 Generated by deploy action" > report.md
|
||||
echo "📦 Preview Image: \`${DOCKER_REPO_TAGGED}\`" >> report.md
|
||||
cat report.md
|
||||
|
||||
- name: Gh Rebot for Sealos
|
||||
uses: labring/gh-rebot@v0.0.6
|
||||
if: ${{ (github.event_name == 'pull_request_target') }}
|
||||
with:
|
||||
version: v0.0.6
|
||||
env:
|
||||
GH_TOKEN: '${{ secrets.GH_PAT }}'
|
||||
SEALOS_TYPE: 'pr_comment'
|
||||
SEALOS_FILENAME: 'report.md'
|
||||
SEALOS_REPLACE_TAG: 'DEFAULT_REPLACE_DEPLOY'
|
||||
|
||||
helm-check:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
25
README.md
@@ -58,9 +58,9 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
||||
- [x] 多库复用,混用
|
||||
- [x] chunk 记录修改和删除
|
||||
- [x] 支持手动输入,直接分段,QA 拆分导入
|
||||
- [x] 支持 txt,md,html,pdf,docx,pptx,csv,xlsx (有需要更多可 PR file loader)
|
||||
- [x] 支持 url 读取、CSV 批量导入
|
||||
- [x] 支持 txt,md,html,pdf,docx,pptx,csv,xlsx (有需要更多可 PR file loader),支持 url 读取、CSV 批量导入
|
||||
- [x] 混合检索 & 重排
|
||||
- [x] API 知识库
|
||||
- [ ] 自定义文件读取服务
|
||||
- [ ] 自定义分块服务
|
||||
|
||||
@@ -69,7 +69,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
||||
- [x] 对话时反馈引用并可修改与删除
|
||||
- [x] 完整上下文呈现
|
||||
- [x] 完整模块中间值呈现
|
||||
- [x] 高级编排 DeBug 模式
|
||||
- [ ] 高级编排 DeBug 模式
|
||||
|
||||
`4` OpenAPI 接口
|
||||
- [x] completions 接口 (chat 模式对齐 GPT 接口)
|
||||
@@ -104,7 +104,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
||||
* [快速开始本地开发](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/modelconfig/one-api/)
|
||||
* [版本更新/升级介绍](https://doc.tryfastgpt.ai/docs/development/upgrading/)
|
||||
* [OpenAPI API 文档](https://doc.tryfastgpt.ai/docs/development/openapi/)
|
||||
* [知识库结构详解](https://doc.tryfastgpt.ai/docs/guide/knowledge_base/rag/)
|
||||
@@ -127,7 +127,6 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
||||
|
||||
我们正在寻找志同道合的小伙伴,加速 FastGPT 的发展。你可以通过 [FastGPT 2025 招聘](https://fael3z0zfze.feishu.cn/wiki/P7FOwEmPziVcaYkvVaacnVX1nvg)了解 FastGPT 的招聘信息。
|
||||
|
||||
|
||||
## 💪 相关项目
|
||||
|
||||
- [Laf:3 分钟快速接入三方应用](https://github.com/labring/laf)
|
||||
@@ -139,19 +138,21 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||
</a>
|
||||
|
||||
## 👀 其他
|
||||
|
||||
- [保姆级 FastGPT 教程](https://www.bilibili.com/video/BV1n34y1A7Bo/?spm_id_from=333.999.0.0)
|
||||
- [接入飞书](https://www.bilibili.com/video/BV1Su4y1r7R3/?spm_id_from=333.999.0.0)
|
||||
- [接入企微](https://www.bilibili.com/video/BV1Tp4y1n72T/?spm_id_from=333.999.0.0)
|
||||
## 🌿 第三方生态
|
||||
|
||||
- [COW 个人微信/企微机器人](https://doc.tryfastgpt.ai/docs/use-cases/external-integration/onwechat/)
|
||||
- [SiliconCloud (硅基流动) —— 开源模型在线体验平台](https://cloud.siliconflow.cn/i/TR9Ym0c4)
|
||||
|
||||
<a href="#readme">
|
||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||
</a>
|
||||
|
||||
## 🌿 第三方生态
|
||||
## 👀 其他
|
||||
|
||||
- [COW 个人微信/企微机器人](https://doc.tryfastgpt.ai/docs/use-cases/external-integration/onwechat/)
|
||||
- [保姆级 FastGPT 教程](https://www.bilibili.com/video/BV1n34y1A7Bo/?spm_id_from=333.999.0.0)
|
||||
- [接入飞书](https://www.bilibili.com/video/BV1Su4y1r7R3/?spm_id_from=333.999.0.0)
|
||||
- [接入企微](https://www.bilibili.com/video/BV1Tp4y1n72T/?spm_id_from=333.999.0.0)
|
||||
|
||||
<a href="#readme">
|
||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||
@@ -214,4 +215,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.tryfastgpt.ai/docs/commercial)
|
||||
4. 联系方式:Dennis@sealos.io,[点击查看商业版定价策略](https://doc.tryfastgpt.ai/docs/shopping_cart/intro/)
|
||||
|
||||
2
dev.md
@@ -1,6 +1,6 @@
|
||||
## Premise
|
||||
|
||||
Since FastGPT is managed in the same way as monorepo, it is recommended to install 'make' first during development.
|
||||
Since FastGPT is managed in the same way as monorepo, it is recommended to install ‘make’ first during development.
|
||||
|
||||
monorepo Project Name:
|
||||
|
||||
|
||||
BIN
docSite/assets/imgs/dataset1.png
Normal file
|
After Width: | Height: | Size: 81 KiB |
BIN
docSite/assets/imgs/dataset2.png
Normal file
|
After Width: | Height: | Size: 129 KiB |
BIN
docSite/assets/imgs/dataset3.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
docSite/assets/imgs/dataset4.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
docSite/assets/imgs/dingtalk-bot-1.png
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
docSite/assets/imgs/dingtalk-bot-2.png
Normal file
|
After Width: | Height: | Size: 141 KiB |
BIN
docSite/assets/imgs/dingtalk-bot-3.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
docSite/assets/imgs/dingtalk-bot-4.png
Normal file
|
After Width: | Height: | Size: 313 KiB |
BIN
docSite/assets/imgs/dingtalk-bot-5.png
Normal file
|
After Width: | Height: | Size: 152 KiB |
BIN
docSite/assets/imgs/dingtalk-bot-6.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
BIN
docSite/assets/imgs/dingtalk-bot-7.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
docSite/assets/imgs/dingtalk-bot-8.png
Normal file
|
After Width: | Height: | Size: 112 KiB |
BIN
docSite/assets/imgs/faq1.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
docSite/assets/imgs/faq2.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
docSite/assets/imgs/faq3.png
Normal file
|
After Width: | Height: | Size: 174 KiB |
|
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 58 KiB |
BIN
docSite/assets/imgs/image-25.png
Normal file
|
After Width: | Height: | Size: 217 KiB |
BIN
docSite/assets/imgs/image-26.png
Normal file
|
After Width: | Height: | Size: 251 KiB |
BIN
docSite/assets/imgs/image-27.png
Normal file
|
After Width: | Height: | Size: 368 KiB |
BIN
docSite/assets/imgs/image-28.png
Normal file
|
After Width: | Height: | Size: 222 KiB |
BIN
docSite/assets/imgs/image-29.png
Normal file
|
After Width: | Height: | Size: 251 KiB |
BIN
docSite/assets/imgs/image-30.png
Normal file
|
After Width: | Height: | Size: 610 KiB |
BIN
docSite/assets/imgs/image-31.png
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
docSite/assets/imgs/image-32.png
Normal file
|
After Width: | Height: | Size: 134 KiB |
BIN
docSite/assets/imgs/image-33.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
docSite/assets/imgs/image-34.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
docSite/assets/imgs/image-35.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
docSite/assets/imgs/image-36.png
Normal file
|
After Width: | Height: | Size: 113 KiB |
BIN
docSite/assets/imgs/image-37.png
Normal file
|
After Width: | Height: | Size: 135 KiB |
BIN
docSite/assets/imgs/image-38.png
Normal file
|
After Width: | Height: | Size: 145 KiB |
BIN
docSite/assets/imgs/image-39.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
docSite/assets/imgs/image-40.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
docSite/assets/imgs/image-41.png
Normal file
|
After Width: | Height: | Size: 250 KiB |
BIN
docSite/assets/imgs/image-42.png
Normal file
|
After Width: | Height: | Size: 189 KiB |
BIN
docSite/assets/imgs/image-43.png
Normal file
|
After Width: | Height: | Size: 136 KiB |
BIN
docSite/assets/imgs/image-44.png
Normal file
|
After Width: | Height: | Size: 136 KiB |
BIN
docSite/assets/imgs/image-45.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
docSite/assets/imgs/image-46.png
Normal file
|
After Width: | Height: | Size: 178 KiB |
BIN
docSite/assets/imgs/image-47.png
Normal file
|
After Width: | Height: | Size: 178 KiB |
BIN
docSite/assets/imgs/image-48.png
Normal file
|
After Width: | Height: | Size: 207 KiB |
BIN
docSite/assets/imgs/image-49.png
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
docSite/assets/imgs/image-50.png
Normal file
|
After Width: | Height: | Size: 176 KiB |
BIN
docSite/assets/imgs/image-51.png
Normal file
|
After Width: | Height: | Size: 246 KiB |
BIN
docSite/assets/imgs/image-52.png
Normal file
|
After Width: | Height: | Size: 146 KiB |
BIN
docSite/assets/imgs/image-53.png
Normal file
|
After Width: | Height: | Size: 136 KiB |
BIN
docSite/assets/imgs/image-54.png
Normal file
|
After Width: | Height: | Size: 150 KiB |
BIN
docSite/assets/imgs/image-55.png
Normal file
|
After Width: | Height: | Size: 310 KiB |
BIN
docSite/assets/imgs/image-56.png
Normal file
|
After Width: | Height: | Size: 462 KiB |
BIN
docSite/assets/imgs/image-57.png
Normal file
|
After Width: | Height: | Size: 362 KiB |
BIN
docSite/assets/imgs/image-58.png
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
docSite/assets/imgs/image-59.png
Normal file
|
After Width: | Height: | Size: 320 KiB |
BIN
docSite/assets/imgs/image-60.png
Normal file
|
After Width: | Height: | Size: 259 KiB |
BIN
docSite/assets/imgs/image-61.png
Normal file
|
After Width: | Height: | Size: 337 KiB |
BIN
docSite/assets/imgs/image-62.png
Normal file
|
After Width: | Height: | Size: 234 KiB |
BIN
docSite/assets/imgs/image-63.png
Normal file
|
After Width: | Height: | Size: 240 KiB |
BIN
docSite/assets/imgs/image-64.png
Normal file
|
After Width: | Height: | Size: 288 KiB |
BIN
docSite/assets/imgs/image-65.png
Normal file
|
After Width: | Height: | Size: 680 KiB |
BIN
docSite/assets/imgs/image-66.png
Normal file
|
After Width: | Height: | Size: 485 KiB |
BIN
docSite/assets/imgs/image-67.png
Normal file
|
After Width: | Height: | Size: 279 KiB |
BIN
docSite/assets/imgs/image-68.png
Normal file
|
After Width: | Height: | Size: 610 KiB |
BIN
docSite/assets/imgs/image-69.png
Normal file
|
After Width: | Height: | Size: 516 KiB |
BIN
docSite/assets/imgs/image-70.png
Normal file
|
After Width: | Height: | Size: 491 KiB |
BIN
docSite/assets/imgs/image-71.png
Normal file
|
After Width: | Height: | Size: 274 KiB |
BIN
docSite/assets/imgs/image-72.png
Normal file
|
After Width: | Height: | Size: 348 KiB |
BIN
docSite/assets/imgs/image-73.png
Normal file
|
After Width: | Height: | Size: 341 KiB |
BIN
docSite/assets/imgs/image-74.png
Normal file
|
After Width: | Height: | Size: 411 KiB |
BIN
docSite/assets/imgs/image-75.png
Normal file
|
After Width: | Height: | Size: 402 KiB |
BIN
docSite/assets/imgs/image-76.png
Normal file
|
After Width: | Height: | Size: 304 KiB |
BIN
docSite/assets/imgs/image-77.png
Normal file
|
After Width: | Height: | Size: 824 KiB |
BIN
docSite/assets/imgs/image-78.png
Normal file
|
After Width: | Height: | Size: 664 KiB |
BIN
docSite/assets/imgs/image-79.png
Normal file
|
After Width: | Height: | Size: 312 KiB |
BIN
docSite/assets/imgs/image-80.png
Normal file
|
After Width: | Height: | Size: 302 KiB |
BIN
docSite/assets/imgs/image-81.png
Normal file
|
After Width: | Height: | Size: 323 KiB |
BIN
docSite/assets/imgs/image-82.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
docSite/assets/imgs/image-83.png
Normal file
|
After Width: | Height: | Size: 144 KiB |
BIN
docSite/assets/imgs/image-84.png
Normal file
|
After Width: | Height: | Size: 243 KiB |
BIN
docSite/assets/imgs/image-85.png
Normal file
|
After Width: | Height: | Size: 237 KiB |
BIN
docSite/assets/imgs/image-86.png
Normal file
|
After Width: | Height: | Size: 550 KiB |
BIN
docSite/assets/imgs/image-87.png
Normal file
|
After Width: | Height: | Size: 390 KiB |
BIN
docSite/assets/imgs/other1.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
docSite/assets/imgs/other2.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
docSite/assets/imgs/other3.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
docSite/assets/imgs/quizApp1.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
docSite/assets/imgs/quizApp2.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
docSite/assets/imgs/searxng_plugin_guide1.png
Normal file
|
After Width: | Height: | Size: 324 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 68 KiB |
@@ -7,7 +7,7 @@ toc: true
|
||||
weight: 1210
|
||||
---
|
||||
|
||||
FastGPT 项目在 Apache License 2.0 许可下开源,同时包含以下附加条件:
|
||||
FastGPT 项目在 Apache License 2.0 许可下开源,但包含以下附加条件:
|
||||
|
||||
+ FastGPT 允许被用于商业化,例如作为其他应用的“后端即服务”使用,或者作为应用开发平台提供给企业。然而,当满足以下条件时,必须联系作者获得商业许可:
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ description: 'FastGPT 配置参数介绍'
|
||||
icon: 'settings'
|
||||
draft: false
|
||||
toc: true
|
||||
weight: 708
|
||||
weight: 707
|
||||
---
|
||||
|
||||
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/development/docker/) 来挂载配置文件。
|
||||
|
||||
**开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。
|
||||
**开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。
|
||||
|
||||
这个配置文件中包含了系统参数和各个模型配置:
|
||||
下面配置文件示例中包含了系统参数和各个模型配置:
|
||||
|
||||
## 4.6.8+ 版本新配置文件示例
|
||||
|
||||
@@ -21,16 +21,16 @@ weight: 708
|
||||
"lafEnv": "https://laf.dev" // laf环境。 https://laf.run (杭州阿里云) ,或者私有化的laf环境。如果使用 Laf openapi 功能,需要最新版的 laf 。
|
||||
},
|
||||
"systemEnv": {
|
||||
"vectorMaxProcess": 15,
|
||||
"qaMaxProcess": 15,
|
||||
"vectorMaxProcess": 15, // 向量处理线程数量
|
||||
"qaMaxProcess": 15, // 问答拆分线程数量
|
||||
"tokenWorkers": 50, // Token 计算线程保持数,会持续占用内存,不能设置太大。
|
||||
"pgHNSWEfSearch": 100 // 向量搜索参数。越大,搜索越精确,但是速度越慢。设置为100,有99%+精度。
|
||||
},
|
||||
"llmModels": [
|
||||
{
|
||||
"provider": "OpenAI", // 模型提供商,主要用于分类展示,目前已经内置提供商包括:https://github.com/labring/FastGPT/blob/main/packages/global/core/ai/provider.ts, 可 pr 提供新的提供商,或直接填写 Other
|
||||
"model": "gpt-4o-mini", // 模型名(对应OneAPI中渠道的模型名)
|
||||
"name": "gpt-4o-mini", // 模型别名
|
||||
"avatar": "/imgs/model/openai.svg", // 模型的logo
|
||||
"maxContext": 125000, // 最大上下文
|
||||
"maxResponse": 16000, // 最大回复
|
||||
"quoteMaxToken": 120000, // 最大引用内容
|
||||
@@ -38,7 +38,7 @@ weight: 708
|
||||
"charsPointsPrice": 0, // n积分/1k token(商业版)
|
||||
"censor": false, // 是否开启敏感校验(商业版)
|
||||
"vision": true, // 是否支持图片输入
|
||||
"datasetProcess": true, // 是否设置为知识库处理模型(QA),务必保证至少有一个为true,否则知识库会报错
|
||||
"datasetProcess": true, // 是否设置为文本理解模型(QA),务必保证至少有一个为true,否则知识库会报错
|
||||
"usedInClassify": true, // 是否用于问题分类(务必保证至少有一个为true)
|
||||
"usedInExtractFields": true, // 是否用于内容提取(务必保证至少有一个为true)
|
||||
"usedInToolCall": true, // 是否用于工具调用(务必保证至少有一个为true)
|
||||
@@ -48,12 +48,13 @@ weight: 708
|
||||
"customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
|
||||
"customExtractPrompt": "", // 自定义内容提取提示词
|
||||
"defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
|
||||
"defaultConfig": {} // 请求API时,挟带一些默认配置(比如 GLM4 的 top_p)
|
||||
"defaultConfig": {}, // 请求API时,挟带一些默认配置(比如 GLM4 的 top_p)
|
||||
"fieldMap": {} // 字段映射(o1 模型需要把 max_tokens 映射为 max_completion_tokens)
|
||||
},
|
||||
{
|
||||
"provider": "OpenAI",
|
||||
"model": "gpt-4o",
|
||||
"name": "gpt-4o",
|
||||
"avatar": "/imgs/model/openai.svg",
|
||||
"maxContext": 125000,
|
||||
"maxResponse": 4000,
|
||||
"quoteMaxToken": 120000,
|
||||
@@ -71,14 +72,15 @@ weight: 708
|
||||
"customCQPrompt": "",
|
||||
"customExtractPrompt": "",
|
||||
"defaultSystemChatPrompt": "",
|
||||
"defaultConfig": {}
|
||||
"defaultConfig": {},
|
||||
"fieldMap": {}
|
||||
},
|
||||
{
|
||||
"provider": "OpenAI",
|
||||
"model": "o1-mini",
|
||||
"name": "o1-mini",
|
||||
"avatar": "/imgs/model/openai.svg",
|
||||
"maxContext": 125000,
|
||||
"maxResponse": 4000,
|
||||
"maxResponse": 65000,
|
||||
"quoteMaxToken": 120000,
|
||||
"maxTemperature": 1.2,
|
||||
"charsPointsPrice": 0,
|
||||
@@ -95,15 +97,17 @@ weight: 708
|
||||
"customExtractPrompt": "",
|
||||
"defaultSystemChatPrompt": "",
|
||||
"defaultConfig": {
|
||||
"temperature": 1
|
||||
"temperature": 1,
|
||||
"max_tokens": null,
|
||||
"stream": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"provider": "OpenAI",
|
||||
"model": "o1-preview",
|
||||
"name": "o1-preview",
|
||||
"avatar": "/imgs/model/openai.svg",
|
||||
"maxContext": 125000,
|
||||
"maxResponse": 4000,
|
||||
"maxResponse": 32000,
|
||||
"quoteMaxToken": 120000,
|
||||
"maxTemperature": 1.2,
|
||||
"charsPointsPrice": 0,
|
||||
@@ -120,27 +124,26 @@ weight: 708
|
||||
"customExtractPrompt": "",
|
||||
"defaultSystemChatPrompt": "",
|
||||
"defaultConfig": {
|
||||
"temperature": 1
|
||||
"temperature": 1,
|
||||
"max_tokens": null,
|
||||
"stream": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"vectorModels": [
|
||||
{
|
||||
"model": "text-embedding-ada-002", // 模型名(与OneAPI对应)
|
||||
"name": "Embedding-2", // 模型展示名
|
||||
"avatar": "/imgs/model/openai.svg", // logo
|
||||
"charsPointsPrice": 0, // n积分/1k token
|
||||
"defaultToken": 700, // 默认文本分割时候的 token
|
||||
"maxToken": 3000, // 最大 token
|
||||
"weight": 100, // 优先训练权重
|
||||
"defaultConfig": {}, // 自定义额外参数。例如,如果希望使用 embedding3-large 的话,可以传入 dimensions:1024,来返回1024维度的向量。(目前必须小于1536维度)
|
||||
"dbConfig": {}, // 存储时的额外参数(非对称向量模型时候需要用到)
|
||||
"queryConfig": {} // 参训时的额外参数
|
||||
"provider": "OpenAI",
|
||||
"model": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small",
|
||||
"charsPointsPrice": 0,
|
||||
"defaultToken": 512,
|
||||
"maxToken": 3000,
|
||||
"weight": 100
|
||||
},
|
||||
{
|
||||
"provider": "OpenAI",
|
||||
"model": "text-embedding-3-large",
|
||||
"name": "text-embedding-3-large",
|
||||
"avatar": "/imgs/model/openai.svg",
|
||||
"charsPointsPrice": 0,
|
||||
"defaultToken": 512,
|
||||
"maxToken": 3000,
|
||||
@@ -150,18 +153,22 @@ weight: 708
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "text-embedding-3-small",
|
||||
"name": "text-embedding-3-small",
|
||||
"avatar": "/imgs/model/openai.svg",
|
||||
"charsPointsPrice": 0,
|
||||
"defaultToken": 512,
|
||||
"maxToken": 3000,
|
||||
"weight": 100
|
||||
"provider": "OpenAI",
|
||||
"model": "text-embedding-ada-002", // 模型名(与OneAPI对应)
|
||||
"name": "Embedding-2", // 模型展示名
|
||||
"charsPointsPrice": 0, // n积分/1k token
|
||||
"defaultToken": 700, // 默认文本分割时候的 token
|
||||
"maxToken": 3000, // 最大 token
|
||||
"weight": 100, // 优先训练权重
|
||||
"defaultConfig": {}, // 自定义额外参数。例如,如果希望使用 embedding3-large 的话,可以传入 dimensions:1024,来返回1024维度的向量。(目前必须小于1536维度)
|
||||
"dbConfig": {}, // 存储时的额外参数(非对称向量模型时候需要用到)
|
||||
"queryConfig": {} // 参训时的额外参数
|
||||
}
|
||||
],
|
||||
"reRankModels": [],
|
||||
"audioSpeechModels": [
|
||||
{
|
||||
"provider": "OpenAI",
|
||||
"model": "tts-1",
|
||||
"name": "OpenAI TTS1",
|
||||
"charsPointsPrice": 0,
|
||||
@@ -176,6 +183,7 @@ weight: 708
|
||||
}
|
||||
],
|
||||
"whisperModel": {
|
||||
"provider": "OpenAI",
|
||||
"model": "whisper-1",
|
||||
"name": "Whisper1",
|
||||
"charsPointsPrice": 0
|
||||
@@ -183,29 +191,66 @@ weight: 708
|
||||
}
|
||||
```
|
||||
|
||||
## 关于模型 logo
|
||||
## 内置的模型提供商ID
|
||||
|
||||
统一放置在项目的`public/imgs/model/xxx`目录中,目前内置了以下几种,如果有需要,可以PR增加。默认logo为 Hugging face 的 logo~
|
||||
为了方便模型分类展示,FastGPT 内置了部分模型提供商的名字和 Logo。如果你期望补充提供商,可[提交 Issue](https://github.com/labring/FastGPT/issues),并提供几个信息:
|
||||
|
||||
- /imgs/model/baichuan.svg - 百川智能
|
||||
- /imgs/model/chatglm.svg - 智谱清言
|
||||
- /imgs/model/claude.svg - claude
|
||||
- /imgs/model/deepseek.svg - deepseek
|
||||
- /imgs/model/doubao.svg - 火山豆包
|
||||
- /imgs/model/ernie.svg - 文心一言
|
||||
- /imgs/model/gemini.svg - gemini
|
||||
- /imgs/model/huggingface.svg - Hugging face【默认logo】
|
||||
- /imgs/model/minimax.svg - minimax
|
||||
- /imgs/model/moonshot.svg - 月之暗面
|
||||
- /imgs/model/openai.svg - OpenAI GPT
|
||||
- /imgs/model/qwen.svg - 通义千问
|
||||
- /imgs/model/sparkDesk.svg - 讯飞星火
|
||||
- /imgs/model/yi.svg - 零一万物
|
||||
-
|
||||
1. 厂商官网地址
|
||||
2. 厂商 SVG logo,建议是正方形图片。
|
||||
|
||||
## 特殊模型
|
||||
目前已支持的提供商, 复制 "-" 之前的字符串,作为 provider 的值。
|
||||
|
||||
### ReRank 接入(私有部署)
|
||||
- OpenAI
|
||||
- Claude
|
||||
- Gemini
|
||||
- Meta
|
||||
- MistralAI
|
||||
- AliCloud - 阿里云
|
||||
- Qwen - 通义千问
|
||||
- Doubao - 豆包
|
||||
- ChatGLM - 智谱
|
||||
- DeepSeek - 深度求索
|
||||
- Moonshot - 月之暗面
|
||||
- MiniMax
|
||||
- SparkDesk - 讯飞星火
|
||||
- Hunyuan - 腾讯混元
|
||||
- Baichuan - 百川
|
||||
- Yi - 零一万物
|
||||
- Ernie - 文心一言
|
||||
- StepFun - 阶跃星辰
|
||||
- Ollama
|
||||
- BAAI - 智源研究院
|
||||
- FishAudio
|
||||
- Other - 其他
|
||||
|
||||
|
||||
## ReRank 模型接入
|
||||
|
||||
由于 OneAPI 不支持 Rerank 模型,所以需要单独配置接入,这里
|
||||
|
||||
|
||||
### 使用硅基流动的在线模型
|
||||
|
||||
有免费的 `bge-reranker-v2-m3` 模型可以使用。
|
||||
|
||||
1. [点击注册硅基流动账号](https://cloud.siliconflow.cn/i/TR9Ym0c4)
|
||||
2. 进入控制台,获取 API key: https://cloud.siliconflow.cn/account/ak
|
||||
3. 修改 FastGPT 配置文件
|
||||
|
||||
```json
|
||||
{
|
||||
"reRankModels": [
|
||||
{
|
||||
"model": "BAAI/bge-reranker-v2-m3", // 这里的model需要对应 siliconflow 的模型名
|
||||
"name": "BAAI/bge-reranker-v2-m3",
|
||||
"requestUrl": "https://api.siliconflow.cn/v1/rerank",
|
||||
"requestAuth": "siliconflow 上申请的 key"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 私有部署模型
|
||||
|
||||
请使用 4.6.6-alpha 以上版本,配置文件中的 `reRankModels` 为重排模型,虽然是数组,不过目前仅有第1个生效。
|
||||
|
||||
@@ -226,44 +271,3 @@ weight: 708
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### ReRank 接入(硅基流动)
|
||||
|
||||
有免费的 `bge-reranker-v2-m3` 模型可以使用。
|
||||
|
||||
1. 注册硅基流动账号: https://siliconflow.cn/
|
||||
2. 进入控制台,获取 API key: https://cloud.siliconflow.cn/account/ak
|
||||
3. 修改 FastGPT 配置文件
|
||||
|
||||
```json
|
||||
{
|
||||
"reRankModels": [
|
||||
{
|
||||
"model": "BAAI/bge-reranker-v2-m3", // 这里的model需要对应 siliconflow 的模型名
|
||||
"name": "BAAI/bge-reranker-v2-m3",
|
||||
"requestUrl": "https://api.siliconflow.cn/v1/rerank",
|
||||
"requestAuth": "siliconflow 上申请的 key"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### ReRank 接入(Cohere)
|
||||
|
||||
这个重排模型对中文不是很好,不如 bge 的好用。
|
||||
|
||||
1. 申请 Cohere 官方 Key: https://dashboard.cohere.com/api-keys
|
||||
2. 修改 FastGPT 配置文件
|
||||
|
||||
```json
|
||||
{
|
||||
"reRankModels": [
|
||||
{
|
||||
"model": "rerank-multilingual-v2.0", // 这里的model需要对应 cohere 的模型名
|
||||
"name": "rerank-multilingual-v2.0",
|
||||
"requestUrl": "https://api.cohere.ai/v1/rerank",
|
||||
"requestAuth": "Coherer上申请的key"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -23,7 +23,7 @@ FastGPT 默认使用了 OpenAI 的 LLM 模型和向量模型,如果想要私
|
||||
也可以通过环境变量引入:sk-key。有关docker环境变量引入的方法请自寻教程,此处不再赘述。
|
||||
```
|
||||
|
||||
## 接入 [One API](/docs/development/one-api/)
|
||||
## 接入 [One API](/docs/development/modelconfig/one-api/)
|
||||
|
||||
为 chatglm2 和 m3e-large 各添加一个渠道,参数如下:
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ xinference launch -n qwen-chat -s 14 -f pytorch
|
||||
|
||||
## 将本地模型接入 One API
|
||||
|
||||
One API 的部署和接入请参考[这里](/docs/development/one-api/)。
|
||||
One API 的部署和接入请参考[这里](/docs/development/modelconfig/one-api/)。
|
||||
|
||||
为 qwen1.5-chat 添加一个渠道,这里的 Base URL 需要填 Xinference 服务的端点,并且注册 qwen-chat (模型的 UID) 。
|
||||
|
||||
|
||||
@@ -23,19 +23,19 @@ weight: 707
|
||||
|
||||
### PgVector版本
|
||||
|
||||
体验测试首选
|
||||
非常轻量,适合数据量在 5000 万以下。
|
||||
|
||||
{{< table "table-hover table-striped-columns" >}}
|
||||
| 环境 | 最低配置(单节点) | 推荐配置 |
|
||||
| ---- | ---- | ---- |
|
||||
| 测试 | 2c2g | 2c4g |
|
||||
| 测试(可以把计算进程设置少一些) | 2c4g | 2c8g |
|
||||
| 100w 组向量 | 4c8g 50GB | 4c16g 50GB |
|
||||
| 500w 组向量 | 8c32g 200GB | 16c64g 200GB |
|
||||
{{< /table >}}
|
||||
|
||||
### Milvus版本
|
||||
|
||||
生产部署首选,对于千万级以上向量性能更优秀。
|
||||
对于亿级以上向量性能更优秀。
|
||||
|
||||
[点击查看 Milvus 官方推荐配置](https://milvus.io/docs/prerequisite-docker.md)
|
||||
|
||||
@@ -192,7 +192,7 @@ docker restart oneapi
|
||||
|
||||
可以通过`ip:3001`访问OneAPI,默认账号为`root`密码为`123456`。
|
||||
|
||||
在OneApi中添加合适的AI模型渠道。[点击查看相关教程](/docs/development/one-api/)
|
||||
在OneApi中添加合适的AI模型渠道。[点击查看相关教程](/docs/development/modelconfig/one-api/)
|
||||
|
||||
### 5. 访问 FastGPT
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
weight: 749
|
||||
weight: 740
|
||||
title: "私有部署常见问题"
|
||||
description: "FastGPT 私有部署常见问题"
|
||||
icon: upgrade
|
||||
@@ -19,6 +19,57 @@ images: []
|
||||
|
||||
## 二、通用问题
|
||||
|
||||
### 通过sealos部署的话,是否没有本地部署的一些限制?
|
||||

|
||||
这是索引模型的长度限制,通过任何方式部署都一样的,但不同索引模型的配置不一样,可以在后台修改参数。
|
||||
|
||||
### sealos怎么挂载 小程序配置文件
|
||||
|
||||
新增配置文件:/app/projects/app/public/xxxx.txt
|
||||
如图
|
||||

|
||||
|
||||
### 数据库3306端口被占用了,启动服务失败
|
||||

|
||||
|
||||
mysql 只有 oneAPI 用到,外面一般不需要调用,所以可以
|
||||
- 把 3306:3306 的映射去掉/或者直接改一个映射。
|
||||
|
||||
```yaml
|
||||
# 在 docker-compose.yaml 文件内
|
||||
# ...
|
||||
mysql:
|
||||
image: mysql:8.0.36
|
||||
ports:
|
||||
- 3306:3306 # 这个端口被占用了!
|
||||
# - 3307:3306 # 直接改一个。。和外面的不冲突
|
||||
# *empty* 或者直接删了,反正外面用不到
|
||||
oneapi:
|
||||
container_name: oneapi
|
||||
image: ghcr.io/songquanpeng/one-api:latest
|
||||
environment:
|
||||
- SQL_DSN=root:oneapimmysql@tcp(mysql:3306)/oneapi # 这不用改,容器内外网络是隔离的
|
||||
```
|
||||
- 另一种做法是可以直接连现有的 mysql, 要改 oneAPI 的环境变量。
|
||||
```yaml
|
||||
# 在 docker-compose.yaml 文件内
|
||||
# ...
|
||||
# mysql: # 要连外面的,这个玩意用不到了
|
||||
# image: mysql:8.0.36
|
||||
# ports:
|
||||
# - 3306:3306 # 这个端口被占用了!
|
||||
oneapi:
|
||||
container_name: oneapi
|
||||
image: ghcr.io/songquanpeng/one-api:latest
|
||||
environment:
|
||||
- SQL_DSN=root:oneapimmysql@tcp(mysql:3306)/oneapi # 改成外面的链接字符串
|
||||
```
|
||||
|
||||
|
||||
### 本地部署的限制
|
||||
|
||||
具体内容参考https://fael3z0zfze.feishu.cn/wiki/OFpAw8XzAi36Guk8dfucrCKUnjg。
|
||||
|
||||
### 能否纯本地运行
|
||||
|
||||
可以。需要准备好向量模型和LLM模型。
|
||||
@@ -41,31 +92,6 @@ images: []
|
||||
1. 问题补全需要经过一轮AI生成。
|
||||
2. 会进行3~5轮的查询,如果数据库性能不足,会有明显影响。
|
||||
|
||||
### 对话接口报错或返回为空(core.chat.Chat API is error or undefined)
|
||||
|
||||
1. 检查 AI 的 key 问题:通过 curl 请求看是否正常。务必用 stream=true 模式。并且 maxToken 等相关参数尽量一致。
|
||||
2. 如果是国内模型,可能是命中风控了。
|
||||
3. 查看模型请求日志,检查出入参数是否异常。
|
||||
|
||||
```sh
|
||||
# curl 例子。
|
||||
curl --location --request POST 'https://xxx.cn/v1/chat/completions' \
|
||||
--header 'Authorization: Bearer sk-xxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"model": "gpt-3.5-turbo",
|
||||
"stream": true,
|
||||
"temperature": 1,
|
||||
"max_tokens": 3000,
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "你是谁"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
### 页面中可以正常回复,API 报错
|
||||
|
||||
页面中是用 stream=true 模式,所以API也需要设置 stream=true 来进行测试。部分模型接口(国产居多)非 Stream 的兼容有点垃圾。
|
||||
@@ -111,6 +137,13 @@ FastGPT 模型配置文件中的 model 必须与 OneAPI 渠道中的模型对应
|
||||
|
||||
如果OneAPI中,没有配置对应的模型,`config.json`中也不要配置,否则容易报错。
|
||||
|
||||
### 点击模型测试失败
|
||||
|
||||
OneAPI 只会测试渠道的第一个模型,并且只会测试对话模型,向量模型无法自动测试,需要手动发起请求进行测试。[查看测试模型命令示例](/docs/development/faq/#如何检查模型问题)
|
||||
### get request url failed: Post "https://xxx dial tcp: xxxx
|
||||
|
||||
OneAPI 与模型网络不通,需要检查网络配置。
|
||||
|
||||
### Incorrect API key provided: sk-xxxx.You can find your api Key at xxx
|
||||
|
||||
OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并重启容器(先 docker-compose down 然后再 docker-compose up -d 运行一次)。
|
||||
@@ -126,6 +159,112 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并
|
||||
|
||||
## 四、常见模型问题
|
||||
|
||||
### 如何检查模型问题
|
||||
|
||||
1. 私有部署模型,先确认部署的模型是否正常。
|
||||
2. 通过 CURL 请求,直接测试上游模型是否正常运行(云端模型或私有模型均进行测试)
|
||||
3. 通过 CURL 请求,请求 OneAPI 去测试模型是否正常。
|
||||
4. 在 FastGPT 中使用该模型进行测试。
|
||||
|
||||
下面是几个测试 CURL 示例:
|
||||
|
||||
{{< tabs tabTotal="5" >}}
|
||||
{{< tab tabName="LLM模型" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl https://api.openai.com/v1/chat/completions \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $OPENAI_API_KEY" \
|
||||
-d '{
|
||||
"model": "gpt-4o",
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "You are a helpful assistant."
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Hello!"
|
||||
}
|
||||
]
|
||||
}'
|
||||
|
||||
```
|
||||
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab tabName="Embedding模型" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl https://api.openai.com/v1/embeddings \
|
||||
-H "Authorization: Bearer $OPENAI_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"input": "The food was delicious and the waiter...",
|
||||
"model": "text-embedding-ada-002",
|
||||
"encoding_format": "float"
|
||||
}'
|
||||
```
|
||||
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab tabName="Rerank 模型" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://xxxx.com/api/v1/rerank' \
|
||||
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"model": "bge-rerank-m3",
|
||||
"query": "导演是谁",
|
||||
"documents": [
|
||||
"你是谁?\n我是电影《铃芽之旅》助手"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab tabName="TTS 模型" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl https://api.openai.com/v1/audio/speech \
|
||||
-H "Authorization: Bearer $OPENAI_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"model": "tts-1",
|
||||
"input": "The quick brown fox jumped over the lazy dog.",
|
||||
"voice": "alloy"
|
||||
}' \
|
||||
--output speech.mp3
|
||||
```
|
||||
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab tabName="Whisper 模型" >}}
|
||||
{{< markdownify >}}
|
||||
|
||||
```bash
|
||||
curl https://api.openai.com/v1/audio/transcriptions \
|
||||
-H "Authorization: Bearer $OPENAI_API_KEY" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F file="@/path/to/file/audio.mp3" \
|
||||
-F model="whisper-1"
|
||||
```
|
||||
|
||||
{{< /markdownify >}}
|
||||
{{< /tab >}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
### 报错 - 模型响应为空/模型报错
|
||||
|
||||
该错误是由于 stream 模式下,oneapi 直接结束了流请求,并且未返回任何内容导致。
|
||||
@@ -165,7 +304,7 @@ curl --location --request POST 'https://api.openai.com/v1/chat/completions' \
|
||||
|
||||
需要模型提供商和 oneapi 同时支持工具调用才可使用,测试方法如下:
|
||||
|
||||
1. 通过 `curl` 向 `oneapi` 发起第一轮 stream 模式的 tool 测试。
|
||||
##### 1. 通过 `curl` 向 `oneapi` 发起第一轮 stream 模式的 tool 测试。
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
|
||||
@@ -200,7 +339,7 @@ curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
|
||||
}'
|
||||
```
|
||||
|
||||
2. 检查响应参数
|
||||
##### 2. 检查响应参数
|
||||
|
||||
如果能正常调用工具,会返回对应 `tool_calls` 参数。
|
||||
|
||||
@@ -238,7 +377,7 @@ curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
|
||||
}
|
||||
```
|
||||
|
||||
3. 通过 `curl` 向 `oneapi` 发起第二轮 stream 模式的 tool 测试。
|
||||
##### 3. 通过 `curl` 向 `oneapi` 发起第二轮 stream 模式的 tool 测试。
|
||||
|
||||
第二轮请求是把工具结果发送给模型。发起后会得到模型回答的结果。
|
||||
|
||||
|
||||