Compare commits
148 Commits
v4.8.17-al
...
v4.9.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e045093b1 | ||
|
|
a1b114e426 | ||
|
|
54fde7630c | ||
|
|
467c408ad7 | ||
|
|
c005a94454 | ||
|
|
c8a35822d6 | ||
|
|
d05259dedd | ||
|
|
8980664b8a | ||
|
|
43f30b3790 | ||
|
|
3ddbb37612 | ||
|
|
7c419a26b3 | ||
|
|
e131465d25 | ||
|
|
a345e56508 | ||
|
|
32ce032995 | ||
|
|
0bc075aa4e | ||
|
|
3e3f2165db | ||
|
|
e1aa068858 | ||
|
|
e98d6f1d30 | ||
|
|
54eb5c0547 | ||
|
|
adf5377ebe | ||
|
|
08b6f594df | ||
|
|
90d13ee3df | ||
|
|
5c718abd50 | ||
|
|
2d351c3654 | ||
|
|
662a4a4671 | ||
|
|
3fadabd28b | ||
|
|
dbf25cef88 | ||
|
|
b2e2fa6b76 | ||
|
|
576c60bd55 | ||
|
|
33617ab5dc | ||
|
|
b4dda6a41b | ||
|
|
e860c56b77 | ||
|
|
efac5312b4 | ||
|
|
4bc7f21182 | ||
|
|
113e8f711f | ||
|
|
abc6dffb41 | ||
|
|
f7b2a57ca3 | ||
|
|
cf0aaa1091 | ||
|
|
ac4255ea0c | ||
|
|
df4d6f86ce | ||
|
|
e697fda82f | ||
|
|
1aa319e7aa | ||
|
|
fc9e614f88 | ||
|
|
1121ea33bd | ||
|
|
9bbee60cde | ||
|
|
9f57ad0017 | ||
|
|
c3d3b30d7e | ||
|
|
fb0eb49196 | ||
|
|
27ebd2e8cf | ||
|
|
81a06718d8 | ||
|
|
3c382d1240 | ||
|
|
747bb303ec | ||
|
|
cf9c8e9f6a | ||
|
|
5d5bee9e41 | ||
|
|
4f0dd96699 | ||
|
|
fb6dbaf2d6 | ||
|
|
ffc1520f4c | ||
|
|
255764400f | ||
|
|
3bfe802c48 | ||
|
|
2bf17dbb87 | ||
|
|
8d766372fe | ||
|
|
ca5717936b | ||
|
|
6762723b10 | ||
|
|
8604cbd021 | ||
|
|
206325bc5f | ||
|
|
5fd520c794 | ||
|
|
09205e4666 | ||
|
|
ccf28d83b8 | ||
|
|
420aaad48e | ||
|
|
8ba2339890 | ||
|
|
e7b8934367 | ||
|
|
3e13397614 | ||
|
|
b14674cc6f | ||
|
|
4d20274a97 | ||
|
|
4447e40364 | ||
|
|
23949230ee | ||
|
|
cd7a897304 | ||
|
|
18aff8b8db | ||
|
|
d2b60ec785 | ||
|
|
1226fe42a1 | ||
|
|
abd375cdec | ||
|
|
7aacce8b0b | ||
|
|
686b09afd1 | ||
|
|
3cfec37e9d | ||
|
|
d3641c877c | ||
|
|
1094c65f2b | ||
|
|
abe082b9ab | ||
|
|
132cf69372 | ||
|
|
06a8a5e23d | ||
|
|
c42deab63b | ||
|
|
58f715e878 | ||
|
|
116936ffa9 | ||
|
|
f5d045eece | ||
|
|
8ac6494e60 | ||
|
|
f002896a24 | ||
|
|
8738c32fb0 | ||
|
|
896a3f1472 | ||
|
|
4284b78707 | ||
|
|
fac5b6b50d | ||
|
|
51e17a47fa | ||
|
|
42b2046f96 | ||
|
|
bb82b515e0 | ||
|
|
fe688cdf2d | ||
|
|
0d35326909 | ||
|
|
d857a391b3 | ||
|
|
772c1cde77 | ||
|
|
b6e441c5eb | ||
|
|
ac95828660 | ||
|
|
f252918228 | ||
|
|
5c360b5ae6 | ||
|
|
09fa602dde | ||
|
|
db2c0a0bdb | ||
|
|
c393002f1d | ||
|
|
16629e32a7 | ||
|
|
d67474170a | ||
|
|
e02a7ab350 | ||
|
|
d491105752 | ||
|
|
fe59eadcee | ||
|
|
946bd20dbf | ||
|
|
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 |
2
.github/workflows/docs-deploy-kubeconfig.yml
vendored
@@ -6,8 +6,6 @@ on:
|
|||||||
- 'docSite/**'
|
- 'docSite/**'
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
tags:
|
|
||||||
- 'v*.*.*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-fastgpt-docs-images:
|
build-fastgpt-docs-images:
|
||||||
|
|||||||
4
.github/workflows/docs-deploy-vercel.yml
vendored
@@ -7,8 +7,6 @@ on:
|
|||||||
- 'docSite/**'
|
- 'docSite/**'
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
tags:
|
|
||||||
- 'v*.*.*'
|
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
jobs:
|
jobs:
|
||||||
@@ -58,7 +56,7 @@ jobs:
|
|||||||
|
|
||||||
# Step 4 - Builds the site using Hugo
|
# Step 4 - Builds the site using Hugo
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs && hugo -v --minify
|
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
|
||||||
|
|
||||||
# Step 5 - Push our generated site to Vercel
|
# Step 5 - Push our generated site to Vercel
|
||||||
- name: Deploy to Vercel
|
- name: Deploy to Vercel
|
||||||
|
|||||||
4
.github/workflows/docs-preview.yml
vendored
@@ -4,8 +4,6 @@ on:
|
|||||||
pull_request_target:
|
pull_request_target:
|
||||||
paths:
|
paths:
|
||||||
- 'docSite/**'
|
- 'docSite/**'
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
@@ -58,7 +56,7 @@ jobs:
|
|||||||
|
|
||||||
# Step 4 - Builds the site using Hugo
|
# Step 4 - Builds the site using Hugo
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs && hugo -v --minify
|
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
|
||||||
|
|
||||||
# Step 5 - Push our generated site to Vercel
|
# Step 5 - Push our generated site to Vercel
|
||||||
- name: Deploy to Vercel
|
- name: Deploy to Vercel
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
driver-opts: network=host
|
driver-opts: network=host
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
@@ -108,7 +108,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
driver-opts: network=host
|
driver-opts: network=host
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
@@ -173,3 +173,86 @@ jobs:
|
|||||||
-t ${Docker_Hub_Tag} \
|
-t ${Docker_Hub_Tag} \
|
||||||
-t ${Docker_Hub_Latest} \
|
-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@v4
|
||||||
|
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} \
|
||||||
|
.
|
||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
password: ${{ secrets.GH_PAT }}
|
password: ${{ secrets.GH_PAT }}
|
||||||
- name: Set DOCKER_REPO_TAGGED based on branch or tag
|
- name: Set DOCKER_REPO_TAGGED based on branch or tag
|
||||||
run: |
|
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
|
- name: Build image for PR
|
||||||
env:
|
env:
|
||||||
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
|
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
|
||||||
@@ -44,21 +44,27 @@ jobs:
|
|||||||
docker buildx build \
|
docker buildx build \
|
||||||
-f projects/app/Dockerfile \
|
-f projects/app/Dockerfile \
|
||||||
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \
|
--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" \
|
--label "org.opencontainers.image.licenses=Apache" \
|
||||||
--push \
|
--push \
|
||||||
--cache-from=type=local,src=/tmp/.buildx-cache \
|
--cache-from=type=local,src=/tmp/.buildx-cache \
|
||||||
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
||||||
-t ${DOCKER_REPO_TAGGED} \
|
-t ${DOCKER_REPO_TAGGED} \
|
||||||
.
|
.
|
||||||
|
# Add write md step after build
|
||||||
helm-check:
|
- name: Write md
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Helm Check
|
|
||||||
run: |
|
run: |
|
||||||
helm dependency update files/helm/fastgpt
|
echo "# 🤖 Generated by deploy action" > report.md
|
||||||
helm lint files/helm/fastgpt
|
echo "📦 Preview Image: \`${DOCKER_REPO_TAGGED}\`" >> report.md
|
||||||
helm package files/helm/fastgpt
|
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'
|
||||||
4
.github/workflows/helm-release.yaml
vendored
@@ -24,6 +24,6 @@ jobs:
|
|||||||
export APP_VERSION=${{ steps.vars.outputs.tag }}
|
export APP_VERSION=${{ steps.vars.outputs.tag }}
|
||||||
export HELM_VERSION=${{ steps.vars.outputs.tag }}
|
export HELM_VERSION=${{ steps.vars.outputs.tag }}
|
||||||
export HELM_REPO=ghcr.io/${{ github.repository_owner }}
|
export HELM_REPO=ghcr.io/${{ github.repository_owner }}
|
||||||
helm dependency update files/helm/fastgpt
|
helm dependency update deploy/helm/fastgpt
|
||||||
helm package files/helm/fastgpt --version ${HELM_VERSION}-helm --app-version ${APP_VERSION} -d bin
|
helm package deploy/helm/fastgpt --version ${HELM_VERSION}-helm --app-version ${APP_VERSION} -d bin
|
||||||
helm push bin/fastgpt-${HELM_VERSION}-helm.tgz oci://${HELM_REPO}
|
helm push bin/fastgpt-${HELM_VERSION}-helm.tgz oci://${HELM_REPO}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
driver-opts: network=host
|
driver-opts: network=host
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
2
.vscode/nextapi.code-snippets
vendored
@@ -58,7 +58,7 @@
|
|||||||
"body": [
|
"body": [
|
||||||
"import '@/pages/api/__mocks__/base';",
|
"import '@/pages/api/__mocks__/base';",
|
||||||
"import { root } from '@/pages/api/__mocks__/db/init';",
|
"import { root } from '@/pages/api/__mocks__/db/init';",
|
||||||
"import { getTestRequest } from '@/test/utils';",
|
"import { getTestRequest } from '@fastgpt/service/test/utils'; ;",
|
||||||
"import { AppErrEnum } from '@fastgpt/global/common/error/code/app';",
|
"import { AppErrEnum } from '@fastgpt/global/common/error/code/app';",
|
||||||
"import handler from './demo';",
|
"import handler from './demo';",
|
||||||
"",
|
"",
|
||||||
|
|||||||
4
.vscode/settings.json
vendored
@@ -27,7 +27,5 @@
|
|||||||
},
|
},
|
||||||
"markdown.copyFiles.destination": {
|
"markdown.copyFiles.destination": {
|
||||||
"/docSite/content/**/*": "${documentWorkspaceFolder}/docSite/assets/imgs/"
|
"/docSite/content/**/*": "${documentWorkspaceFolder}/docSite/assets/imgs/"
|
||||||
},
|
}
|
||||||
"markdown.copyFiles.overwriteBehavior": "nameIncrementally",
|
|
||||||
"markdown.copyFiles.transformPath": "const filename = uri.path.split('/').pop(); return `/imgs/${filename}`;"
|
|
||||||
}
|
}
|
||||||
28
README.md
@@ -83,6 +83,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
|||||||
- [x] 统一查阅对话记录,并对数据进行标注
|
- [x] 统一查阅对话记录,并对数据进行标注
|
||||||
|
|
||||||
`6` 其他
|
`6` 其他
|
||||||
|
- [x] 可视化模型配置。
|
||||||
- [x] 支持语音输入和输出 (可配置语音输入语音回答)
|
- [x] 支持语音输入和输出 (可配置语音输入语音回答)
|
||||||
- [x] 模糊输入提示
|
- [x] 模糊输入提示
|
||||||
- [x] 模板市场
|
- [x] 模板市场
|
||||||
@@ -113,16 +114,6 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
|||||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
## 🏘️ 社区交流群
|
|
||||||
|
|
||||||
扫码加入飞书话题群:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
<a href="#readme">
|
|
||||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
|
||||||
</a>
|
|
||||||
|
|
||||||
## 🏘️ 加入我们
|
## 🏘️ 加入我们
|
||||||
|
|
||||||
我们正在寻找志同道合的小伙伴,加速 FastGPT 的发展。你可以通过 [FastGPT 2025 招聘](https://fael3z0zfze.feishu.cn/wiki/P7FOwEmPziVcaYkvVaacnVX1nvg)了解 FastGPT 的招聘信息。
|
我们正在寻找志同道合的小伙伴,加速 FastGPT 的发展。你可以通过 [FastGPT 2025 招聘](https://fael3z0zfze.feishu.cn/wiki/P7FOwEmPziVcaYkvVaacnVX1nvg)了解 FastGPT 的招聘信息。
|
||||||
@@ -132,17 +123,26 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
|||||||
- [Laf:3 分钟快速接入三方应用](https://github.com/labring/laf)
|
- [Laf:3 分钟快速接入三方应用](https://github.com/labring/laf)
|
||||||
- [Sealos:快速部署集群应用](https://github.com/labring/sealos)
|
- [Sealos:快速部署集群应用](https://github.com/labring/sealos)
|
||||||
- [One API:多模型管理,支持 Azure、文心一言等](https://github.com/songquanpeng/one-api)
|
- [One API:多模型管理,支持 Azure、文心一言等](https://github.com/songquanpeng/one-api)
|
||||||
- [TuShan:5 分钟搭建后台管理系统](https://github.com/msgbyte/tushan)
|
|
||||||
|
|
||||||
<a href="#readme">
|
<a href="#readme">
|
||||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
## 🌿 第三方生态
|
## 🌿 第三方生态
|
||||||
|
|
||||||
- [COW 个人微信/企微机器人](https://doc.tryfastgpt.ai/docs/use-cases/external-integration/onwechat/)
|
- [AI Proxy:国内模型聚合服务](https://sealos.run/aiproxy/?k=fastgpt-github/)
|
||||||
- [SiliconCloud (硅基流动) —— 开源模型在线体验平台](https://cloud.siliconflow.cn/i/TR9Ym0c4)
|
- [SiliconCloud (硅基流动) —— 开源模型在线体验平台](https://cloud.siliconflow.cn/i/TR9Ym0c4)
|
||||||
|
- [COW 个人微信/企微机器人](https://doc.tryfastgpt.ai/docs/use-cases/external-integration/onwechat/)
|
||||||
|
|
||||||
|
<a href="#readme">
|
||||||
|
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
## 🏘️ 社区交流群
|
||||||
|
|
||||||
|
扫码加入飞书话题群:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
<a href="#readme">
|
<a href="#readme">
|
||||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||||
@@ -215,4 +215,4 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
|||||||
1. 允许作为后台服务直接商用,但不允许提供 SaaS 服务。
|
1. 允许作为后台服务直接商用,但不允许提供 SaaS 服务。
|
||||||
2. 未经商业授权,任何形式的商用服务均需保留相关版权信息。
|
2. 未经商业授权,任何形式的商用服务均需保留相关版权信息。
|
||||||
3. 完整请查看 [FastGPT Open Source License](./LICENSE)
|
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/)
|
||||||
|
|||||||
26
SECURITY.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# 安全策略
|
||||||
|
|
||||||
|
## 漏洞报告
|
||||||
|
|
||||||
|
如果您发现了 FastGPT 的安全漏洞,请按照以下步骤进行报告:
|
||||||
|
|
||||||
|
1. **报告方式**
|
||||||
|
发送邮件至:yujinlong@sealos.io
|
||||||
|
请备注版本以及您的 GitHub 账号
|
||||||
|
|
||||||
|
3. **响应时间**
|
||||||
|
- 我们会在 48 小时内确认收到您的报告
|
||||||
|
- 一般在 3 个工作日内给出初步评估结果
|
||||||
|
|
||||||
|
4. **漏洞处理流程**
|
||||||
|
- 确认漏洞:我们会验证漏洞的存在性和影响范围
|
||||||
|
- 修复开发:针对已确认的漏洞进行修复
|
||||||
|
- 版本发布:在下一个版本更新中发布安全补丁
|
||||||
|
- 公开披露:在修复完成后,我们会在更新日志中公布相关信息
|
||||||
|
|
||||||
|
5. **注意事项**
|
||||||
|
- 在漏洞未修复前,请勿公开披露漏洞详情
|
||||||
|
- 我们欢迎负责任的漏洞披露
|
||||||
|
- 对于重大贡献者,我们会在项目致谢名单中提及
|
||||||
|
|
||||||
|
感谢您为 FastGPT 的安全性做出贡献!
|
||||||
@@ -114,15 +114,15 @@ services:
|
|||||||
# fastgpt
|
# fastgpt
|
||||||
sandbox:
|
sandbox:
|
||||||
container_name: sandbox
|
container_name: sandbox
|
||||||
image: ghcr.io/labring/fastgpt-sandbox:v4.8.16 # git
|
image: ghcr.io/labring/fastgpt-sandbox:v4.8.23-fix # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.16 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.23-fix # 阿里云
|
||||||
networks:
|
networks:
|
||||||
- fastgpt
|
- fastgpt
|
||||||
restart: always
|
restart: always
|
||||||
fastgpt:
|
fastgpt:
|
||||||
container_name: fastgpt
|
container_name: fastgpt
|
||||||
image: ghcr.io/labring/fastgpt:v4.8.16 # git
|
image: ghcr.io/labring/fastgpt:v4.8.23-fix # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.16 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.23-fix # 阿里云
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
networks:
|
networks:
|
||||||
@@ -133,14 +133,17 @@ services:
|
|||||||
- sandbox
|
- sandbox
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
# 前端访问地址: http://localhost:3000
|
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
|
||||||
- FE_DOMAIN=
|
- FE_DOMAIN=
|
||||||
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
|
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
|
||||||
- DEFAULT_ROOT_PSW=1234
|
- DEFAULT_ROOT_PSW=1234
|
||||||
# AI模型的API地址哦。务必加 /v1。这里默认填写了OneApi的访问地址。
|
# AI Proxy 的地址,如果配了该地址,优先使用
|
||||||
- OPENAI_BASE_URL=http://oneapi:3000/v1
|
- AIPROXY_API_ENDPOINT=http://aiproxy:3000
|
||||||
# AI模型的API Key。(这里默认填写了OneAPI的快速默认key,测试通后,务必及时修改)
|
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
|
||||||
- CHAT_API_KEY=sk-fastgpt
|
- AIPROXY_API_TOKEN=aiproxy
|
||||||
|
# 模型中转地址(如果用了 AI Proxy,下面 2 个就不需要了,旧版 OneAPI 用户,使用下面的变量)
|
||||||
|
# - OPENAI_BASE_URL=http://oneapi:3000/v1
|
||||||
|
# - CHAT_API_KEY=sk-fastgpt
|
||||||
# 数据库最大连接数
|
# 数据库最大连接数
|
||||||
- DB_MAX_LINK=30
|
- DB_MAX_LINK=30
|
||||||
# 登录凭证密钥
|
# 登录凭证密钥
|
||||||
@@ -159,51 +162,63 @@ services:
|
|||||||
# 日志等级: debug, info, warn, error
|
# 日志等级: debug, info, warn, error
|
||||||
- LOG_LEVEL=info
|
- LOG_LEVEL=info
|
||||||
- STORE_LOG_LEVEL=warn
|
- STORE_LOG_LEVEL=warn
|
||||||
|
# 工作流最大运行次数
|
||||||
|
- WORKFLOW_MAX_RUN_TIMES=1000
|
||||||
|
# 批量执行节点,最大输入长度
|
||||||
|
- WORKFLOW_MAX_LOOP_TIMES=100
|
||||||
|
# 自定义跨域,不配置时,默认都允许跨域(多个域名通过逗号分割)
|
||||||
|
- ALLOWED_ORIGINS=
|
||||||
|
# 是否开启IP限制,默认不开启
|
||||||
|
- USE_IP_LIMIT=false
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.json:/app/data/config.json
|
- ./config.json:/app/data/config.json
|
||||||
|
|
||||||
# oneapi
|
# AI Proxy
|
||||||
mysql:
|
aiproxy:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mysql:8.0.36 # 阿里云
|
image: 'ghcr.io/labring/sealos-aiproxy-service:latest'
|
||||||
# image: mysql:8.0.36
|
container_name: aiproxy
|
||||||
container_name: mysql
|
restart: unless-stopped
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- 3306:3306
|
|
||||||
networks:
|
|
||||||
- fastgpt
|
|
||||||
command: --default-authentication-plugin=mysql_native_password
|
|
||||||
environment:
|
|
||||||
# 默认root密码,仅首次运行有效
|
|
||||||
MYSQL_ROOT_PASSWORD: oneapimmysql
|
|
||||||
MYSQL_DATABASE: oneapi
|
|
||||||
volumes:
|
|
||||||
- ./mysql:/var/lib/mysql
|
|
||||||
oneapi:
|
|
||||||
container_name: oneapi
|
|
||||||
image: ghcr.io/songquanpeng/one-api:v0.6.7
|
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/one-api:v0.6.6 # 阿里云
|
|
||||||
ports:
|
|
||||||
- 3001:3000
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
aiproxy_pg:
|
||||||
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- fastgpt
|
- fastgpt
|
||||||
restart: always
|
|
||||||
environment:
|
environment:
|
||||||
# mysql 连接参数
|
# 对应 fastgpt 里的AIPROXY_API_TOKEN
|
||||||
- SQL_DSN=root:oneapimmysql@tcp(mysql:3306)/oneapi
|
- ADMIN_KEY=aiproxy
|
||||||
# 登录凭证加密密钥
|
# 错误日志详情保存时间(小时)
|
||||||
- SESSION_SECRET=oneapikey
|
- LOG_DETAIL_STORAGE_HOURS=1
|
||||||
# 内存缓存
|
# 数据库连接地址
|
||||||
- MEMORY_CACHE_ENABLED=true
|
- SQL_DSN=postgres://postgres:aiproxy@aiproxy_pg:5432/aiproxy
|
||||||
# 启动聚合更新,减少数据交互频率
|
# 最大重试次数
|
||||||
- BATCH_UPDATE_ENABLED=true
|
- RetryTimes=3
|
||||||
# 聚合更新时长
|
# 不需要计费
|
||||||
- BATCH_UPDATE_INTERVAL=10
|
- BILLING_ENABLED=false
|
||||||
# 初始化的 root 密钥(建议部署完后更改,否则容易泄露)
|
# 不需要严格检测模型
|
||||||
- INITIAL_ROOT_TOKEN=fastgpt
|
- DISABLE_MODEL_CONFIG=true
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/status']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
aiproxy_pg:
|
||||||
|
image: pgvector/pgvector:0.8.0-pg15 # docker hub
|
||||||
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
|
||||||
|
restart: unless-stopped
|
||||||
|
container_name: aiproxy_pg
|
||||||
volumes:
|
volumes:
|
||||||
- ./oneapi:/data
|
- ./aiproxy_pg:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- fastgpt
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_DB: aiproxy
|
||||||
|
POSTGRES_PASSWORD: aiproxy
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-d', 'aiproxy']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
networks:
|
networks:
|
||||||
fastgpt:
|
fastgpt:
|
||||||
@@ -7,12 +7,12 @@ version: '3.3'
|
|||||||
services:
|
services:
|
||||||
# db
|
# db
|
||||||
pg:
|
pg:
|
||||||
image: pgvector/pgvector:0.7.0-pg15 # docker hub
|
image: pgvector/pgvector:0.8.0-pg15 # docker hub
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.7.0 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
|
||||||
container_name: pg
|
container_name: pg
|
||||||
restart: always
|
restart: always
|
||||||
ports: # 生产环境建议不要暴露
|
# ports: # 生产环境建议不要暴露
|
||||||
- 5432:5432
|
# - 5432:5432
|
||||||
networks:
|
networks:
|
||||||
- fastgpt
|
- fastgpt
|
||||||
environment:
|
environment:
|
||||||
@@ -28,8 +28,8 @@ services:
|
|||||||
# image: mongo:4.4.29 # cpu不支持AVX时候使用
|
# image: mongo:4.4.29 # cpu不支持AVX时候使用
|
||||||
container_name: mongo
|
container_name: mongo
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
# ports:
|
||||||
- 27017:27017
|
# - 27017:27017
|
||||||
networks:
|
networks:
|
||||||
- fastgpt
|
- fastgpt
|
||||||
command: mongod --keyFile /data/mongodb.key --replSet rs0
|
command: mongod --keyFile /data/mongodb.key --replSet rs0
|
||||||
@@ -72,15 +72,15 @@ services:
|
|||||||
# fastgpt
|
# fastgpt
|
||||||
sandbox:
|
sandbox:
|
||||||
container_name: sandbox
|
container_name: sandbox
|
||||||
image: ghcr.io/labring/fastgpt-sandbox:v4.8.16 # git
|
image: ghcr.io/labring/fastgpt-sandbox:v4.8.23-fix # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.16 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.23-fix # 阿里云
|
||||||
networks:
|
networks:
|
||||||
- fastgpt
|
- fastgpt
|
||||||
restart: always
|
restart: always
|
||||||
fastgpt:
|
fastgpt:
|
||||||
container_name: fastgpt
|
container_name: fastgpt
|
||||||
image: ghcr.io/labring/fastgpt:v4.8.16 # git
|
image: ghcr.io/labring/fastgpt:v4.8.23-fix # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.16 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.23-fix # 阿里云
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
networks:
|
networks:
|
||||||
@@ -91,14 +91,17 @@ services:
|
|||||||
- sandbox
|
- sandbox
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
# 前端访问地址: http://localhost:3000
|
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
|
||||||
- FE_DOMAIN=
|
- FE_DOMAIN=
|
||||||
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
|
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
|
||||||
- DEFAULT_ROOT_PSW=1234
|
- DEFAULT_ROOT_PSW=1234
|
||||||
# AI模型的API地址哦。务必加 /v1。这里默认填写了OneApi的访问地址。
|
# AI Proxy 的地址,如果配了该地址,优先使用
|
||||||
- OPENAI_BASE_URL=http://oneapi:3000/v1
|
- AIPROXY_API_ENDPOINT=http://aiproxy:3000
|
||||||
# AI模型的API Key。(这里默认填写了OneAPI的快速默认key,测试通后,务必及时修改)
|
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
|
||||||
- CHAT_API_KEY=sk-fastgpt
|
- AIPROXY_API_TOKEN=aiproxy
|
||||||
|
# 模型中转地址(如果用了 AI Proxy,下面 2 个就不需要了,旧版 OneAPI 用户,使用下面的变量)
|
||||||
|
# - OPENAI_BASE_URL=http://oneapi:3000/v1
|
||||||
|
# - CHAT_API_KEY=sk-fastgpt
|
||||||
# 数据库最大连接数
|
# 数据库最大连接数
|
||||||
- DB_MAX_LINK=30
|
- DB_MAX_LINK=30
|
||||||
# 登录凭证密钥
|
# 登录凭证密钥
|
||||||
@@ -116,51 +119,63 @@ services:
|
|||||||
# 日志等级: debug, info, warn, error
|
# 日志等级: debug, info, warn, error
|
||||||
- LOG_LEVEL=info
|
- LOG_LEVEL=info
|
||||||
- STORE_LOG_LEVEL=warn
|
- STORE_LOG_LEVEL=warn
|
||||||
|
# 工作流最大运行次数
|
||||||
|
- WORKFLOW_MAX_RUN_TIMES=1000
|
||||||
|
# 批量执行节点,最大输入长度
|
||||||
|
- WORKFLOW_MAX_LOOP_TIMES=100
|
||||||
|
# 自定义跨域,不配置时,默认都允许跨域(多个域名通过逗号分割)
|
||||||
|
- ALLOWED_ORIGINS=
|
||||||
|
# 是否开启IP限制,默认不开启
|
||||||
|
- USE_IP_LIMIT=false
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.json:/app/data/config.json
|
- ./config.json:/app/data/config.json
|
||||||
|
|
||||||
# oneapi
|
# AI Proxy
|
||||||
mysql:
|
aiproxy:
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mysql:8.0.36 # 阿里云
|
image: 'ghcr.io/labring/sealos-aiproxy-service:latest'
|
||||||
image: mysql:8.0.36
|
container_name: aiproxy
|
||||||
container_name: mysql
|
restart: unless-stopped
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- 3306:3306
|
|
||||||
networks:
|
|
||||||
- fastgpt
|
|
||||||
command: --default-authentication-plugin=mysql_native_password
|
|
||||||
environment:
|
|
||||||
# 默认root密码,仅首次运行有效
|
|
||||||
MYSQL_ROOT_PASSWORD: oneapimmysql
|
|
||||||
MYSQL_DATABASE: oneapi
|
|
||||||
volumes:
|
|
||||||
- ./mysql:/var/lib/mysql
|
|
||||||
oneapi:
|
|
||||||
container_name: oneapi
|
|
||||||
image: ghcr.io/songquanpeng/one-api:v0.6.7
|
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/one-api:v0.6.6 # 阿里云
|
|
||||||
ports:
|
|
||||||
- 3001:3000
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
aiproxy_pg:
|
||||||
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- fastgpt
|
- fastgpt
|
||||||
restart: always
|
|
||||||
environment:
|
environment:
|
||||||
# mysql 连接参数
|
# 对应 fastgpt 里的AIPROXY_API_TOKEN
|
||||||
- SQL_DSN=root:oneapimmysql@tcp(mysql:3306)/oneapi
|
- ADMIN_KEY=aiproxy
|
||||||
# 登录凭证加密密钥
|
# 错误日志详情保存时间(小时)
|
||||||
- SESSION_SECRET=oneapikey
|
- LOG_DETAIL_STORAGE_HOURS=1
|
||||||
# 内存缓存
|
# 数据库连接地址
|
||||||
- MEMORY_CACHE_ENABLED=true
|
- SQL_DSN=postgres://postgres:aiproxy@aiproxy_pg:5432/aiproxy
|
||||||
# 启动聚合更新,减少数据交互频率
|
# 最大重试次数
|
||||||
- BATCH_UPDATE_ENABLED=true
|
- RetryTimes=3
|
||||||
# 聚合更新时长
|
# 不需要计费
|
||||||
- BATCH_UPDATE_INTERVAL=10
|
- BILLING_ENABLED=false
|
||||||
# 初始化的 root 密钥(建议部署完后更改,否则容易泄露)
|
# 不需要严格检测模型
|
||||||
- INITIAL_ROOT_TOKEN=fastgpt
|
- DISABLE_MODEL_CONFIG=true
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/status']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
aiproxy_pg:
|
||||||
|
image: pgvector/pgvector:0.8.0-pg15 # docker hub
|
||||||
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
|
||||||
|
restart: unless-stopped
|
||||||
|
container_name: aiproxy_pg
|
||||||
volumes:
|
volumes:
|
||||||
- ./oneapi:/data
|
- ./aiproxy_pg:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- fastgpt
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_DB: aiproxy
|
||||||
|
POSTGRES_PASSWORD: aiproxy
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-d', 'aiproxy']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
networks:
|
networks:
|
||||||
fastgpt:
|
fastgpt:
|
||||||
@@ -53,15 +53,15 @@ services:
|
|||||||
wait $$!
|
wait $$!
|
||||||
sandbox:
|
sandbox:
|
||||||
container_name: sandbox
|
container_name: sandbox
|
||||||
image: ghcr.io/labring/fastgpt-sandbox:v4.8.16 # git
|
image: ghcr.io/labring/fastgpt-sandbox:v4.8.23-fix # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.16 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.23-fix # 阿里云
|
||||||
networks:
|
networks:
|
||||||
- fastgpt
|
- fastgpt
|
||||||
restart: always
|
restart: always
|
||||||
fastgpt:
|
fastgpt:
|
||||||
container_name: fastgpt
|
container_name: fastgpt
|
||||||
image: ghcr.io/labring/fastgpt:v4.8.16 # git
|
image: ghcr.io/labring/fastgpt:v4.8.23-fix # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.16 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.23-fix # 阿里云
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
networks:
|
networks:
|
||||||
@@ -71,14 +71,17 @@ services:
|
|||||||
- sandbox
|
- sandbox
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
# 前端访问地址: http://localhost:3000
|
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
|
||||||
- FE_DOMAIN=
|
- FE_DOMAIN=
|
||||||
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
|
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
|
||||||
- DEFAULT_ROOT_PSW=1234
|
- DEFAULT_ROOT_PSW=1234
|
||||||
# AI模型的API地址哦。务必加 /v1。这里默认填写了OneApi的访问地址。
|
# AI Proxy 的地址,如果配了该地址,优先使用
|
||||||
- OPENAI_BASE_URL=http://oneapi:3000/v1
|
- AIPROXY_API_ENDPOINT=http://aiproxy:3000
|
||||||
# AI模型的API Key。(这里默认填写了OneAPI的快速默认key,测试通后,务必及时修改)
|
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
|
||||||
- CHAT_API_KEY=sk-fastgpt
|
- AIPROXY_API_TOKEN=aiproxy
|
||||||
|
# 模型中转地址(如果用了 AI Proxy,下面 2 个就不需要了,旧版 OneAPI 用户,使用下面的变量)
|
||||||
|
# - OPENAI_BASE_URL=http://oneapi:3000/v1
|
||||||
|
# - CHAT_API_KEY=sk-fastgpt
|
||||||
# 数据库最大连接数
|
# 数据库最大连接数
|
||||||
- DB_MAX_LINK=30
|
- DB_MAX_LINK=30
|
||||||
# 登录凭证密钥
|
# 登录凭证密钥
|
||||||
@@ -97,51 +100,63 @@ services:
|
|||||||
# 日志等级: debug, info, warn, error
|
# 日志等级: debug, info, warn, error
|
||||||
- LOG_LEVEL=info
|
- LOG_LEVEL=info
|
||||||
- STORE_LOG_LEVEL=warn
|
- STORE_LOG_LEVEL=warn
|
||||||
|
# 工作流最大运行次数
|
||||||
|
- WORKFLOW_MAX_RUN_TIMES=1000
|
||||||
|
# 批量执行节点,最大输入长度
|
||||||
|
- WORKFLOW_MAX_LOOP_TIMES=100
|
||||||
|
# 自定义跨域,不配置时,默认都允许跨域(多个域名通过逗号分割)
|
||||||
|
- ALLOWED_ORIGINS=
|
||||||
|
# 是否开启IP限制,默认不开启
|
||||||
|
- USE_IP_LIMIT=false
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.json:/app/data/config.json
|
- ./config.json:/app/data/config.json
|
||||||
|
|
||||||
# oneapi
|
# AI Proxy
|
||||||
mysql:
|
aiproxy:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mysql:8.0.36 # 阿里云
|
image: 'ghcr.io/labring/sealos-aiproxy-service:latest'
|
||||||
# image: mysql:8.0.36
|
container_name: aiproxy
|
||||||
container_name: mysql
|
restart: unless-stopped
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- 3306:3306
|
|
||||||
networks:
|
|
||||||
- fastgpt
|
|
||||||
command: --default-authentication-plugin=mysql_native_password
|
|
||||||
environment:
|
|
||||||
# 默认root密码,仅首次运行有效
|
|
||||||
MYSQL_ROOT_PASSWORD: oneapimmysql
|
|
||||||
MYSQL_DATABASE: oneapi
|
|
||||||
volumes:
|
|
||||||
- ./mysql:/var/lib/mysql
|
|
||||||
oneapi:
|
|
||||||
container_name: oneapi
|
|
||||||
image: ghcr.io/songquanpeng/one-api:v0.6.7
|
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/one-api:v0.6.6 # 阿里云
|
|
||||||
ports:
|
|
||||||
- 3001:3000
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
aiproxy_pg:
|
||||||
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- fastgpt
|
- fastgpt
|
||||||
restart: always
|
|
||||||
environment:
|
environment:
|
||||||
# mysql 连接参数
|
# 对应 fastgpt 里的AIPROXY_API_TOKEN
|
||||||
- SQL_DSN=root:oneapimmysql@tcp(mysql:3306)/oneapi
|
- ADMIN_KEY=aiproxy
|
||||||
# 登录凭证加密密钥
|
# 错误日志详情保存时间(小时)
|
||||||
- SESSION_SECRET=oneapikey
|
- LOG_DETAIL_STORAGE_HOURS=1
|
||||||
# 内存缓存
|
# 数据库连接地址
|
||||||
- MEMORY_CACHE_ENABLED=true
|
- SQL_DSN=postgres://postgres:aiproxy@aiproxy_pg:5432/aiproxy
|
||||||
# 启动聚合更新,减少数据交互频率
|
# 最大重试次数
|
||||||
- BATCH_UPDATE_ENABLED=true
|
- RetryTimes=3
|
||||||
# 聚合更新时长
|
# 不需要计费
|
||||||
- BATCH_UPDATE_INTERVAL=10
|
- BILLING_ENABLED=false
|
||||||
# 初始化的 root 密钥(建议部署完后更改,否则容易泄露)
|
# 不需要严格检测模型
|
||||||
- INITIAL_ROOT_TOKEN=fastgpt
|
- DISABLE_MODEL_CONFIG=true
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/status']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
aiproxy_pg:
|
||||||
|
image: pgvector/pgvector:0.8.0-pg15 # docker hub
|
||||||
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
|
||||||
|
restart: unless-stopped
|
||||||
|
container_name: aiproxy_pg
|
||||||
volumes:
|
volumes:
|
||||||
- ./oneapi:/data
|
- ./aiproxy_pg:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- fastgpt
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_DB: aiproxy
|
||||||
|
POSTGRES_PASSWORD: aiproxy
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-d', 'aiproxy']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
networks:
|
networks:
|
||||||
fastgpt:
|
fastgpt:
|
||||||
@@ -6,6 +6,7 @@ data:
|
|||||||
"openapiPrefix": "fastgpt",
|
"openapiPrefix": "fastgpt",
|
||||||
"vectorMaxProcess": 15,
|
"vectorMaxProcess": 15,
|
||||||
"qaMaxProcess": 15,
|
"qaMaxProcess": 15,
|
||||||
|
"vlmMaxProcess": 15,
|
||||||
"pgHNSWEfSearch": 100
|
"pgHNSWEfSearch": 100
|
||||||
},
|
},
|
||||||
"llmModels": [
|
"llmModels": [
|
||||||
@@ -23,7 +24,6 @@ data:
|
|||||||
"usedInClassify": true,
|
"usedInClassify": true,
|
||||||
"usedInExtractFields": true,
|
"usedInExtractFields": true,
|
||||||
"usedInToolCall": true,
|
"usedInToolCall": true,
|
||||||
"usedInQueryExtension": true,
|
|
||||||
"toolChoice": true,
|
"toolChoice": true,
|
||||||
"functionCall": false,
|
"functionCall": false,
|
||||||
"customCQPrompt": "",
|
"customCQPrompt": "",
|
||||||
@@ -45,7 +45,6 @@ data:
|
|||||||
"usedInClassify": true,
|
"usedInClassify": true,
|
||||||
"usedInExtractFields": true,
|
"usedInExtractFields": true,
|
||||||
"usedInToolCall": true,
|
"usedInToolCall": true,
|
||||||
"usedInQueryExtension": true,
|
|
||||||
"toolChoice": true,
|
"toolChoice": true,
|
||||||
"functionCall": false,
|
"functionCall": false,
|
||||||
"customCQPrompt": "",
|
"customCQPrompt": "",
|
||||||
@@ -67,7 +66,6 @@ data:
|
|||||||
"usedInClassify": true,
|
"usedInClassify": true,
|
||||||
"usedInExtractFields": true,
|
"usedInExtractFields": true,
|
||||||
"usedInToolCall": true,
|
"usedInToolCall": true,
|
||||||
"usedInQueryExtension": true,
|
|
||||||
"toolChoice": true,
|
"toolChoice": true,
|
||||||
"functionCall": false,
|
"functionCall": false,
|
||||||
"customCQPrompt": "",
|
"customCQPrompt": "",
|
||||||
@@ -89,7 +87,6 @@ data:
|
|||||||
"usedInClassify": false,
|
"usedInClassify": false,
|
||||||
"usedInExtractFields": false,
|
"usedInExtractFields": false,
|
||||||
"usedInToolCall": false,
|
"usedInToolCall": false,
|
||||||
"usedInQueryExtension": false,
|
|
||||||
"toolChoice": true,
|
"toolChoice": true,
|
||||||
"functionCall": false,
|
"functionCall": false,
|
||||||
"customCQPrompt": "",
|
"customCQPrompt": "",
|
||||||
2
dev.md
@@ -1,6 +1,6 @@
|
|||||||
## Premise
|
## 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:
|
monorepo Project Name:
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ FROM hugomods/hugo:0.117.0 AS builder
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ADD ./docSite hugo
|
ADD ./docSite hugo
|
||||||
RUN cd /app/hugo && hugo mod get -u github.com/colinwilson/lotusdocs && hugo -v --minify
|
RUN cd /app/hugo && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
|
||||||
|
|
||||||
FROM fholzer/nginx-brotli:latest
|
FROM fholzer/nginx-brotli:latest
|
||||||
|
|
||||||
|
|||||||
BIN
docSite/assets/imgs/aiproxy-1.jpg
Normal file
|
After Width: | Height: | Size: 198 KiB |
BIN
docSite/assets/imgs/aiproxy-1.png
Normal file
|
After Width: | Height: | Size: 198 KiB |
BIN
docSite/assets/imgs/aiproxy-10.png
Normal file
|
After Width: | Height: | Size: 229 KiB |
BIN
docSite/assets/imgs/aiproxy-11.png
Normal file
|
After Width: | Height: | Size: 422 KiB |
BIN
docSite/assets/imgs/aiproxy-2.png
Normal file
|
After Width: | Height: | Size: 235 KiB |
BIN
docSite/assets/imgs/aiproxy-3.png
Normal file
|
After Width: | Height: | Size: 341 KiB |
BIN
docSite/assets/imgs/aiproxy-4.png
Normal file
|
After Width: | Height: | Size: 212 KiB |
BIN
docSite/assets/imgs/aiproxy-5.png
Normal file
|
After Width: | Height: | Size: 240 KiB |
BIN
docSite/assets/imgs/aiproxy-6.png
Normal file
|
After Width: | Height: | Size: 342 KiB |
BIN
docSite/assets/imgs/aiproxy-7.png
Normal file
|
After Width: | Height: | Size: 363 KiB |
BIN
docSite/assets/imgs/aiproxy-8.png
Normal file
|
After Width: | Height: | Size: 348 KiB |
BIN
docSite/assets/imgs/aiproxy-9.png
Normal file
|
After Width: | Height: | Size: 222 KiB |
BIN
docSite/assets/imgs/aiproxy1.png
Normal file
|
After Width: | Height: | Size: 135 KiB |
BIN
docSite/assets/imgs/appid.png
Normal file
|
After Width: | Height: | Size: 332 KiB |
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/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 |
BIN
docSite/assets/imgs/image copy.png
Normal file
|
After Width: | Height: | Size: 329 KiB |
BIN
docSite/assets/imgs/image-100.png
Normal file
|
After Width: | Height: | Size: 254 KiB |
BIN
docSite/assets/imgs/image-101.png
Normal file
|
After Width: | Height: | Size: 236 KiB |
BIN
docSite/assets/imgs/image-102.png
Normal file
|
After Width: | Height: | Size: 146 KiB |
BIN
docSite/assets/imgs/image-103.png
Normal file
|
After Width: | Height: | Size: 326 KiB |
BIN
docSite/assets/imgs/image-104.png
Normal file
|
After Width: | Height: | Size: 321 KiB |
BIN
docSite/assets/imgs/image-105.png
Normal file
|
After Width: | Height: | Size: 353 KiB |
BIN
docSite/assets/imgs/image-106.png
Normal file
|
After Width: | Height: | Size: 154 KiB |
BIN
docSite/assets/imgs/image-107.png
Normal file
|
After Width: | Height: | Size: 197 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/image-88.png
Normal file
|
After Width: | Height: | Size: 380 KiB |
BIN
docSite/assets/imgs/image-89.png
Normal file
|
After Width: | Height: | Size: 393 KiB |
BIN
docSite/assets/imgs/image-90.png
Normal file
|
After Width: | Height: | Size: 377 KiB |
BIN
docSite/assets/imgs/image-91.png
Normal file
|
After Width: | Height: | Size: 257 KiB |
BIN
docSite/assets/imgs/image-92.png
Normal file
|
After Width: | Height: | Size: 205 KiB |
BIN
docSite/assets/imgs/image-93.png
Normal file
|
After Width: | Height: | Size: 221 KiB |
BIN
docSite/assets/imgs/image-94.png
Normal file
|
After Width: | Height: | Size: 245 KiB |
BIN
docSite/assets/imgs/image-95.png
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
docSite/assets/imgs/image-96.png
Normal file
|
After Width: | Height: | Size: 368 KiB |
BIN
docSite/assets/imgs/image-97.png
Normal file
|
After Width: | Height: | Size: 253 KiB |
BIN
docSite/assets/imgs/image-98.png
Normal file
|
After Width: | Height: | Size: 322 KiB |
BIN
docSite/assets/imgs/image-99.png
Normal file
|
After Width: | Height: | Size: 323 KiB |
BIN
docSite/assets/imgs/marker2.png
Normal file
|
After Width: | Height: | Size: 216 KiB |
BIN
docSite/assets/imgs/marker3.png
Normal file
|
After Width: | Height: | Size: 85 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 |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 68 KiB |
@@ -7,7 +7,7 @@ toc: true
|
|||||||
weight: 1210
|
weight: 1210
|
||||||
---
|
---
|
||||||
|
|
||||||
FastGPT 项目在 Apache License 2.0 许可下开源,同时包含以下附加条件:
|
FastGPT 项目在 Apache License 2.0 许可下开源,但包含以下附加条件:
|
||||||
|
|
||||||
+ FastGPT 允许被用于商业化,例如作为其他应用的“后端即服务”使用,或者作为应用开发平台提供给企业。然而,当满足以下条件时,必须联系作者获得商业许可:
|
+ FastGPT 允许被用于商业化,例如作为其他应用的“后端即服务”使用,或者作为应用开发平台提供给企业。然而,当满足以下条件时,必须联系作者获得商业许可:
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ weight: 707
|
|||||||
|
|
||||||
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/development/docker/) 来挂载配置文件。
|
由于环境变量不利于配置复杂的内容,新版 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+ 版本新配置文件示例
|
|
||||||
|
|
||||||
|
## 4.8.20+ 版本新配置文件示例
|
||||||
|
> 从4.8.20版本开始,模型在页面中进行配置。
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"feConfigs": {
|
"feConfigs": {
|
||||||
@@ -23,244 +23,54 @@ weight: 707
|
|||||||
"systemEnv": {
|
"systemEnv": {
|
||||||
"vectorMaxProcess": 15, // 向量处理线程数量
|
"vectorMaxProcess": 15, // 向量处理线程数量
|
||||||
"qaMaxProcess": 15, // 问答拆分线程数量
|
"qaMaxProcess": 15, // 问答拆分线程数量
|
||||||
|
"vlmMaxProcess": 15, // 图片理解模型最大处理进程
|
||||||
"tokenWorkers": 50, // Token 计算线程保持数,会持续占用内存,不能设置太大。
|
"tokenWorkers": 50, // Token 计算线程保持数,会持续占用内存,不能设置太大。
|
||||||
"pgHNSWEfSearch": 100 // 向量搜索参数。越大,搜索越精确,但是速度越慢。设置为100,有99%+精度。
|
"pgHNSWEfSearch": 100, // 向量搜索参数。越大,搜索越精确,但是速度越慢。设置为100,有99%+精度。
|
||||||
},
|
"customPdfParse": { // 4.9.0 新增配置
|
||||||
"llmModels": [
|
"url": "", // 自定义 PDF 解析服务地址
|
||||||
{
|
"key": "", // 自定义 PDF 解析服务密钥
|
||||||
"provider": "OpenAI", // 模型提供商,主要用于分类展示,目前已经内置提供商包括:https://github.com/labring/FastGPT/blob/main/packages/global/core/ai/provider.ts, 可 pr 提供新的提供商,或直接填写 Other
|
"doc2xKey": "", // doc2x 服务密钥
|
||||||
"model": "gpt-4o-mini", // 模型名(对应OneAPI中渠道的模型名)
|
"price": 0 // PDF 解析服务价格
|
||||||
"name": "gpt-4o-mini", // 模型别名
|
|
||||||
"maxContext": 125000, // 最大上下文
|
|
||||||
"maxResponse": 16000, // 最大回复
|
|
||||||
"quoteMaxToken": 120000, // 最大引用内容
|
|
||||||
"maxTemperature": 1.2, // 最大温度
|
|
||||||
"charsPointsPrice": 0, // n积分/1k token(商业版)
|
|
||||||
"censor": false, // 是否开启敏感校验(商业版)
|
|
||||||
"vision": true, // 是否支持图片输入
|
|
||||||
"datasetProcess": true, // 是否设置为文本理解模型(QA),务必保证至少有一个为true,否则知识库会报错
|
|
||||||
"usedInClassify": true, // 是否用于问题分类(务必保证至少有一个为true)
|
|
||||||
"usedInExtractFields": true, // 是否用于内容提取(务必保证至少有一个为true)
|
|
||||||
"usedInToolCall": true, // 是否用于工具调用(务必保证至少有一个为true)
|
|
||||||
"usedInQueryExtension": true, // 是否用于问题优化(务必保证至少有一个为true)
|
|
||||||
"toolChoice": true, // 是否支持工具选择(分类,内容提取,工具调用会用到。)
|
|
||||||
"functionCall": false, // 是否支持函数调用(分类,内容提取,工具调用会用到。会优先使用 toolChoice,如果为false,则使用 functionCall,如果仍为 false,则使用提示词模式)
|
|
||||||
"customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
|
|
||||||
"customExtractPrompt": "", // 自定义内容提取提示词
|
|
||||||
"defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
|
|
||||||
"defaultConfig": {}, // 请求API时,挟带一些默认配置(比如 GLM4 的 top_p)
|
|
||||||
"fieldMap": {} // 字段映射(o1 模型需要把 max_tokens 映射为 max_completion_tokens)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"provider": "OpenAI",
|
|
||||||
"model": "gpt-4o",
|
|
||||||
"name": "gpt-4o",
|
|
||||||
"maxContext": 125000,
|
|
||||||
"maxResponse": 4000,
|
|
||||||
"quoteMaxToken": 120000,
|
|
||||||
"maxTemperature": 1.2,
|
|
||||||
"charsPointsPrice": 0,
|
|
||||||
"censor": false,
|
|
||||||
"vision": true,
|
|
||||||
"datasetProcess": true,
|
|
||||||
"usedInClassify": true,
|
|
||||||
"usedInExtractFields": true,
|
|
||||||
"usedInToolCall": true,
|
|
||||||
"usedInQueryExtension": true,
|
|
||||||
"toolChoice": true,
|
|
||||||
"functionCall": false,
|
|
||||||
"customCQPrompt": "",
|
|
||||||
"customExtractPrompt": "",
|
|
||||||
"defaultSystemChatPrompt": "",
|
|
||||||
"defaultConfig": {},
|
|
||||||
"fieldMap": {}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"provider": "OpenAI",
|
|
||||||
"model": "o1-mini",
|
|
||||||
"name": "o1-mini",
|
|
||||||
"maxContext": 125000,
|
|
||||||
"maxResponse": 65000,
|
|
||||||
"quoteMaxToken": 120000,
|
|
||||||
"maxTemperature": 1.2,
|
|
||||||
"charsPointsPrice": 0,
|
|
||||||
"censor": false,
|
|
||||||
"vision": false,
|
|
||||||
"datasetProcess": true,
|
|
||||||
"usedInClassify": true,
|
|
||||||
"usedInExtractFields": true,
|
|
||||||
"usedInToolCall": true,
|
|
||||||
"usedInQueryExtension": true,
|
|
||||||
"toolChoice": false,
|
|
||||||
"functionCall": false,
|
|
||||||
"customCQPrompt": "",
|
|
||||||
"customExtractPrompt": "",
|
|
||||||
"defaultSystemChatPrompt": "",
|
|
||||||
"defaultConfig": {
|
|
||||||
"temperature": 1,
|
|
||||||
"max_tokens": null,
|
|
||||||
"stream": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"provider": "OpenAI",
|
|
||||||
"model": "o1-preview",
|
|
||||||
"name": "o1-preview",
|
|
||||||
"maxContext": 125000,
|
|
||||||
"maxResponse": 32000,
|
|
||||||
"quoteMaxToken": 120000,
|
|
||||||
"maxTemperature": 1.2,
|
|
||||||
"charsPointsPrice": 0,
|
|
||||||
"censor": false,
|
|
||||||
"vision": false,
|
|
||||||
"datasetProcess": true,
|
|
||||||
"usedInClassify": true,
|
|
||||||
"usedInExtractFields": true,
|
|
||||||
"usedInToolCall": true,
|
|
||||||
"usedInQueryExtension": true,
|
|
||||||
"toolChoice": false,
|
|
||||||
"functionCall": false,
|
|
||||||
"customCQPrompt": "",
|
|
||||||
"customExtractPrompt": "",
|
|
||||||
"defaultSystemChatPrompt": "",
|
|
||||||
"defaultConfig": {
|
|
||||||
"temperature": 1,
|
|
||||||
"max_tokens": null,
|
|
||||||
"stream": false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"vectorModels": [
|
|
||||||
{
|
|
||||||
"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",
|
|
||||||
"charsPointsPrice": 0,
|
|
||||||
"defaultToken": 512,
|
|
||||||
"maxToken": 3000,
|
|
||||||
"weight": 100,
|
|
||||||
"defaultConfig": {
|
|
||||||
"dimensions": 1024
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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": [
|
|
||||||
{
|
|
||||||
"model": "tts-1",
|
|
||||||
"name": "OpenAI TTS1",
|
|
||||||
"charsPointsPrice": 0,
|
|
||||||
"voices": [
|
|
||||||
{ "label": "Alloy", "value": "alloy", "bufferId": "openai-Alloy" },
|
|
||||||
{ "label": "Echo", "value": "echo", "bufferId": "openai-Echo" },
|
|
||||||
{ "label": "Fable", "value": "fable", "bufferId": "openai-Fable" },
|
|
||||||
{ "label": "Onyx", "value": "onyx", "bufferId": "openai-Onyx" },
|
|
||||||
{ "label": "Nova", "value": "nova", "bufferId": "openai-Nova" },
|
|
||||||
{ "label": "Shimmer", "value": "shimmer", "bufferId": "openai-Shimmer" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"whisperModel": {
|
|
||||||
"model": "whisper-1",
|
|
||||||
"name": "Whisper1",
|
|
||||||
"charsPointsPrice": 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 内置的模型提供商ID
|
## 自定义 PDF 解析配置
|
||||||
|
|
||||||
为了方便模型分类展示,FastGPT 内置了部分模型提供商的名字和 Logo。如果你期望补充提供商,可[提交 Issue](https://github.com/labring/FastGPT/issues),并提供几个信息:
|
自定义 PDF 服务解析的优先级高于 Doc2x 服务,所以如果使用 Doc2x 服务,请勿配置自定义 PDF 服务。
|
||||||
|
|
||||||
1. 厂商官网地址
|
### 使用 Sealos PDF 解析服务
|
||||||
2. 厂商 SVG logo,建议是正方形图片。
|
|
||||||
|
|
||||||
目前已支持的提供商, 复制 "-" 之前的字符串,作为 provider 的值。
|
#### 1. 申请 Sealos AI proxy API Key
|
||||||
|
|
||||||
- OpenAI
|
[点击打开 Sealos Pdf parser 官网](https://cloud.sealos.run/?uid=fnWRt09fZP&openapp=system-aiproxy),并进行对应 API Key 的申请。
|
||||||
- Claude
|
|
||||||
- Gemini
|
|
||||||
- MistralAI
|
|
||||||
- Qwen - 通义千问
|
|
||||||
- Doubao - 豆包
|
|
||||||
- ChatGLM - 智谱
|
|
||||||
- DeepSeek - 深度求索
|
|
||||||
- Moonshot - 月之暗面
|
|
||||||
- MiniMax
|
|
||||||
- SparkDesk - 讯飞星火
|
|
||||||
- Hunyuan - 腾讯混元
|
|
||||||
- Baichuan - 百川
|
|
||||||
- Yi - 零一万物
|
|
||||||
- Ernie - 文心一言
|
|
||||||
- Ollama
|
|
||||||
- Other - 其他
|
|
||||||
|
|
||||||
|
#### 2. 修改 FastGPT 配置文件
|
||||||
|
|
||||||
## ReRank 模型接入
|
`systemEnv.customPdfParse.url`填写成`https://aiproxy.hzh.sealos.run/v1/parse/pdf?model=parse-pdf`
|
||||||
|
`systemEnv.customPdfParse.key`填写成在 Sealos AI proxy 中申请的 API Key。
|
||||||
|
|
||||||
由于 OneAPI 不支持 Rerank 模型,所以需要单独配置接入,这里
|

|
||||||
|
|
||||||
|
### 使用 Doc2x 解析 PDF 文件
|
||||||
|
|
||||||
### 使用硅基流动的在线模型
|
`Doc2x`是一个国内提供专业 PDF 解析。
|
||||||
|
|
||||||
有免费的 `bge-reranker-v2-m3` 模型可以使用。
|
#### 1. 申请 Doc2x 服务
|
||||||
|
|
||||||
1. [点击注册硅基流动账号](https://cloud.siliconflow.cn/i/TR9Ym0c4)
|
[点击打开 Doc2x 官网](https://doc2x.noedgeai.com?inviteCode=9EACN2),并进行对应 API Key 的申请。
|
||||||
2. 进入控制台,获取 API key: https://cloud.siliconflow.cn/account/ak
|
|
||||||
3. 修改 FastGPT 配置文件
|
|
||||||
|
|
||||||
```json
|
#### 2. 修改 FastGPT 配置文件
|
||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### 私有部署模型
|
开源版用户在 `config.json` 文件中添加 `systemEnv.customPdfParse.doc2xKey` 配置,并填写上申请到的 API Key。并重启服务。
|
||||||
|
|
||||||
请使用 4.6.6-alpha 以上版本,配置文件中的 `reRankModels` 为重排模型,虽然是数组,不过目前仅有第1个生效。
|
商业版用户在 Admin 后台根据表单指引填写 Doc2x 服务密钥。
|
||||||
|
|
||||||
1. [部署 ReRank 模型](/docs/development/custom-models/bge-rerank/)
|
#### 3. 开始使用
|
||||||
1. 找到 FastGPT 的配置文件中的 `reRankModels`, 4.6.6 以前是 `ReRankModels`。
|
|
||||||
2. 修改对应的值:
|
|
||||||
|
|
||||||
```json
|
在知识库导入数据或应用文件上传配置中,可以勾选`PDF 增强解析`,则在对 PDF 解析时候,会使用 Doc2x 服务进行解析。
|
||||||
{
|
|
||||||
"reRankModels": [
|
### 使用 Marker 解析 PDF 文件
|
||||||
{
|
|
||||||
"model": "bge-reranker-base", // 随意
|
[点击查看 Marker 接入教程](/docs/development/custom-models/marker)
|
||||||
"name": "检索重排-base", // 随意
|
|
||||||
"charsPointsPrice": 0,
|
|
||||||
"requestUrl": "{{host}}/v1/rerank",
|
|
||||||
"requestAuth": "安全凭证,已自动补 Bearer"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
@@ -31,9 +31,9 @@ weight: 920
|
|||||||
|
|
||||||
3 个模型代码分别为:
|
3 个模型代码分别为:
|
||||||
|
|
||||||
1. [https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-base](https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-base)
|
1. [https://github.com/labring/FastGPT/tree/main/plugins/rerank-bge/bge-reranker-base](https://github.com/labring/FastGPT/tree/main/plugins/rerank-bge/bge-reranker-base)
|
||||||
2. [https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-large](https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-large)
|
2. [https://github.com/labring/FastGPT/tree/main/plugins/rerank-bge/bge-reranker-large](https://github.com/labring/FastGPT/tree/main/plugins/rerank-bge/bge-reranker-large)
|
||||||
3. [https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-v2-m3](https://github.com/labring/FastGPT/tree/main/python/bge-rerank/bge-reranker-v2-m3)
|
3. [https://github.com/labring/FastGPT/tree/main/plugins/rerank-bge/bge-reranker-v2-m3](https://github.com/labring/FastGPT/tree/main/plugins/rerank-bge/bge-reranker-v2-m3)
|
||||||
|
|
||||||
### 3. 安装依赖
|
### 3. 安装依赖
|
||||||
|
|
||||||
@@ -118,10 +118,17 @@ services:
|
|||||||
```
|
```
|
||||||
## 接入 FastGPT
|
## 接入 FastGPT
|
||||||
|
|
||||||
参考 [ReRank模型接入](/docs/development/configuration/#rerank-接入),host 变量为部署的域名。
|
1. 打开 FastGPT 模型配置,新增一个重排模型。
|
||||||
|
2. 填写模型配置表单:模型 ID 为`bge-reranker-base`,地址填写`{{host}}/v1/rerank`,host 为你部署的域名/IP:Port。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## QA
|
## QA
|
||||||
|
|
||||||
|
### 403报错
|
||||||
|
|
||||||
|
FastGPT中,自定义请求 Token 和环境变量的 ACCESS_TOKEN 不一致。
|
||||||
|
|
||||||
### Docker 运行提示 `Bus error (core dumped)`
|
### Docker 运行提示 `Bus error (core dumped)`
|
||||||
|
|
||||||
尝试增加 `docker-compose.yml` 配置项 `shm_size` ,以增加容器中的共享内存目录大小。
|
尝试增加 `docker-compose.yml` 配置项 `shm_size` ,以增加容器中的共享内存目录大小。
|
||||||
|
|||||||
@@ -11,39 +11,51 @@ weight: 909
|
|||||||
|
|
||||||
PDF 是一个相对复杂的文件格式,在 FastGPT 内置的 pdf 解析器中,依赖的是 pdfjs 库解析,该库基于逻辑解析,无法有效的理解复杂的 pdf 文件。所以我们在解析 pdf 时候,如果遇到图片、表格、公式等非简单文本内容,会发现解析效果不佳。
|
PDF 是一个相对复杂的文件格式,在 FastGPT 内置的 pdf 解析器中,依赖的是 pdfjs 库解析,该库基于逻辑解析,无法有效的理解复杂的 pdf 文件。所以我们在解析 pdf 时候,如果遇到图片、表格、公式等非简单文本内容,会发现解析效果不佳。
|
||||||
|
|
||||||
市面上目前有多种解析 PDF 的方法,比如使用 [Marker](https://github.com/VikParuchuri/marker),该项目使用了 Surya 模型,基于视觉解析,可以有效提取图片、表格、公式等复杂内容。为了可以让 Marker 快速接入 FastGPT,我们做了一个自定义解析的拓展 Demo。
|
市面上目前有多种解析 PDF 的方法,比如使用 [Marker](https://github.com/VikParuchuri/marker),该项目使用了 Surya 模型,基于视觉解析,可以有效提取图片、表格、公式等复杂内容。
|
||||||
|
|
||||||
在 FastGPT 4.8.15 版本中,你可以通过增加一个环境变量,来替换掉 FastGPT 系统内置解析器,实现自定义的文档解析服务。该功能只是 Demo 阶段,后期配置模式和交互规则会发生改动。
|
在 `FastGPT v4.9.0` 版本中,开源版用户可以在`config.json`文件中添加`systemEnv.customPdfParse`配置,来使用 Marker 解析 PDF 文件。商业版用户直接在 Admin 后台根据表单指引填写即可。需重新拉取 Marker 镜像,接口格式已变动。
|
||||||
|
|
||||||
## 使用教程
|
## 使用教程
|
||||||
|
|
||||||
### 1. 按照 Marker
|
### 1. 安装 Marker
|
||||||
|
|
||||||
参考文档 [Marker 安装教程](https://github.com/labring/FastGPT/tree/main/python/pdf-marker),安装 Marker 模型。封装的 API 已经适配了 FastGPT 自定义解析服务。
|
参考文档 [Marker 安装教程](https://github.com/labring/FastGPT/tree/main/plugins/model/pdf-marker),安装 Marker 模型。封装的 API 已经适配了 FastGPT 自定义解析服务。
|
||||||
|
|
||||||
这里介绍快速 Docker 安装的方法:
|
这里介绍快速 Docker 安装的方法:
|
||||||
|
|
||||||
```dockerfile
|
```dockerfile
|
||||||
docker pull crpi-h3snc261q1dosroc.cn-hangzhou.personal.cr.aliyuncs.com/marker11/marker_images:latest
|
docker pull crpi-h3snc261q1dosroc.cn-hangzhou.personal.cr.aliyuncs.com/marker11/marker_images:v0.2
|
||||||
docker run --gpus all -itd -p 7231:7231 --name model_pdf_v1 crpi-h3snc261q1dosroc.cn-hangzhou.personal.cr.aliyuncs.com/marker11/marker_images:latest
|
docker run --gpus all -itd -p 7231:7232 --name model_pdf_v2 -e PROCESSES_PER_GPU="2" crpi-h3snc261q1dosroc.cn-hangzhou.personal.cr.aliyuncs.com/marker11/marker_images:v0.2
|
||||||
|
```
|
||||||
|
### 2. 添加 FastGPT 文件配置
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
xxx
|
||||||
|
"systemEnv": {
|
||||||
|
xxx
|
||||||
|
"customPdfParse": {
|
||||||
|
"url": "http://xxxx.com/v2/parse/file", // 自定义 PDF 解析服务地址 marker v0.2
|
||||||
|
"key": "", // 自定义 PDF 解析服务密钥
|
||||||
|
"doc2xKey": "", // doc2x 服务密钥
|
||||||
|
"price": 0 // PDF 解析服务价格
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. 添加 FastGPT 环境变量
|
需要重启服务。
|
||||||
|
|
||||||
```
|
|
||||||
CUSTOM_READ_FILE_URL=http://xxxx.com/v1/parse/file
|
|
||||||
CUSTOM_READ_FILE_EXTENSION=pdf
|
|
||||||
```
|
|
||||||
|
|
||||||
* CUSTOM_READ_FILE_URL - 自定义解析服务的地址, host改成解析服务的访问地址,path 不能变动。
|
|
||||||
* CUSTOM_READ_FILE_EXTENSION - 支持的文件后缀,多个文件类型,可用逗号隔开。
|
|
||||||
|
|
||||||
### 3. 测试效果
|
### 3. 测试效果
|
||||||
|
|
||||||
通过知识库上传一个 pdf 文件,并确认上传,可以在日志中看到 LOG (LOG_LEVEL需要设置 info 或者 debug):
|
通过知识库上传一个 pdf 文件,并勾选上 `PDF 增强解析`。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
确认上传后,可以在日志中看到 LOG (LOG_LEVEL需要设置 info 或者 debug):
|
||||||
|
|
||||||
```
|
```
|
||||||
[Info] 2024-12-05 15:04:42 Parsing files from an external service
|
[Info] 2024-12-05 15:04:42 Parsing files from an external service
|
||||||
[Info] 2024-12-05 15:07:08 Custom file parsing is complete, time: 1316ms
|
[Info] 2024-12-05 15:07:08 Custom file parsing is complete, time: 1316ms
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -51,6 +63,10 @@ CUSTOM_READ_FILE_EXTENSION=pdf
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
同样的,在应用中,你可以在文件上传配置里,勾选上 `PDF 增强解析`。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
## 效果展示
|
## 效果展示
|
||||||
|
|
||||||
@@ -63,4 +79,25 @@ CUSTOM_READ_FILE_EXTENSION=pdf
|
|||||||
|
|
||||||
上图是分块后的结果,下图是 pdf 原文。整体图片、公式、表格都可以提取出来,效果还是杠杠的。
|
上图是分块后的结果,下图是 pdf 原文。整体图片、公式、表格都可以提取出来,效果还是杠杠的。
|
||||||
|
|
||||||
不过要注意的是,[Marker](https://github.com/VikParuchuri/marker) 的协议是`GPL-3.0 license`,请在遵守协议的前提下使用。
|
不过要注意的是,[Marker](https://github.com/VikParuchuri/marker) 的协议是`GPL-3.0 license`,请在遵守协议的前提下使用。
|
||||||
|
|
||||||
|
## 旧版 Marker 使用方法
|
||||||
|
|
||||||
|
FastGPT V4.9.0 版本之前,可以用以下方式,试用 Marker 解析服务。
|
||||||
|
|
||||||
|
安装和运行 Marker 服务:
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
docker pull crpi-h3snc261q1dosroc.cn-hangzhou.personal.cr.aliyuncs.com/marker11/marker_images:v0.1
|
||||||
|
docker run --gpus all -itd -p 7231:7231 --name model_pdf_v1 -e PROCESSES_PER_GPU="2" crpi-h3snc261q1dosroc.cn-hangzhou.personal.cr.aliyuncs.com/marker11/marker_images:v0.1
|
||||||
|
```
|
||||||
|
|
||||||
|
并修改 FastGPT 环境变量:
|
||||||
|
|
||||||
|
```
|
||||||
|
CUSTOM_READ_FILE_URL=http://xxxx.com/v1/parse/file
|
||||||
|
CUSTOM_READ_FILE_EXTENSION=pdf
|
||||||
|
```
|
||||||
|
|
||||||
|
* CUSTOM_READ_FILE_URL - 自定义解析服务的地址, host改成解析服务的访问地址,path 不能变动。
|
||||||
|
* CUSTOM_READ_FILE_EXTENSION - 支持的文件后缀,多个文件类型,可用逗号隔开。
|
||||||
@@ -144,7 +144,6 @@ curl --location --request POST 'https://<oneapi_url>/v1/chat/completions' \
|
|||||||
"usedInClassify": true, // 是否用于问题分类(务必保证至少有一个为true)
|
"usedInClassify": true, // 是否用于问题分类(务必保证至少有一个为true)
|
||||||
"usedInExtractFields": true, // 是否用于内容提取(务必保证至少有一个为true)
|
"usedInExtractFields": true, // 是否用于内容提取(务必保证至少有一个为true)
|
||||||
"usedInToolCall": true, // 是否用于工具调用(务必保证至少有一个为true)
|
"usedInToolCall": true, // 是否用于工具调用(务必保证至少有一个为true)
|
||||||
"usedInQueryExtension": true, // 是否用于问题优化(务必保证至少有一个为true)
|
|
||||||
"toolChoice": true, // 是否支持工具选择(分类,内容提取,工具调用会用到。)
|
"toolChoice": true, // 是否支持工具选择(分类,内容提取,工具调用会用到。)
|
||||||
"functionCall": false, // 是否支持函数调用(分类,内容提取,工具调用会用到。会优先使用 toolChoice,如果为false,则使用 functionCall,如果仍为 false,则使用提示词模式)
|
"functionCall": false, // 是否支持函数调用(分类,内容提取,工具调用会用到。会优先使用 toolChoice,如果为false,则使用 functionCall,如果仍为 false,则使用提示词模式)
|
||||||
"customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
|
"customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ toc: true
|
|||||||
weight: 707
|
weight: 707
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 前置知识
|
||||||
|
|
||||||
|
1. 基础的网络知识:端口,防火墙……
|
||||||
|
2. Docker 和 Docker Compose 基础知识
|
||||||
|
3. 大模型相关接口和参数
|
||||||
|
4. RAG 相关知识:向量模型,向量数据库,向量检索
|
||||||
|
|
||||||
## 部署架构图
|
## 部署架构图
|
||||||
|
|
||||||

|

|
||||||
@@ -23,19 +30,19 @@ weight: 707
|
|||||||
|
|
||||||
### PgVector版本
|
### PgVector版本
|
||||||
|
|
||||||
体验测试首选
|
非常轻量,适合知识库索引量在 5000 万以下。
|
||||||
|
|
||||||
{{< table "table-hover table-striped-columns" >}}
|
{{< table "table-hover table-striped-columns" >}}
|
||||||
| 环境 | 最低配置(单节点) | 推荐配置 |
|
| 环境 | 最低配置(单节点) | 推荐配置 |
|
||||||
| ---- | ---- | ---- |
|
| ---- | ---- | ---- |
|
||||||
| 测试 | 2c2g | 2c4g |
|
| 测试(可以把计算进程设置少一些) | 2c4g | 2c8g |
|
||||||
| 100w 组向量 | 4c8g 50GB | 4c16g 50GB |
|
| 100w 组向量 | 4c8g 50GB | 4c16g 50GB |
|
||||||
| 500w 组向量 | 8c32g 200GB | 16c64g 200GB |
|
| 500w 组向量 | 8c32g 200GB | 16c64g 200GB |
|
||||||
{{< /table >}}
|
{{< /table >}}
|
||||||
|
|
||||||
### Milvus版本
|
### Milvus版本
|
||||||
|
|
||||||
生产部署首选,对于千万级以上向量性能更优秀。
|
对于亿级以上向量性能更优秀。
|
||||||
|
|
||||||
[点击查看 Milvus 官方推荐配置](https://milvus.io/docs/prerequisite-docker.md)
|
[点击查看 Milvus 官方推荐配置](https://milvus.io/docs/prerequisite-docker.md)
|
||||||
|
|
||||||
@@ -111,7 +118,7 @@ brew install orbstack
|
|||||||
非 Linux 环境或无法访问外网环境,可手动创建一个目录,并下载配置文件和对应版本的`docker-compose.yml`,在这个文件夹中依据下载的配置文件运行docker,若作为本地开发使用推荐`docker-compose-pgvector`版本,并且自行拉取并运行`sandbox`和`fastgpt`,并在docker配置文件中注释掉`sandbox`和`fastgpt`的部分
|
非 Linux 环境或无法访问外网环境,可手动创建一个目录,并下载配置文件和对应版本的`docker-compose.yml`,在这个文件夹中依据下载的配置文件运行docker,若作为本地开发使用推荐`docker-compose-pgvector`版本,并且自行拉取并运行`sandbox`和`fastgpt`,并在docker配置文件中注释掉`sandbox`和`fastgpt`的部分
|
||||||
|
|
||||||
- [config.json](https://raw.githubusercontent.com/labring/FastGPT/refs/heads/main/projects/app/data/config.json)
|
- [config.json](https://raw.githubusercontent.com/labring/FastGPT/refs/heads/main/projects/app/data/config.json)
|
||||||
- [docker-compose.yml](https://github.com/labring/FastGPT/blob/main/files/docker) (注意,不同向量库版本的文件不一样)
|
- [docker-compose.yml](https://github.com/labring/FastGPT/blob/main/deploy/docker) (注意,不同向量库版本的文件不一样)
|
||||||
|
|
||||||
{{% alert icon="🤖" context="success" %}}
|
{{% alert icon="🤖" context="success" %}}
|
||||||
|
|
||||||
@@ -127,11 +134,11 @@ cd fastgpt
|
|||||||
curl -O https://raw.githubusercontent.com/labring/FastGPT/main/projects/app/data/config.json
|
curl -O https://raw.githubusercontent.com/labring/FastGPT/main/projects/app/data/config.json
|
||||||
|
|
||||||
# pgvector 版本(测试推荐,简单快捷)
|
# pgvector 版本(测试推荐,简单快捷)
|
||||||
curl -o docker-compose.yml https://raw.githubusercontent.com/labring/FastGPT/main/files/docker/docker-compose-pgvector.yml
|
curl -o docker-compose.yml https://raw.githubusercontent.com/labring/FastGPT/main/deploy/docker/docker-compose-pgvector.yml
|
||||||
# milvus 版本
|
# milvus 版本
|
||||||
# curl -o docker-compose.yml https://raw.githubusercontent.com/labring/FastGPT/main/files/docker/docker-compose-milvus.yml
|
# curl -o docker-compose.yml https://raw.githubusercontent.com/labring/FastGPT/main/deploy/docker/docker-compose-milvus.yml
|
||||||
# zilliz 版本
|
# zilliz 版本
|
||||||
# curl -o docker-compose.yml https://raw.githubusercontent.com/labring/FastGPT/main/files/docker/docker-compose-zilliz.yml
|
# curl -o docker-compose.yml https://raw.githubusercontent.com/labring/FastGPT/main/deploy/docker/docker-compose-zilliz.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. 修改环境变量
|
### 2. 修改环境变量
|
||||||
@@ -142,18 +149,14 @@ curl -o docker-compose.yml https://raw.githubusercontent.com/labring/FastGPT/mai
|
|||||||
{{< tab tabName="PgVector版本" >}}
|
{{< tab tabName="PgVector版本" >}}
|
||||||
{{< markdownify >}}
|
{{< markdownify >}}
|
||||||
|
|
||||||
```
|
无需操作
|
||||||
FE_DOMAIN=你的前端你访问地址,例如 http://192.168.0.1:3000;https://cloud.fastgpt.cn
|
|
||||||
```
|
|
||||||
|
|
||||||
{{< /markdownify >}}
|
{{< /markdownify >}}
|
||||||
{{< /tab >}}
|
{{< /tab >}}
|
||||||
{{< tab tabName="Milvus版本" >}}
|
{{< tab tabName="Milvus版本" >}}
|
||||||
{{< markdownify >}}
|
{{< markdownify >}}
|
||||||
|
|
||||||
```
|
无需操作
|
||||||
FE_DOMAIN=你的前端你访问地址,例如 http://192.168.0.1:3000;https://cloud.fastgpt.cn
|
|
||||||
```
|
|
||||||
|
|
||||||
{{< /markdownify >}}
|
{{< /markdownify >}}
|
||||||
{{< /tab >}}
|
{{< /tab >}}
|
||||||
@@ -167,7 +170,6 @@ FE_DOMAIN=你的前端你访问地址,例如 http://192.168.0.1:3000;https://clo
|
|||||||
{{% alert icon="🤖" context="success" %}}
|
{{% alert icon="🤖" context="success" %}}
|
||||||
|
|
||||||
1. 修改`MILVUS_ADDRESS`和`MILVUS_TOKEN`链接参数,分别对应 `zilliz` 的 `Public Endpoint` 和 `Api key`,记得把自己ip加入白名单。
|
1. 修改`MILVUS_ADDRESS`和`MILVUS_TOKEN`链接参数,分别对应 `zilliz` 的 `Public Endpoint` 和 `Api key`,记得把自己ip加入白名单。
|
||||||
2. 修改FE_DOMAIN=你的前端你访问地址,例如 http://192.168.0.1:3000;https://cloud.fastgpt.cn
|
|
||||||
|
|
||||||
{{% /alert %}}
|
{{% /alert %}}
|
||||||
|
|
||||||
@@ -182,28 +184,28 @@ FE_DOMAIN=你的前端你访问地址,例如 http://192.168.0.1:3000;https://clo
|
|||||||
```bash
|
```bash
|
||||||
# 启动容器
|
# 启动容器
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
# 等待10s,OneAPI第一次总是要重启几次才能连上Mysql
|
|
||||||
sleep 10
|
|
||||||
# 重启一次oneapi(由于OneAPI的默认Key有点问题,不重启的话会提示找不到渠道,临时手动重启一次解决,等待作者修复)
|
|
||||||
docker restart oneapi
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. 打开 OneAPI 添加模型
|
### 4. 访问 FastGPT
|
||||||
|
|
||||||
可以通过`ip:3001`访问OneAPI,默认账号为`root`密码为`123456`。
|
目前可以通过 `ip:3000` 直接访问(注意开放防火墙)。登录用户名为 `root`,密码为`docker-compose.yml`环境变量里设置的 `DEFAULT_ROOT_PSW`。
|
||||||
|
|
||||||
在OneApi中添加合适的AI模型渠道。[点击查看相关教程](/docs/development/modelconfig/one-api/)
|
|
||||||
|
|
||||||
### 5. 访问 FastGPT
|
|
||||||
|
|
||||||
目前可以通过 `ip:3000` 直接访问(注意防火墙)。登录用户名为 `root`,密码为`docker-compose.yml`环境变量里设置的 `DEFAULT_ROOT_PSW`。
|
|
||||||
|
|
||||||
如果需要域名访问,请自行安装并配置 Nginx。
|
如果需要域名访问,请自行安装并配置 Nginx。
|
||||||
|
|
||||||
首次运行,会自动初始化 root 用户,密码为 `1234`(与环境变量中的`DEFAULT_ROOT_PSW`一致),日志里会提示一次`MongoServerError: Unable to read from a snapshot due to pending collection catalog changes;`可忽略。
|
首次运行,会自动初始化 root 用户,密码为 `1234`(与环境变量中的`DEFAULT_ROOT_PSW`一致),日志可能会提示一次`MongoServerError: Unable to read from a snapshot due to pending collection catalog changes;`可忽略。
|
||||||
|
|
||||||
|
### 5. 配置模型
|
||||||
|
|
||||||
|
- 首次登录FastGPT后,系统会提示未配置`语言模型`和`索引模型`,并自动跳转模型配置页面。系统必须至少有这两类模型才能正常使用。
|
||||||
|
- 如果系统未正常跳转,可以在`账号-模型提供商`页面,进行模型配置。[点击查看相关教程](/docs/development/modelconfig/ai-proxy)
|
||||||
|
- 目前已知可能问题:首次进入系统后,整个浏览器 tab 无法响应。此时需要删除该tab,重新打开一次即可。
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
|
### 登录系统后,浏览器无法响应
|
||||||
|
|
||||||
|
无法点击任何内容,刷新也无效。此时需要删除该tab,重新打开一次即可。
|
||||||
|
|
||||||
### Mongo 副本集自动初始化失败
|
### Mongo 副本集自动初始化失败
|
||||||
|
|
||||||
最新的 docker-compose 示例优化 Mongo 副本集初始化,实现了全自动。目前在 unbuntu20,22 centos7, wsl2, mac, window 均通过测试。仍无法正常启动,大部分是因为 cpu 不支持 AVX 指令集,可以切换 Mongo4.x 版本。
|
最新的 docker-compose 示例优化 Mongo 副本集初始化,实现了全自动。目前在 unbuntu20,22 centos7, wsl2, mac, window 均通过测试。仍无法正常启动,大部分是因为 cpu 不支持 AVX 指令集,可以切换 Mongo4.x 版本。
|
||||||
|
|||||||
@@ -9,16 +9,52 @@ images: []
|
|||||||
|
|
||||||
## 一、错误排查方式
|
## 一、错误排查方式
|
||||||
|
|
||||||
遇到问题先按下面方式排查。
|
可以先找找[Issue](https://github.com/labring/FastGPT/issues),或新提 Issue,私有部署错误,务必提供详细的操作步骤、日志、截图,否则很难排查。
|
||||||
|
|
||||||
|
### 获取后端错误
|
||||||
|
|
||||||
1. `docker ps -a` 查看所有容器运行状态,检查是否全部 running,如有异常,尝试`docker logs 容器名`查看对应日志。
|
1. `docker ps -a` 查看所有容器运行状态,检查是否全部 running,如有异常,尝试`docker logs 容器名`查看对应日志。
|
||||||
2. 容器都运行正常的,`docker logs 容器名` 查看报错日志
|
2. 容器都运行正常的,`docker logs 容器名` 查看报错日志
|
||||||
3. 带有`requestId`的,都是 OneAPI 提示错误,大部分都是因为模型接口报错。
|
|
||||||
4. 无法解决时,可以找找[Issue](https://github.com/labring/FastGPT/issues),或新提 Issue,私有部署错误,务必提供详细的日志,否则很难排查。
|
|
||||||
|
|
||||||
|
### 前端错误
|
||||||
|
|
||||||
|
前端报错时,页面会出现崩溃,并提示检查控制台日志。可以打开浏览器控制台,并查看`console`中的 log 日志。还可以点击对应 log 的超链接,会提示到具体错误文件,可以把这些详细错误信息提供,方便排查。
|
||||||
|
|
||||||
|
### OneAPI 错误
|
||||||
|
|
||||||
|
带有`requestId`的,都是 OneAPI 提示错误,大部分都是因为模型接口报错。可以参考 [OneAPI 常见错误](/docs/development/faq/#三常见的-oneapi-错误)
|
||||||
|
|
||||||
## 二、通用问题
|
## 二、通用问题
|
||||||
|
|
||||||
|
### 前端页面崩溃
|
||||||
|
|
||||||
|
1. 90% 情况是模型配置不正确:确保每类模型都至少有一个启用;检查模型中一些`对象`参数是否异常(数组和对象),如果为空,可以尝试给个空数组或空对象。
|
||||||
|
2. 少部分是由于浏览器兼容问题,由于项目中包含一些高阶语法,可能低版本浏览器不兼容,可以将具体操作步骤和控制台中错误信息提供 issue。
|
||||||
|
3. 关闭浏览器翻译功能,如果浏览器开启了翻译,可能会导致页面崩溃。
|
||||||
|
|
||||||
|
### 通过sealos部署的话,是否没有本地部署的一些限制?
|
||||||
|
|
||||||
|

|
||||||
|
这是索引模型的长度限制,通过任何方式部署都一样的,但不同索引模型的配置不一样,可以在后台修改参数。
|
||||||
|
|
||||||
|
### 怎么挂载小程序配置文件
|
||||||
|
|
||||||
|
将验证文件,挂载到指定位置:/app/projects/app/public/xxxx.txt
|
||||||
|
|
||||||
|
然后重启。例如:
|
||||||
|
|
||||||
|

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

|
||||||
|
|
||||||
|
把端口映射改成 3307 之类的,例如 3307:3306。
|
||||||
|
|
||||||
|
### 本地部署的限制
|
||||||
|
|
||||||
|
具体内容参考https://fael3z0zfze.feishu.cn/wiki/OFpAw8XzAi36Guk8dfucrCKUnjg。
|
||||||
|
|
||||||
### 能否纯本地运行
|
### 能否纯本地运行
|
||||||
|
|
||||||
可以。需要准备好向量模型和LLM模型。
|
可以。需要准备好向量模型和LLM模型。
|
||||||
@@ -41,31 +77,6 @@ images: []
|
|||||||
1. 问题补全需要经过一轮AI生成。
|
1. 问题补全需要经过一轮AI生成。
|
||||||
2. 会进行3~5轮的查询,如果数据库性能不足,会有明显影响。
|
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 报错
|
### 页面中可以正常回复,API 报错
|
||||||
|
|
||||||
页面中是用 stream=true 模式,所以API也需要设置 stream=true 来进行测试。部分模型接口(国产居多)非 Stream 的兼容有点垃圾。
|
页面中是用 stream=true 模式,所以API也需要设置 stream=true 来进行测试。部分模型接口(国产居多)非 Stream 的兼容有点垃圾。
|
||||||
@@ -111,6 +122,13 @@ FastGPT 模型配置文件中的 model 必须与 OneAPI 渠道中的模型对应
|
|||||||
|
|
||||||
如果OneAPI中,没有配置对应的模型,`config.json`中也不要配置,否则容易报错。
|
如果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
|
### 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 运行一次)。
|
OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并重启容器(先 docker-compose down 然后再 docker-compose up -d 运行一次)。
|
||||||
@@ -124,8 +142,118 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并
|
|||||||
3. ....
|
3. ....
|
||||||
|
|
||||||
|
|
||||||
|
### Tiktoken 下载失败
|
||||||
|
|
||||||
|
由于 OneAPI 会在启动时从网络下载一个 tiktoken 的依赖,如果网络异常,就会导致启动失败。可以参考[OneAPI 离线部署](https://blog.csdn.net/wanh/article/details/139039216)解决。
|
||||||
|
|
||||||
## 四、常见模型问题
|
## 四、常见模型问题
|
||||||
|
|
||||||
|
### 如何检查模型可用性问题
|
||||||
|
|
||||||
|
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 直接结束了流请求,并且未返回任何内容导致。
|
该错误是由于 stream 模式下,oneapi 直接结束了流请求,并且未返回任何内容导致。
|
||||||
@@ -165,7 +293,7 @@ curl --location --request POST 'https://api.openai.com/v1/chat/completions' \
|
|||||||
|
|
||||||
需要模型提供商和 oneapi 同时支持工具调用才可使用,测试方法如下:
|
需要模型提供商和 oneapi 同时支持工具调用才可使用,测试方法如下:
|
||||||
|
|
||||||
1. 通过 `curl` 向 `oneapi` 发起第一轮 stream 模式的 tool 测试。
|
##### 1. 通过 `curl` 向 `oneapi` 发起第一轮 stream 模式的 tool 测试。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
|
curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
|
||||||
@@ -200,7 +328,7 @@ curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
|
|||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
|
|
||||||
2. 检查响应参数
|
##### 2. 检查响应参数
|
||||||
|
|
||||||
如果能正常调用工具,会返回对应 `tool_calls` 参数。
|
如果能正常调用工具,会返回对应 `tool_calls` 参数。
|
||||||
|
|
||||||
@@ -238,7 +366,7 @@ curl --location --request POST 'https://oneapi.xxx/v1/chat/completions' \
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
3. 通过 `curl` 向 `oneapi` 发起第二轮 stream 模式的 tool 测试。
|
##### 3. 通过 `curl` 向 `oneapi` 发起第二轮 stream 模式的 tool 测试。
|
||||||
|
|
||||||
第二轮请求是把工具结果发送给模型。发起后会得到模型回答的结果。
|
第二轮请求是把工具结果发送给模型。发起后会得到模型回答的结果。
|
||||||
|
|
||||||
@@ -293,3 +421,7 @@ curl --location --request POST 'https://oneapi.xxxx/v1/chat/completions' \
|
|||||||
"tool_choice": "auto"
|
"tool_choice": "auto"
|
||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 向量检索得分大于 1
|
||||||
|
|
||||||
|
由于模型没有归一化导致的。目前仅支持归一化的模型。
|
||||||
@@ -15,8 +15,8 @@ weight: 705
|
|||||||
|
|
||||||
- [Git](http://git-scm.com/)
|
- [Git](http://git-scm.com/)
|
||||||
- [Docker](https://www.docker.com/)(构建镜像)
|
- [Docker](https://www.docker.com/)(构建镜像)
|
||||||
- [Node.js v18.17 / v20.x](http://nodejs.org)(版本尽量一样,可以使用nvm管理node版本)
|
- [Node.js v20.14.0](http://nodejs.org)(版本尽量一样,可以使用nvm管理node版本)
|
||||||
- [pnpm](https://pnpm.io/) 版本 8.6.0 (目前官方的开发环境)
|
- [pnpm](https://pnpm.io/) 推荐版本 9.4.0 (目前官方的开发环境)
|
||||||
- make命令: 根据不同平台,百度安装 (官方是GNU Make 4.3)
|
- make命令: 根据不同平台,百度安装 (官方是GNU Make 4.3)
|
||||||
|
|
||||||
## 开始本地开发
|
## 开始本地开发
|
||||||
@@ -70,6 +70,7 @@ Mongo 数据库需要注意,需要注意在连接地址中增加 `directConnec
|
|||||||
|
|
||||||
- `vectorMaxProcess`: 向量生成最大进程,根据数据库和 key 的并发数来决定,通常单个 120 号,2c4g 服务器设置 10~15。
|
- `vectorMaxProcess`: 向量生成最大进程,根据数据库和 key 的并发数来决定,通常单个 120 号,2c4g 服务器设置 10~15。
|
||||||
- `qaMaxProcess`: QA 生成最大进程
|
- `qaMaxProcess`: QA 生成最大进程
|
||||||
|
- `vlmMaxProcess`: 图片理解模型最大进程
|
||||||
- `pgHNSWEfSearch`: PostgreSQL vector 索引参数,越大搜索精度越高但是速度越慢,具体可看 pgvector 官方说明。
|
- `pgHNSWEfSearch`: PostgreSQL vector 索引参数,越大搜索精度越高但是速度越慢,具体可看 pgvector 官方说明。
|
||||||
|
|
||||||
### 5. 运行
|
### 5. 运行
|
||||||
@@ -77,8 +78,6 @@ Mongo 数据库需要注意,需要注意在连接地址中增加 `directConnec
|
|||||||
可参考项目根目录下的 `dev.md`,第一次编译运行可能会有点慢,需要点耐心哦
|
可参考项目根目录下的 `dev.md`,第一次编译运行可能会有点慢,需要点耐心哦
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 给自动化脚本代码执行权限(非 linux 系统, 可以手动执行里面的 postinstall.sh 文件内容)
|
|
||||||
chmod -R +x ./scripts/
|
|
||||||
# 代码根目录下执行,会安装根 package、projects 和 packages 内所有依赖
|
# 代码根目录下执行,会安装根 package、projects 和 packages 内所有依赖
|
||||||
# 如果提示 isolate-vm 安装失败,可以参考:https://github.com/laverdet/isolated-vm?tab=readme-ov-file#requirements
|
# 如果提示 isolate-vm 安装失败,可以参考:https://github.com/laverdet/isolated-vm?tab=readme-ov-file#requirements
|
||||||
pnpm i
|
pnpm i
|
||||||
@@ -148,7 +147,7 @@ FastGPT 在`pnpm i`后会执行`postinstall`脚本,用于自动生成`ChakraUI
|
|||||||
|
|
||||||
## 加入社区
|
## 加入社区
|
||||||
|
|
||||||
遇到困难了吗?有任何问题吗? 加入微信群与开发者和用户保持沟通。
|
遇到困难了吗?有任何问题吗? 加入飞书群与开发者和用户保持沟通。
|
||||||
|
|
||||||
<img width="400px" src="https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png" class="medium-zoom-image" />
|
<img width="400px" src="https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png" class="medium-zoom-image" />
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,18 @@ draft: false
|
|||||||
images: []
|
images: []
|
||||||
---
|
---
|
||||||
|
|
||||||
## Copy文件
|
## 1. 停止服务
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose down
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## 2. Copy文件夹
|
||||||
|
|
||||||
Docker 部署数据库都会通过 volume 挂载本地的目录进入容器,如果要迁移,直接复制这些目录即可。
|
Docker 部署数据库都会通过 volume 挂载本地的目录进入容器,如果要迁移,直接复制这些目录即可。
|
||||||
|
|
||||||
`PG 数据`: pg/data
|
`PG 数据`: pg/data
|
||||||
`Mongo 数据`: mongo/data
|
`Mongo 数据`: mongo/data
|
||||||
|
|
||||||
|
直接把pg 和 mongo目录全部复制走即可。
|
||||||