Commit 470eeca0 by Finley Ge Committed by GitHub

V4.14.6 (#6263)

* feat: wecom integration (#6234)

* wip: wecom

* feat: template filter by user tag

* feat: wecom pay

* fix: some bug

* fix: zod error

* feat: bill

* fix: bill toast

* feat: forbidden downgrade plan button

* chore(fe): wecom zone

* chore: use queue to delete team instead of a session

* chore: adjust

* feat: wecom bill logic refactor

* perf: plan

* perf: plan

* fix: i18n

* chore: adjust

* feat: adjust

* feat: add wecom config

* perf: wecom app template recommendation & system tool preinstall

* perf: some variable and tip

* update create bill api schema

* update create bill api schema

* update create bill api schema

* feat: wecom

* chore: adjust

* fix: ts

* perf: condition order

* perf: condition order

---------

Co-authored-by: archer <545436317@qq.com>

* feat: system tool config tags (#6257)

* fix: system secret (#6259)

* fix: system secret

* chore: update docs

* chore: merge main (#6264)

* feat: wecom integration (#6234)

* wip: wecom

* feat: template filter by user tag

* feat: wecom pay

* fix: some bug

* fix: zod error

* feat: bill

* fix: bill toast

* feat: forbidden downgrade plan button

* chore(fe): wecom zone

* chore: use queue to delete team instead of a session

* chore: adjust

* feat: wecom bill logic refactor

* perf: plan

* perf: plan

* fix: i18n

* chore: adjust

* feat: adjust

* feat: add wecom config

* perf: wecom app template recommendation & system tool preinstall

* perf: some variable and tip

* update create bill api schema

* update create bill api schema

* update create bill api schema

* feat: wecom

* chore: adjust

* fix: ts

* perf: condition order

* perf: condition order

---------

Co-authored-by: archer <545436317@qq.com>

* feat: system tool config tags (#6257)

* fix: system secret (#6259)

* fix: system secret

* chore: update docs

---------

Co-authored-by: archer <545436317@qq.com>

* chore: update version number (#6266)

* fix: price status (#6279)

* fix: back button (#6281)

* team plan max file size & count (#6258)

* team plan max file size & count

* fix

* fix

* fix

* perf: presign url

* remove empty check

* remove empty check

* fix: ts

* fix: doc

* fix presign file

* perf: code

* perf: i18n

* fix: remove maxSize attribute

---------

Co-authored-by: archer <545436317@qq.com>
Co-authored-by: Finley Ge <finleyge@fastgpt.io>

* feat: marketplace batch update (#6299)

* feat: wecom integration (#6234)

* wip: wecom

* feat: template filter by user tag

* feat: wecom pay

* fix: some bug

* fix: zod error

* feat: bill

* fix: bill toast

* feat: forbidden downgrade plan button

* chore(fe): wecom zone

* chore: use queue to delete team instead of a session

* chore: adjust

* feat: wecom bill logic refactor

* perf: plan

* perf: plan

* fix: i18n

* chore: adjust

* feat: adjust

* feat: add wecom config

* perf: wecom app template recommendation & system tool preinstall

* perf: some variable and tip

* update create bill api schema

* update create bill api schema

* update create bill api schema

* feat: wecom

* chore: adjust

* fix: ts

* perf: condition order

* perf: condition order

---------

Co-authored-by: archer <545436317@qq.com>

* feat: system tool config tags (#6257)

* fix: system secret (#6259)

* fix: system secret

* chore: update docs

* chore: merge main (#6264)

* feat: wecom integration (#6234)

* wip: wecom

* feat: template filter by user tag

* feat: wecom pay

* fix: some bug

* fix: zod error

* feat: bill

* fix: bill toast

* feat: forbidden downgrade plan button

* chore(fe): wecom zone

* chore: use queue to delete team instead of a session

* chore: adjust

* feat: wecom bill logic refactor

* perf: plan

* perf: plan

* fix: i18n

* chore: adjust

* feat: adjust

* feat: add wecom config

* perf: wecom app template recommendation & system tool preinstall

* perf: some variable and tip

* update create bill api schema

* update create bill api schema

* update create bill api schema

* feat: wecom

* chore: adjust

* fix: ts

* perf: condition order

* perf: condition order

---------

Co-authored-by: archer <545436317@qq.com>

* feat: system tool config tags (#6257)

* fix: system secret (#6259)

* fix: system secret

* chore: update docs

---------

Co-authored-by: archer <545436317@qq.com>

* fix: custom domain limitation (#6265)

* chore: update version number (#6266)

* fix: price status (#6279)

* fix: back button (#6281)

* chore/rebase main (#6295)

* chore(deps): bump undici from 7.16.0 to 7.18.2 (#6272)

Bumps [undici](https://github.com/nodejs/undici) from 7.16.0 to 7.18.2.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v7.16.0...v7.18.2)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 7.18.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump undici in /plugins/webcrawler/SPIDER (#6273)

Bumps [undici](https://github.com/nodejs/undici) from 6.21.3 to 6.23.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.21.3...v6.23.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.23.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump tar from 7.4.3 to 7.5.3 in /document (#6282)

Bumps [tar](https://github.com/isaacs/node-tar) from 7.4.3 to 7.5.3.
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-tar/compare/v7.4.3...v7.5.3)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 7.5.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* perf: remove request invalid field (#6283)

* V4.14.5.1 dev (#6290)

* chore: cherry pick some commits from v4.14.6-dev (#6287)

* fix: custom domain limitation (#6265)

* fix: system secret (#6259)

* fix: system secret

* chore: update docs

* chore: docs

* fix password variable & datetime picker (#6276)

* fix password variable & datetime picker

* doc

* chore: cherry pick some commits from v4.14.6-dev (#6287)

* fix: custom domain limitation (#6265)

* fix: system secret (#6259)

* fix: system secret

* chore: update docs

* chore: docs

* doc

* chore: docs

---------

Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
Co-authored-by: Finley Ge <finleyge@fastgpt.io>

* perf: extname computed (#6285)

* perf: extname computed

* chore: handle hash or query flags

---------

Co-authored-by: Finley Ge <finleyge@fastgpt.io>

* chore: docs (#6291)

---------

Co-authored-by: heheer <heheer@sealos.io>
Co-authored-by: Archer <545436317@qq.com>

* chore: deploy scripts (#6293)

* docs: 41451 upgrade doc (#6294)

* feat: wecom integration (#6234)

* wip: wecom

* feat: template filter by user tag

* feat: wecom pay

* fix: some bug

* fix: zod error

* feat: bill

* fix: bill toast

* feat: forbidden downgrade plan button

* chore(fe): wecom zone

* chore: use queue to delete team instead of a session

* chore: adjust

* feat: wecom bill logic refactor

* perf: plan

* perf: plan

* fix: i18n

* chore: adjust

* feat: adjust

* feat: add wecom config

* perf: wecom app template recommendation & system tool preinstall

* perf: some variable and tip

* update create bill api schema

* update create bill api schema

* update create bill api schema

* feat: wecom

* chore: adjust

* fix: ts

* perf: condition order

* perf: condition order

---------

Co-authored-by: archer <545436317@qq.com>

* feat: system tool config tags (#6257)

* fix: price status (#6279)

* fix: back button (#6281)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Archer <545436317@qq.com>
Co-authored-by: heheer <heheer@sealos.io>

* feat: marketplace batch update

* chore: components reuse

* fix: test case

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: archer <545436317@qq.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: heheer <heheer@sealos.io>

* fix: upload file size limit && batch update plugin ui (#6308)

* fix: batch update drawer ui && custom plan logic

* fix: max upload file size

* chore: remove comment

* fix: plan-status (#6311)

* fix: price page (#6313)

* fix: plan ui

* fix: custom standard plan (#6317)

* fix: system tool route & batch update drawer ui (#6318)

* fix: system tool route

* chore: upgrade docs

* chore: batch update ui

* fix: marketplace tool detail readme height (#6324)

* fix: marketplace tool detail readme height

* chore: use useRequest2

* chore: adapt new plugin sdk (#6334)

* chore: adapt new plugin sdk

* chore: bump @fastgpt-sdk/plugin to 0.3.6; fix type error

---------

Co-authored-by: Finley Ge <finleyge@fastgpt.io>
Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>

* fix: marketplace batch update drawer button background (#6340)

* chore: useRequest2 -> useRequest

* #6193 feat(SeekDB): 集成支持 SeekDB 向量数据库 (#6338)

* #6193 feat(SeekDB): 集成支持 SeekDB 向量数据库

- 添加 SEEKDB_ADDRESS 环境变量支持
- 在 vectorDB 控制器中优先返回 SeekVectorCtrl 实例
- 新增 SeekDB 向量库控制器,复用 OceanBase 控制器实现
- 更新部署文档,新增 SeekDB 相关描述和配置说明
- 新增 SeekDB 的 Docker Compose 配置,支持国内和全球镜像
- 在开发文档中添加 SeekDB 的环境要求及特性介绍
- 修改部署脚本支持 SeekDB 版本快速部署

* fix(vectorDB): add type annotation to getVectorObj to resolve TypeScript compilation error

- Add return type annotation (: VectorControllerType) to getVectorObj function
- Fixes Docker build failure: Property 'insertIds' does not exist on type 'unknown'
- The Vector object now has correct type inference for retryFn

Related: Docker build fails at TypeScript type checking stage

* #6193 refactor(vectorDB): 调整 SeekDB 控制器导入方式

- 将 ObClient 和 ObVectorCtrl 分开导入,提升代码清晰度
- 将导出语句拆分为两行,便于后续维护
- 保持 OceanBase 控制器复用逻辑不变
- 优化代码格式,增强可读性

* doc

---------

Co-authored-by: archer <545436317@qq.com>

* fix date time picker disabled status (#6352)

* fix date time picker disabled status

* fix build

* fix: copilot review

* perf: claude review

* fix: ts

* chore: docs, type (#6350)

* fix: mock (#6354)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: archer <545436317@qq.com>
Co-authored-by: heheer <heheer@sealos.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: roy <whoeverimf5@gmail.com>
Co-authored-by: flying~dragon <58673960+flying-dragon-ai@users.noreply.github.com>
parent 0686ceff
......@@ -13,7 +13,8 @@
"milvus-minio": "RELEASE.2023-03-20T20-16-18Z",
"milvus-etcd": "v3.5.5",
"milvus-standalone": "v2.4.3",
"oceanbase": "4.3.5-lts"
"oceanbase": "4.3.5-lts",
"seekdb": "1.0.1.0-100000392025122619"
},
"images": {
"cn": {
......@@ -30,7 +31,8 @@
"milvus-minio": "minio/minio",
"milvus-etcd": "quay.io/coreos/etcd",
"milvus-standalone": "milvusdb/milvus",
"oceanbase": "oceanbase/oceanbase-ce"
"oceanbase": "oceanbase/oceanbase-ce",
"seekdb": "oceanbase/seekdb"
},
"global": {
"fastgpt": "ghcr.io/labring/fastgpt",
......@@ -46,7 +48,8 @@
"milvus-minio": "minio/minio",
"milvus-etcd": "quay.io/coreos/etcd",
"milvus-standalone": "milvusdb/milvus",
"oceanbase": "oceanbase/oceanbase-ce"
"oceanbase": "oceanbase/oceanbase-ce",
"seekdb": "oceanbase/seekdb"
}
}
}
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3005:3000
# - 建议修改账密后再运行
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@mongo:27017/fastgpt?authSource=admin
DB_MAX_LINK: 100
REDIS_URL: redis://default:mypassword@redis:6379
# @see https://fastgpt.cn/docs/introduction/development/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
# 向量库相关配置
x-vec-config: &x-vec-config
SEEKDB_URL: mysql://root%40tenantname:tenantpassword@seekdb:3306/fastgpt
version: '3.3'
services:
# Vector DB
vectorDB:
image: oceanbase/seekdb:1.0.1.0-100000392025122619
container_name: seekdb
restart: always
# ports: # 生产环境建议不要暴露
# - 3306:3306
networks:
- fastgpt
environment:
# SeekDB 连接配置(兼容 MySQL 协议)
- MYSQL_ROOT_PASSWORD=seekdbpassword
# SeekDB 租户配置(与 OceanBase 兼容)
- OB_TENANT_NAME=tenantname
- OB_TENANT_PASSWORD=tenantpassword
# MODE分为MINI和NORMAL, 后者会最大程度使用主机资源
- MODE=MINI
- OB_SERVER_IP=127.0.0.1
volumes:
- ../seekdb/data:/var/lib/mysql
- ../seekdb/config:/etc/mysql/conf.d
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
interval: 30s
timeout: 10s
retries: 1000
start_period: 10s
mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: mongo
restart: always
networks:
- fastgpt
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- ./mongo/data:/data/db
healthcheck:
test:
[
'CMD',
'mongo',
'-u',
'myusername',
'-p',
'mypassword',
'--authenticationDatabase',
'admin',
'--eval',
"db.adminCommand('ping')"
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
redis:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/redis:7.2-alpine
container_name: redis
networks:
- fastgpt
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ['CMD', 'redis-cli', '-a', 'mypassword', 'ping']
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- ./redis/data:/data
fastgpt-minio:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- fastgpt
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- ./fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
fastgpt:
container_name: fastgpt
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.14.5.1 # git
ports:
- 3000:3000
networks:
- fastgpt
depends_on:
- mongo
- sandbox
- vectorDB
restart: always
environment:
<<: [*x-share-db-config, *x-vec-config]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
DEFAULT_ROOT_PSW: 1234
# 登录凭证密钥
TOKEN_KEY: any
# root的密钥,常用于升级时候的初始化请求
ROOT_KEY: root_key
# 文件阅读加密
FILE_TOKEN_KEY: filetoken
# 密钥加密key
AES256_SECRET_KEY: fastgptkey
# plugin 地址
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
# sandbox 地址
SANDBOX_URL: http://sandbox:3000
# AI Proxy 的地址,如果配了该地址,优先使用
AIPROXY_API_ENDPOINT: http://aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
# 日志等级: debug, info, warn, error
LOG_LEVEL: info
STORE_LOG_LEVEL: warn
# 工作流最大运行次数
WORKFLOW_MAX_RUN_TIMES: 1000
# 批量执行节点,最大输入长度
WORKFLOW_MAX_LOOP_TIMES: 100
# 对话文件过期天数
CHAT_FILE_EXPIRE_TIME: 7
# 服务器接收请求,最大大小,单位 MB
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# HTML 转换最大字符数
MAX_HTML_TRANSFORM_CHARS: 1000000
volumes:
- ./config.json:/app/data/config.json
sandbox:
container_name: sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.14.5.1
networks:
- fastgpt
restart: always
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.5.1
networks:
- fastgpt
ports:
- 3005:3000
restart: always
environment:
- FASTGPT_ENDPOINT=http://fastgpt:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.4.0
container_name: fastgpt-plugin
restart: always
networks:
- fastgpt
environment:
<<: *x-share-db-config
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
depends_on:
fastgpt-minio:
condition: service_healthy
# AI Proxy
aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.3.2
container_name: aiproxy
restart: unless-stopped
depends_on:
aiproxy_pg:
condition: service_healthy
networks:
- fastgpt
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@aiproxy_pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/status']
interval: 5s
timeout: 5s
retries: 10
aiproxy_pg:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: aiproxy_pg
volumes:
- ./aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
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:
fastgpt:
aiproxy:
vector:
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3005:3000
# - 建议修改账密后再运行
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@mongo:27017/fastgpt?authSource=admin
DB_MAX_LINK: 100
REDIS_URL: redis://default:mypassword@redis:6379
# @see https://fastgpt.cn/docs/introduction/development/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
# 向量库相关配置
x-vec-config: &x-vec-config
SEEKDB_URL: mysql://root%40tenantname:tenantpassword@seekdb:3306/fastgpt
version: '3.3'
services:
# Vector DB
vectorDB:
image: oceanbase/seekdb:1.0.1.0-100000392025122619
container_name: seekdb
restart: always
# ports: # 生产环境建议不要暴露
# - 3306:3306
networks:
- fastgpt
environment:
# SeekDB 连接配置(兼容 MySQL 协议)
- MYSQL_ROOT_PASSWORD=seekdbpassword
# SeekDB 租户配置(与 OceanBase 兼容)
- OB_TENANT_NAME=tenantname
- OB_TENANT_PASSWORD=tenantpassword
# MODE分为MINI和NORMAL, 后者会最大程度使用主机资源
- MODE=MINI
- OB_SERVER_IP=127.0.0.1
volumes:
- ../seekdb/data:/var/lib/mysql
- ../seekdb/config:/etc/mysql/conf.d
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 30s
timeout: 10s
retries: 1000
start_period: 10s
mongo:
image: mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: mongo
restart: always
networks:
- fastgpt
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- ./mongo/data:/data/db
healthcheck:
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
redis:
image: redis:7.2-alpine
container_name: redis
networks:
- fastgpt
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ['CMD', 'redis-cli', '-a', 'mypassword', 'ping']
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- ./redis/data:/data
fastgpt-minio:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- fastgpt
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- ./fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
fastgpt:
container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.14.5.1 # git
ports:
- 3000:3000
networks:
- fastgpt
depends_on:
- mongo
- sandbox
- vectorDB
restart: always
environment:
<<: [*x-share-db-config, *x-vec-config]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
DEFAULT_ROOT_PSW: 1234
# 登录凭证密钥
TOKEN_KEY: any
# root的密钥,常用于升级时候的初始化请求
ROOT_KEY: root_key
# 文件阅读加密
FILE_TOKEN_KEY: filetoken
# 密钥加密key
AES256_SECRET_KEY: fastgptkey
# plugin 地址
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
# sandbox 地址
SANDBOX_URL: http://sandbox:3000
# AI Proxy 的地址,如果配了该地址,优先使用
AIPROXY_API_ENDPOINT: http://aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
# 日志等级: debug, info, warn, error
LOG_LEVEL: info
STORE_LOG_LEVEL: warn
# 工作流最大运行次数
WORKFLOW_MAX_RUN_TIMES: 1000
# 批量执行节点,最大输入长度
WORKFLOW_MAX_LOOP_TIMES: 100
# 对话文件过期天数
CHAT_FILE_EXPIRE_TIME: 7
# 服务器接收请求,最大大小,单位 MB
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# HTML 转换最大字符数
MAX_HTML_TRANSFORM_CHARS: 1000000
volumes:
- ./config.json:/app/data/config.json
sandbox:
container_name: sandbox
image: ghcr.io/labring/fastgpt-sandbox:v4.14.5.1
networks:
- fastgpt
restart: always
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.5.1
networks:
- fastgpt
ports:
- 3005:3000
restart: always
environment:
- FASTGPT_ENDPOINT=http://fastgpt:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.4.0
container_name: fastgpt-plugin
restart: always
networks:
- fastgpt
environment:
<<: *x-share-db-config
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
depends_on:
fastgpt-minio:
condition: service_healthy
# AI Proxy
aiproxy:
image: ghcr.io/labring/aiproxy:v0.3.2
container_name: aiproxy
restart: unless-stopped
depends_on:
aiproxy_pg:
condition: service_healthy
networks:
- fastgpt
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@aiproxy_pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
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
restart: unless-stopped
container_name: aiproxy_pg
volumes:
- ./aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
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:
fastgpt:
aiproxy:
vector:
......@@ -17,28 +17,8 @@ const VectorEnum = {
pg: 'pg',
milvus: 'milvus',
zilliz: 'zilliz',
ob: 'ob'
};
/**
* @enum {string} Services
*/
const Services = {
fastgpt: 'fastgpt',
fastgptPlugin: 'fastgpt-plugin',
fastgptSandbox: 'fastgpt-sandbox',
fastgptMcpServer: 'fastgpt-mcp_server',
minio: 'minio',
mongo: 'mongo',
redis: 'redis',
aiproxy: 'aiproxy',
aiproxyPg: 'aiproxy-pg',
// vectors
pg: 'pg',
milvusMinio: 'milvus-minio',
milvusEtcd: 'milvus-etcd',
milvusStandalone: 'milvus-standalone',
oceanbase: 'oceanbase'
ob: 'ob',
seekdb: 'seekdb'
};
// make sure the cwd
......@@ -105,7 +85,14 @@ configs:
content: |
ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30;
`
}
},
seekdb: {
db: '',
config: `\
SEEKDB_URL: mysql://root%40tenantname:tenantpassword@seekdb:3306/fastgpt
`,
extra: ``
},
};
/**
......@@ -148,6 +135,9 @@ const replace = (source, region, vec) => {
const ob = fs.readFileSync(path.join(process.cwd(), 'templates', 'vector', 'ob.txt'));
vector.ob.db = String(ob);
const seekdb = fs.readFileSync(path.join(process.cwd(), 'templates', 'vector', 'seekdb.txt'));
vector.seekdb.db = String(seekdb);
}
const generateDevFile = async () => {
......@@ -211,6 +201,14 @@ const generateProdFile = async () => {
fs.promises.writeFile(
path.join(process.cwd(), 'docker', 'global', 'docker-compose.oceanbase.yml'),
replace(template, 'global', VectorEnum.ob)
),
fs.promises.writeFile(
path.join(process.cwd(), 'docker', 'cn', 'docker-compose.seekdb.yml'),
replace(template, 'cn', VectorEnum.seekdb)
),
fs.promises.writeFile(
path.join(process.cwd(), 'docker', 'global', 'docker-compose.seekdb.yml'),
replace(template, 'global', VectorEnum.seekdb)
)
]);
......
......@@ -12,7 +12,7 @@ x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@mongo:27017/fastgpt?authSource=admin
DB_MAX_LINK: 100
REDIS_URL: redis://default:mypassword@redis:6379
# @see https://fastgpt.cn/docs/introduction/development/object-storage
# @see https://doc.fastgpt.cn/docs/introduction/development/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
......
vectorDB:
image: ${{seekdb.image}}:${{seekdb.tag}}
container_name: seekdb
restart: always
# ports: # 生产环境建议不要暴露
# - 3306:3306
networks:
- fastgpt
environment:
# SeekDB 连接配置(兼容 MySQL 协议)
- MYSQL_ROOT_PASSWORD=seekdbpassword
# SeekDB 租户配置(与 OceanBase 兼容)
- OB_TENANT_NAME=tenantname
- OB_TENANT_PASSWORD=tenantpassword
# MODE分为MINI和NORMAL, 后者会最大程度使用主机资源
- MODE=MINI
- OB_SERVER_IP=127.0.0.1
volumes:
- ../seekdb/data:/var/lib/mysql
- ../seekdb/config:/etc/mysql/conf.d
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 30s
timeout: 10s
retries: 1000
start_period: 10s
......@@ -19,7 +19,7 @@ import { Alert } from '@/components/docs/Alert';
<Alert icon="🤖" context="success">
- MongoDB:用于存储除了向量外的各类数据
- PostgreSQL/Milvus/Oceanbase:存储向量数据
- PostgreSQL/Milvus/Oceanbase/SeekDB:存储向量数据
- AIProxy: 聚合各类 AI API,支持多模型调用 (任何模型问题,先自行通过 OneAPI 测试校验)
</Alert>
......@@ -54,6 +54,26 @@ Zilliz Cloud 由 Milvus 原厂打造,是全托管的 SaaS 向量数据库服
由于向量库使用了 Cloud,无需占用本地资源,无需太关注。
### SeekDB版本
SeekDB 是基于 MySQL 协议的高性能向量数据库,与 OceanBase 协议完全兼容,支持高效的向量检索。
| 环境 | 最低配置(单节点) | 推荐配置 |
| -------------------------------- | ------------------ | ------------ |
| 测试(可以把计算进程设置少一些) | 2c4g | 2c8g |
| 100w 组向量 | 4c8g 50GB | 4c16g 50GB |
| 500w 组向量 | 8c32g 200GB | 16c64g 200GB |
<Alert icon="🤖" context="success">
SeekDB 使用 MySQL 协议,与 OceanBase 完全兼容:
- 支持 1536 维向量检索
- 内置 HNSW 索引算法
- 提供批量插入和查询优化
- 自动重试和连接池管理
</Alert>
## 前置工作
### 1. 确保网络环境
......@@ -103,7 +123,7 @@ brew install orbstack
#### 方法一:使用脚本部署
<Tabs items={['PgVector版本','Oceanbase版本','Milvus版本','Zilliz版本']}>
<Tabs items={['PgVector版本','Oceanbase版本','Milvus版本','Zilliz版本','SeekDB版本']}>
<Tab value="PgVector版本">
国内镜像(阿里云)
......@@ -163,6 +183,29 @@ bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh) --region=global --ve
zilliz 还需要获取密钥,参考 [部署 Zilliz 版本获取账号和密钥](#部署-zilliz-版本获取账号和密钥)
</Tab>
<Tab value="SeekDB版本">
国内镜像(阿里云)
```bash
bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh) --region=cn --vector=seekdb
```
非国内镜像(dockhub, ghcr)
```bash
bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh) --region=global --vector=seekdb
```
需要在 Linux/MacOS/Windows WSL 环境下执行
<Alert icon="🤖" context="success">
SeekDB 使用 MySQL 协议,兼容 OceanBase 的所有特性:
- 端口:3306(默认)
- 连接字符串格式:`mysql://root%40tenantname:password@host:3306/database`
- 环境变量:`SEEKDB_URL`
</Alert>
</Tab>
</Tabs>
#### 方法二:手动下载部署
......@@ -181,6 +224,9 @@ bash <(curl -fsSL https://doc.fastgpt.cn/deploy/install.sh) --region=global --ve
- Zilliz
- 中国大陆地区镜像源(阿里云):[docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.zilliz.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.zilliz.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.zilliz.yml)
- SeekDB
- 中国大陆地区镜像源(阿里云):[docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/cn/docker-compose.seekdb.yml)
- 全球镜像源(dockerhub, ghcr):[docker-compose.seekdb.yml](https://doc.fastgpt.cn/deploy/docker/global/docker-compose.seekdb.yml)
下载 config.json 文件
- [config.json](https://doc.fastgpt.cn/deploy/config/config.json)
......
......@@ -3,43 +3,49 @@ title: 'V4.14.6(进行中)'
description: 'FastGPT V4.14.6 更新说明'
---
## 🚀 新增内容
1. Markdown 表格支持导出 csv。
2. 系统工具可配置自定义的分类属性
## 更新指南
### 1. 更新镜像:
- 更新 FastGPT 镜像tag: v4.14.6
- 更新 FastGPT 商业版镜像tag: v4.14.6
- 更新 FastGPT 镜像 tag: v4.14.6
- 更新 FastGPT 商业版镜像 tag: v4.14.6
- 更新 fastgpt-plugin 镜像 tag: v0.4.0
- mcp_server 无需更新
- Sandbox 无需更新
- sandbox 无需更新
- AIProxy 无需更新
- mongo 5.x 版本修改成 5.0.32 版本,解决 CVE-2025-14847 漏洞。直接修改镜像 tag 成 `5.0.32`。
- mongo 无需更新
### 2. 执行升级脚本
## 🚀 新增内容
从任意终端,发起 1 个 HTTP 请求。其中 `{{rootkey}}` 替换成环境变量里的 `rootkey`;`{{host}}` 替换成**FastGPT 域名**。
1. 系统工具可配置自定义的分类属性。
2. 订阅套餐支持配置最大文件上传数量和大小。
3. 插件市场支持批量更新插件。
4. 云服务支持企微特定版接入。
5. Seekdb 向量库预设配置。
```bash
curl --location --request POST 'https://{{host}}/api/admin/initv4146' \
--header 'rootkey: {{rootkey}}' \
--header 'Content-Type: application/json'
```
1. 迁移系统工具的系统密钥配置
## ⚙️ 优化
### 功能优化
1. 工作流触摸板移动时,遇到输入框后会被强制阻拦。
2. 工作流粘贴节点,精确按鼠标位置粘贴。
3. 精确移除请求 LLM 时多余的系统字段,避免部分模型接口报错。
### 代码质量
1. useRequest2 替代 useRequest。
## 🐛 修复
1. 系统工具工具集设置系统密钥后,子工具无法读取到设置的系统密钥
2. 日期选择器溢出问题,增加了动态位置适配。
3. 工作流编排页面系统工具“探索更多”跳转地址错误
4. 模型头像缺省值 /imgs/model/huggingface.svg 路径错误
## 插件
1. 添加飞书多维表格的引导教程文档
2. 企微相关的插件:获取企微企业 access_token; 企微智能表工具集
3. 新增模型 qwen-flash
4. 调整 qwen3-max 和 qwen-plus 的预设参数
......@@ -20,7 +20,7 @@
"document/content/docs/introduction/development/custom-models/xinference.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/design/dataset.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/development/design/design_plugin.mdx": "2025-11-06T14:47:55+08:00",
"document/content/docs/introduction/development/docker.mdx": "2026-01-09T18:25:02+08:00",
"document/content/docs/introduction/development/docker.mdx": "2026-01-30T16:01:13+08:00",
"document/content/docs/introduction/development/faq.mdx": "2025-08-12T22:22:18+08:00",
"document/content/docs/introduction/development/intro.mdx": "2025-09-29T11:34:11+08:00",
"document/content/docs/introduction/development/migration/docker_db.mdx": "2025-07-23T21:35:03+08:00",
......@@ -124,7 +124,7 @@
"document/content/docs/upgrading/4-14/4144.mdx": "2025-12-16T14:56:04+08:00",
"document/content/docs/upgrading/4-14/4145.mdx": "2026-01-18T23:59:15+08:00",
"document/content/docs/upgrading/4-14/41451.mdx": "2026-01-20T11:53:27+08:00",
"document/content/docs/upgrading/4-14/4146.mdx": "2026-01-27T13:43:06+08:00",
"document/content/docs/upgrading/4-14/4146.mdx": "2026-01-26T17:46:44+08:00",
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",
......@@ -198,7 +198,7 @@
"document/content/docs/use-cases/app-cases/google_search.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/use-cases/app-cases/lab_appointment.mdx": "2025-12-10T20:07:05+08:00",
"document/content/docs/use-cases/app-cases/multi_turn_translation_bot.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/use-cases/app-cases/submit_application_template.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/use-cases/app-cases/submit_application_template.mdx": "2026-01-27T15:19:19+08:00",
"document/content/docs/use-cases/app-cases/translate-subtitle-using-gpt.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/use-cases/external-integration/dingtalk.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/use-cases/external-integration/feishu.mdx": "2025-07-24T14:23:04+08:00",
......
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3005:3000
# - 建议修改账密后再运行
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@mongo:27017/fastgpt?authSource=admin
DB_MAX_LINK: 100
REDIS_URL: redis://default:mypassword@redis:6379
# @see https://fastgpt.cn/docs/introduction/development/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
# 向量库相关配置
x-vec-config: &x-vec-config
SEEKDB_URL: mysql://root%40tenantname:tenantpassword@seekdb:3306/fastgpt
version: '3.3'
services:
# Vector DB
vectorDB:
image: oceanbase/seekdb:1.0.1.0-100000392025122619
container_name: seekdb
restart: always
# ports: # 生产环境建议不要暴露
# - 3306:3306
networks:
- fastgpt
environment:
# SeekDB 连接配置(兼容 MySQL 协议)
- MYSQL_ROOT_PASSWORD=seekdbpassword
# SeekDB 租户配置(与 OceanBase 兼容)
- OB_TENANT_NAME=tenantname
- OB_TENANT_PASSWORD=tenantpassword
# MODE分为MINI和NORMAL, 后者会最大程度使用主机资源
- MODE=MINI
- OB_SERVER_IP=127.0.0.1
volumes:
- ../seekdb/data:/var/lib/mysql
- ../seekdb/config:/etc/mysql/conf.d
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 30s
timeout: 10s
retries: 1000
start_period: 10s
mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: mongo
restart: always
networks:
- fastgpt
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- ./mongo/data:/data/db
healthcheck:
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
redis:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/redis:7.2-alpine
container_name: redis
networks:
- fastgpt
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ['CMD', 'redis-cli', '-a', 'mypassword', 'ping']
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- ./redis/data:/data
fastgpt-minio:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- fastgpt
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- ./fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
fastgpt:
container_name: fastgpt
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.14.5.1 # git
ports:
- 3000:3000
networks:
- fastgpt
depends_on:
- mongo
- sandbox
- vectorDB
restart: always
environment:
<<: [*x-share-db-config, *x-vec-config]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
DEFAULT_ROOT_PSW: 1234
# 登录凭证密钥
TOKEN_KEY: any
# root的密钥,常用于升级时候的初始化请求
ROOT_KEY: root_key
# 文件阅读加密
FILE_TOKEN_KEY: filetoken
# 密钥加密key
AES256_SECRET_KEY: fastgptkey
# plugin 地址
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
# sandbox 地址
SANDBOX_URL: http://sandbox:3000
# AI Proxy 的地址,如果配了该地址,优先使用
AIPROXY_API_ENDPOINT: http://aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
# 日志等级: debug, info, warn, error
LOG_LEVEL: info
STORE_LOG_LEVEL: warn
# 工作流最大运行次数
WORKFLOW_MAX_RUN_TIMES: 1000
# 批量执行节点,最大输入长度
WORKFLOW_MAX_LOOP_TIMES: 100
# 对话文件过期天数
CHAT_FILE_EXPIRE_TIME: 7
# 服务器接收请求,最大大小,单位 MB
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# HTML 转换最大字符数
MAX_HTML_TRANSFORM_CHARS: 1000000
volumes:
- ./config.json:/app/data/config.json
sandbox:
container_name: sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.14.5.1
networks:
- fastgpt
restart: always
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.14.5.1
networks:
- fastgpt
ports:
- 3005:3000
restart: always
environment:
- FASTGPT_ENDPOINT=http://fastgpt:3000
fastgpt-plugin:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.4.0
container_name: fastgpt-plugin
restart: always
networks:
- fastgpt
environment:
<<: *x-share-db-config
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
depends_on:
fastgpt-minio:
condition: service_healthy
# AI Proxy
aiproxy:
image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.3.2
container_name: aiproxy
restart: unless-stopped
depends_on:
aiproxy_pg:
condition: service_healthy
networks:
- fastgpt
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@aiproxy_pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
DISABLE_MODEL_CONFIG: true
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/status']
interval: 5s
timeout: 5s
retries: 10
aiproxy_pg:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:0.8.0-pg15 # docker hub
restart: unless-stopped
container_name: aiproxy_pg
volumes:
- ./aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
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:
fastgpt:
aiproxy:
vector:
# 用于部署的 docker-compose 文件:
# - FastGPT 端口映射为 3000:3000
# - FastGPT-mcp-server 端口映射 3005:3000
# - 建议修改账密后再运行
# plugin auth token
x-plugin-auth-token: &x-plugin-auth-token 'token'
# aiproxy token
x-aiproxy-token: &x-aiproxy-token 'token'
# 数据库连接相关配置
x-share-db-config: &x-share-db-config
MONGODB_URI: mongodb://myusername:mypassword@mongo:27017/fastgpt?authSource=admin
DB_MAX_LINK: 100
REDIS_URL: redis://default:mypassword@redis:6379
# @see https://fastgpt.cn/docs/introduction/development/object-storage
STORAGE_VENDOR: minio # minio | aws-s3 | cos | oss
STORAGE_REGION: us-east-1
STORAGE_ACCESS_KEY_ID: minioadmin
STORAGE_SECRET_ACCESS_KEY: minioadmin
STORAGE_PUBLIC_BUCKET: fastgpt-public
STORAGE_PRIVATE_BUCKET: fastgpt-private
STORAGE_EXTERNAL_ENDPOINT: http://192.168.0.2:9000 # 一个服务器和客户端均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)
STORAGE_S3_ENDPOINT: http://fastgpt-minio:9000 # 协议://域名(IP):端口
STORAGE_S3_FORCE_PATH_STYLE: true
STORAGE_S3_MAX_RETRIES: 3
# 向量库相关配置
x-vec-config: &x-vec-config
SEEKDB_URL: mysql://root%40tenantname:tenantpassword@seekdb:3306/fastgpt
version: '3.3'
services:
# Vector DB
vectorDB:
image: oceanbase/seekdb:1.0.1.0-100000392025122619
container_name: seekdb
restart: always
# ports: # 生产环境建议不要暴露
# - 3306:3306
networks:
- fastgpt
environment:
# SeekDB 连接配置(兼容 MySQL 协议)
- MYSQL_ROOT_PASSWORD=seekdbpassword
# SeekDB 租户配置(与 OceanBase 兼容)
- OB_TENANT_NAME=tenantname
- OB_TENANT_PASSWORD=tenantpassword
# MODE分为MINI和NORMAL, 后者会最大程度使用主机资源
- MODE=MINI
- OB_SERVER_IP=127.0.0.1
volumes:
- ../seekdb/data:/var/lib/mysql
- ../seekdb/config:/etc/mysql/conf.d
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 30s
timeout: 10s
retries: 1000
start_period: 10s
mongo:
image: mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
container_name: mongo
restart: always
networks:
- fastgpt
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- ./mongo/data:/data/db
healthcheck:
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
# 等待MongoDB服务启动
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
echo "Waiting for MongoDB to start..."
sleep 2
done
# 执行初始化副本集的脚本
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
wait $$!
redis:
image: redis:7.2-alpine
container_name: redis
networks:
- fastgpt
restart: always
command: |
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
healthcheck:
test: ['CMD', 'redis-cli', '-a', 'mypassword', 'ping']
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
volumes:
- ./redis/data:/data
fastgpt-minio:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
container_name: fastgpt-minio
restart: always
ports:
- 9000:9000
- 9001:9001
networks:
- fastgpt
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- ./fastgpt-minio:/data
command: server /data --console-address ":9001"
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
fastgpt:
container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.14.5.1 # git
ports:
- 3000:3000
networks:
- fastgpt
depends_on:
- mongo
- sandbox
- vectorDB
restart: always
environment:
<<: [*x-share-db-config, *x-vec-config]
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
FE_DOMAIN:
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
DEFAULT_ROOT_PSW: 1234
# 登录凭证密钥
TOKEN_KEY: any
# root的密钥,常用于升级时候的初始化请求
ROOT_KEY: root_key
# 文件阅读加密
FILE_TOKEN_KEY: filetoken
# 密钥加密key
AES256_SECRET_KEY: fastgptkey
# plugin 地址
PLUGIN_BASE_URL: http://fastgpt-plugin:3000
PLUGIN_TOKEN: *x-plugin-auth-token
# sandbox 地址
SANDBOX_URL: http://sandbox:3000
# AI Proxy 的地址,如果配了该地址,优先使用
AIPROXY_API_ENDPOINT: http://aiproxy:3000
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
AIPROXY_API_TOKEN: *x-aiproxy-token
# 日志等级: debug, info, warn, error
LOG_LEVEL: info
STORE_LOG_LEVEL: warn
# 工作流最大运行次数
WORKFLOW_MAX_RUN_TIMES: 1000
# 批量执行节点,最大输入长度
WORKFLOW_MAX_LOOP_TIMES: 100
# 对话文件过期天数
CHAT_FILE_EXPIRE_TIME: 7
# 服务器接收请求,最大大小,单位 MB
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# HTML 转换最大字符数
MAX_HTML_TRANSFORM_CHARS: 1000000
volumes:
- ./config.json:/app/data/config.json
sandbox:
container_name: sandbox
image: ghcr.io/labring/fastgpt-sandbox:v4.14.5.1
networks:
- fastgpt
restart: always
fastgpt-mcp-server:
container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.14.5.1
networks:
- fastgpt
ports:
- 3005:3000
restart: always
environment:
- FASTGPT_ENDPOINT=http://fastgpt:3000
fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.4.0
container_name: fastgpt-plugin
restart: always
networks:
- fastgpt
environment:
<<: *x-share-db-config
AUTH_TOKEN: *x-plugin-auth-token
# 工具网络请求,最大请求和响应体
SERVICE_REQUEST_MAX_CONTENT_LENGTH: 10
# 最大 API 请求体大小
MAX_API_SIZE: 10
depends_on:
fastgpt-minio:
condition: service_healthy
# AI Proxy
aiproxy:
image: ghcr.io/labring/aiproxy:v0.3.2
container_name: aiproxy
restart: unless-stopped
depends_on:
aiproxy_pg:
condition: service_healthy
networks:
- fastgpt
- aiproxy
environment:
# 对应 fastgpt 里的AIPROXY_API_TOKEN
ADMIN_KEY: *x-aiproxy-token
# 错误日志详情保存时间(小时)
LOG_DETAIL_STORAGE_HOURS: 1
# 数据库连接地址
SQL_DSN: postgres://postgres:aiproxy@aiproxy_pg:5432/aiproxy
# 最大重试次数
RETRY_TIMES: 3
# 不需要计费
BILLING_ENABLED: false
# 不需要严格检测模型
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
restart: unless-stopped
container_name: aiproxy_pg
volumes:
- ./aiproxy_pg:/var/lib/postgresql/data
networks:
- aiproxy
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:
fastgpt:
aiproxy:
vector:
......@@ -18,6 +18,12 @@ export const formatTime2YMD = (time?: Date | number) =>
export const formatTime2HM = (time: Date = new Date()) => dayjs(time).format('HH:mm');
/**
* 格式化为带时区偏移的 ISO-8601 字符串
*/
export const formatToISOWithTimezone = (time?: Date | number) =>
time ? dayjs(time).format('YYYY-MM-DDTHH:mm:ss.SSSZ') : '';
/**
* 格式化时间成聊天格式
*/
export const formatTimeToChatTime = (time: Date) => {
......
......@@ -66,6 +66,7 @@ export type FastGPTFeConfigsType = {
show_aiproxy?: boolean;
show_coupon?: boolean;
show_discount_coupon?: boolean;
showWecomConfig?: boolean;
concatMd?: string;
show_dataset_feishu?: boolean;
......@@ -105,14 +106,15 @@ export type FastGPTFeConfigsType = {
tenantId?: string;
customButton?: string;
};
wecom?: boolean;
};
limit?: {
exportDatasetLimitMinutes?: number;
websiteSyncLimitMinuted?: number;
};
uploadFileMaxAmount?: number;
uploadFileMaxSize?: number;
uploadFileMaxAmount: number;
uploadFileMaxSize: number; // MB
evalFileMaxLines?: number;
// Compute by systemEnv.customPdfParse
......
......@@ -10,6 +10,7 @@ import type { I18nStringStrictType } from '../../../common/i18n/type';
import type { I18nStringType } from '../../../common/i18n/type';
import type { ToolSimpleType, ToolDetailType } from '../../../sdk/fastgpt-plugin';
import type { PluginStatusType, SystemPluginToolTagType } from '../../plugin/type';
import type { UserTagsEnum } from '../../../support/user/type';
export type AppToolRuntimeType = {
id: string;
......@@ -61,6 +62,10 @@ export type AppToolTemplateItemType = WorkflowTemplateType & {
inputListVal?: Record<string, any>;
hasSystemSecret?: boolean;
// User tag filtering
hideTags?: UserTagsEnum[] | null;
promoteTags?: UserTagsEnum[] | null;
// @deprecated use tags instead
isActive?: boolean;
templateType?: string;
......
......@@ -15,7 +15,7 @@ import type { AppPermission } from '../../support/permission/app/controller';
import type { ParentIdType } from '../../common/parentFolder/type';
import { FlowNodeInputTypeEnum } from '../../core/workflow/node/constant';
import type { WorkflowTemplateBasicType } from '@fastgpt/global/core/workflow/type';
import type { SourceMemberType } from '../../support/user/type';
import type { SourceMemberType, UserTagsEnum } from '../../support/user/type';
import type { JSONSchemaInputType, JSONSchemaOutputType } from './jsonschema';
export type AppSchema = {
......@@ -234,6 +234,8 @@ export type AppTemplateSchemaType = {
author?: string;
isActive?: boolean;
isPromoted?: boolean;
promoteTags?: UserTagsEnum[];
hideTags?: UserTagsEnum[];
recommendText?: string;
userGuide?: {
type: 'markdown' | 'link';
......
import { ParentIdSchema } from '../../../../common/parentFolder/type';
import { SystemToolBasicConfigSchema, ToolSecretInputItemSchema } from '../../tool/type';
import z from 'zod';
import { UserTagsEnum } from '../../../../support/user/type';
export const AdminSystemToolListItemSchema = SystemToolBasicConfigSchema.extend({
id: z.string(),
......@@ -33,6 +34,8 @@ export const AdminSystemToolDetailSchema = AdminSystemToolListItemSchema.omit({
userGuide: z.string().nullish(),
inputList: z.array(ToolSecretInputItemSchema).optional(),
inputListVal: z.record(z.string(), z.any()).nullish(),
childTools: z.array(ToolsetChildSchema).optional()
childTools: z.array(ToolsetChildSchema).optional(),
promoteTags: z.array(UserTagsEnum).nullish().describe('对拥有这些 Tag 的用户推荐, 排序到前面'),
hideTags: z.array(UserTagsEnum).nullish().describe('对拥有这些 Tag 的用户隐藏')
});
export type AdminSystemToolDetailType = z.infer<typeof AdminSystemToolDetailSchema>;
import z from 'zod';
import { PluginStatusEnum, PluginStatusSchema } from '../type';
import { UserTagsEnum } from '../../../support/user/type';
// 无论哪种 Tool,都会有这一层配置
export const SystemToolBasicConfigSchema = z.object({
......@@ -14,6 +15,8 @@ export const SystemToolBasicConfigSchema = z.object({
export const SystemPluginToolCollectionSchema = SystemToolBasicConfigSchema.extend({
pluginId: z.string(),
promoteTags: z.array(UserTagsEnum).nullish(),
hideTags: z.array(UserTagsEnum).nullish(),
customConfig: z
.object({
name: z.string(),
......
......@@ -6,6 +6,7 @@ import {
import z from 'zod';
import { ParentIdSchema } from '../../../../../common/parentFolder/type';
import { PluginStatusSchema } from '../../../../../core/plugin/type';
import { UserTagsEnum } from '../../../../../support/user/type';
// Admin tool list
export const GetAdminSystemToolsQuery = z.object({
......@@ -47,6 +48,8 @@ export const UpdateToolBodySchema = z.object({
hasTokenFee: z.boolean().optional(),
inputListVal: z.record(z.string(), z.any()).nullish(),
childTools: z.array(UpdateChildToolSchema).optional(),
promoteTags: z.array(UserTagsEnum).nullish(),
hideTags: z.array(UserTagsEnum).nullish(),
// App tool fields
name: z.string().optional(),
......
......@@ -57,7 +57,12 @@ export const GetSystemInstalledPluginsResponseSchema = z.object({
list: z.array(
z.object({
id: z.string(),
version: z.string()
version: z.string(),
name: z.any().optional(),
description: z.any().optional(),
icon: z.string().optional(),
author: z.string().optional(),
tags: z.array(z.string()).optional()
})
)
});
......
import z from 'zod';
export const PluginGetAccessTokenBodySchema = z.object({
toolId: z.string(),
teamId: z.string(),
tmbId: z.string()
});
export const PluginGetAccessTokenResponseSchema = z.object({
accessToken: z.string()
});
export type PluginGetAccessTokenBodyType = z.infer<typeof PluginGetAccessTokenBodySchema>;
export type PluginGetAccessTokenResponseType = z.infer<typeof PluginGetAccessTokenResponseSchema>;
import { z } from 'zod';
export const WecomGetRedirectURLBodySchema = z.object({
redirectUri: z.string(),
state: z.string(),
isWecomWorkTerminal: z.boolean()
});
export const WecomGetRedirectURLResponseSchema = z.string();
export type WecomGetRedirectURLBodyType = z.infer<typeof WecomGetRedirectURLBodySchema>;
export type WecomGetRedirectURLResponseType = z.infer<typeof WecomGetRedirectURLResponseSchema>;
import z from 'zod';
export const TeamChangeOwnerBodySchema = z.object({
userId: z.string().describe("the New Owner's UserId.")
});
export const TeamChangeOwnerResponseSchema = z.object();
export type TeamChangeOwnerBodyType = z.infer<typeof TeamChangeOwnerBodySchema>;
export type TeamChangeOwnerResponseType = z.infer<typeof TeamChangeOwnerResponseSchema>;
......@@ -93,17 +93,21 @@ export const UpdateBillResponseSchema = z
.object({
qrCode: z.string().optional().meta({ description: '支付二维码 URL' }),
iframeCode: z.string().optional().meta({ description: '支付 iframe 代码' }),
markdown: z.string().optional().meta({ description: 'Markdown 格式的支付信息' })
markdown: z.string().optional().meta({ description: 'Markdown 格式的支付信息' }),
payUrl: z.string().optional().meta({ description: '支付跳转 URL(企微支付)' }),
metadata: z.any().nullish().meta({ description: '支付元数据' })
})
.refine((data) => data.qrCode || data.iframeCode || data.markdown, {
message: 'At least one of qrCode, iframeCode, or markdown must be provided'
.refine((data) => data.qrCode || data.iframeCode || data.markdown || data.payUrl, {
message: 'At least one of qrCode, iframeCode, markdown, or payUrl must be provided'
});
export type UpdateBillResponseType = z.infer<typeof UpdateBillResponseSchema>;
export const CreateBillResponseSchema = UpdateBillResponseSchema.safeExtend({
billId: z.string().meta({ description: '订单 ID' }),
billId: ObjectIdSchema.optional().meta({ description: '订单 ID' }),
readPrice: z.number().min(0).meta({ description: '实际支付价格' }),
payment: z.enum(BillPayWayEnum).meta({ description: '支付方式' })
}).meta({
description: '创建订单响应。企微支付时候,billId 为空'
});
export type CreateBillResponseType = z.infer<typeof CreateBillResponseSchema>;
......
import { z } from 'zod';
export const WecomGetCorpTokenBodySchema = z.object({});
export const WecomGetCorpTokenQuerySchema = z.object({});
export const WecomGetCorpTokenResponseSchema = z.object({
access_token: z.string(),
expires_in: z.number()
});
export type WecomGetCorpTokenBodyType = z.infer<typeof WecomGetCorpTokenBodySchema>;
export type WecomGetCorpTokenQueryType = z.infer<typeof WecomGetCorpTokenQuerySchema>;
export type WecomGetCorpTokenResponseType = z.infer<typeof WecomGetCorpTokenResponseSchema>;
......@@ -2,7 +2,7 @@
"name": "@fastgpt/global",
"version": "1.0.0",
"dependencies": {
"@fastgpt-sdk/plugin": "0.2.17",
"@fastgpt-sdk/plugin": "0.3.6",
"@apidevtools/swagger-parser": "^10.1.0",
"@bany/curl-to-json": "^1.2.8",
"axios": "^1.13.2",
......
......@@ -16,5 +16,6 @@ export enum OAuthEnum {
google = 'google',
wechat = 'wechat',
microsoft = 'microsoft',
wecom = 'wecom',
sso = 'sso'
}
import { PermissionValueType } from '../../permission/type';
import type { TeamMetaType } from '../type';
import type { TeamMemberRoleEnum } from './constant';
import type { TeamMemberSchema, ThirdPartyAccountType } from './type';
import { LafAccountType } from './type';
......@@ -14,6 +15,7 @@ export type CreateTeamProps = {
memberName?: string;
memberAvatar?: string;
notificationAccount?: string;
meta?: TeamMetaType;
};
export type UpdateTeamProps = Omit<ThirdPartyAccountType, 'externalWorkflowVariable'> & {
name?: string;
......
import type { UserModelSchema } from '../type';
import type { TeamMetaType, UserModelSchema } from '../type';
import type { TeamMemberRoleEnum, TeamMemberStatusEnum } from './constant';
import type { LafAccountType } from './type';
import { PermissionValueType, ResourcePermissionType } from '../../permission/type';
......@@ -23,6 +23,8 @@ export type TeamSchema = {
lastWebsiteSyncTime: Date;
};
notificationAccount?: string;
meta?: TeamMetaType;
deleteTime?: Date;
} & ThirdPartyAccountType;
export type tagsType = {
......@@ -68,6 +70,7 @@ export type TeamTmbItemType = {
status: `${TeamMemberStatusEnum}`;
notificationAccount?: string;
permission: TeamPermission;
isWecomTeam?: boolean;
} & ThirdPartyAccountType;
export type TeamMemberItemType<
......
......@@ -5,6 +5,13 @@ import { TeamMemberStatusEnum } from './team/constant';
import type { TeamTmbItemType } from './team/type';
import z from 'zod';
export const UserTagsEnum = z.enum(['wecom']);
export type UserTagsEnum = z.infer<typeof UserTagsEnum>;
export type UserMetaType = {
isActivatedWecomLicense?: boolean;
};
export type UserModelSchema = {
_id: string;
username: string;
......@@ -22,6 +29,8 @@ export type UserModelSchema = {
keyword: string;
};
contact?: string;
tags: UserTagsEnum[];
meta?: UserMetaType;
};
export type UserType = {
......@@ -34,6 +43,7 @@ export type UserType = {
team: TeamTmbItemType;
permission: TeamPermission;
contact?: string;
tags?: UserTagsEnum[];
};
export const SourceMemberSchema = z.object({
......@@ -44,3 +54,14 @@ export const SourceMemberSchema = z.object({
.meta({ example: TeamMemberStatusEnum.active, description: '成员状态' })
});
export type SourceMemberType = z.infer<typeof SourceMemberSchema>;
export const TeamMetaSchema = z.object({
wecom: z
.object({
permanentCode: z.string(),
corpId: z.string()
})
.optional()
});
export type TeamMetaType = z.infer<typeof TeamMetaSchema>;
......@@ -47,7 +47,8 @@ export enum BillPayWayEnum {
wx = 'wx',
alipay = 'alipay',
bank = 'bank',
coupon = 'coupon'
coupon = 'coupon',
wecom = 'wecom'
}
export const billPayWayMap = {
......@@ -65,6 +66,9 @@ export const billPayWayMap = {
},
[BillPayWayEnum.coupon]: {
label: i18nT('account_bill:payway_coupon')
},
[BillPayWayEnum.wecom]: {
label: i18nT('common:support.wallet.bill.payWay.wecom')
}
};
......
......@@ -22,6 +22,9 @@ export const TeamStandardSubPlanItemSchema = z.object({
ticketResponseTime: z.int().optional(), // 工单支持时间
customDomain: z.int().optional(), // 自定义域名数量
maxUploadFileSize: z.int().optional(), // 最大上传文件大小(MB)
maxUploadFileCount: z.int().optional(), // 最大上传文件数量
// 定制套餐
priceDescription: z.string().optional(), // 价格描述
customFormUrl: z.string().optional(), // 自定义表单 URL
......@@ -30,6 +33,14 @@ export const TeamStandardSubPlanItemSchema = z.object({
// Active
annualBonusPoints: z.int().optional(), // 年度赠送积分
/** 企微设置 */
wecom: z
.object({
price: z.number().describe('企微价格'),
points: z.number().describe('企微积分')
})
.nullish(),
// @deprecated
pointPrice: z.number().optional()
});
......@@ -88,7 +99,9 @@ export const TeamSubSchema = z.object({
appRegistrationCount: z.int().optional(),
auditLogStoreDuration: z.int().optional(),
ticketResponseTime: z.int().optional(),
customDomain: z.int().optional()
customDomain: z.int().optional(),
maxUploadFileSize: z.int().optional(),
maxUploadFileCount: z.int().optional()
});
export type TeamSubSchemaType = z.infer<typeof TeamSubSchema>;
......
......@@ -27,6 +27,7 @@ export enum QueueNames {
// Delete Queue
datasetDelete = 'datasetDelete',
appDelete = 'appDelete',
teamDelete = 'teamDelete',
// @deprecated
websiteSync = 'websiteSync'
}
......
......@@ -37,7 +37,7 @@ export const multer = {
},
preservePath: true,
storage: this._storage
}).array('file', global.feConfigs?.uploadFileMaxSize);
}).array('file', global.feConfigs.uploadFileMaxAmount);
},
resolveFormData<T extends Record<string, any>>({
......
......@@ -3,7 +3,7 @@ import fs from 'fs';
import path from 'path';
export const getFileMaxSize = () => {
const mb = global.feConfigs?.uploadFileMaxSize || 1000;
const mb = global.feConfigs.uploadFileMaxSize || 1000;
return mb * 1024 * 1024;
};
......
......@@ -34,7 +34,7 @@ export const S3Buckets = {
} as const;
export const getSystemMaxFileSize = () => {
const config = global.feConfigs?.uploadFileMaxSize || 1024; // MB, default 1024MB
const config = global.feConfigs.uploadFileMaxSize || 1024; // MB, default 1024MB
return config; // bytes
};
......
......@@ -58,11 +58,15 @@ export class S3ChatSource extends S3PrivateBucket {
}
async createUploadChatFileURL(params: CheckChatFileKeys) {
const { appId, chatId, uId, filename, expiredTime } = ChatFileUploadSchema.parse(params);
const { appId, chatId, uId, filename, expiredTime, maxFileSize } =
ChatFileUploadSchema.parse(params);
const { fileKey } = getFileS3Key.chat({ appId, chatId, uId, filename });
return await this.createPresignedPutUrl(
{ rawKey: fileKey, filename },
{ expiredHours: expiredTime ? differenceInHours(expiredTime, new Date()) : 24 }
{
expiredHours: expiredTime ? differenceInHours(expiredTime, new Date()) : 24,
maxFileSize
}
);
}
......
......@@ -6,7 +6,8 @@ export const ChatFileUploadSchema = z.object({
chatId: z.string().nonempty(),
uId: z.string().nonempty(),
filename: z.string().nonempty(),
expiredTime: z.date().optional()
expiredTime: z.date().optional(),
maxFileSize: z.number().positive().optional()
});
export type CheckChatFileKeys = z.infer<typeof ChatFileUploadSchema>;
......
......@@ -44,9 +44,12 @@ export class S3DatasetSource extends S3PrivateBucket {
// 上传链接
async createUploadDatasetFileURL(params: CreateUploadDatasetFileParams) {
const { filename, datasetId } = CreateUploadDatasetFileParamsSchema.parse(params);
const { filename, datasetId, maxFileSize } = CreateUploadDatasetFileParamsSchema.parse(params);
const { fileKey } = getFileS3Key.dataset({ datasetId, filename });
return await this.createPresignedPutUrl({ rawKey: fileKey, filename }, { expiredHours: 3 });
return await this.createPresignedPutUrl(
{ rawKey: fileKey, filename },
{ expiredHours: 3, maxFileSize }
);
}
// 单个键删除
......
......@@ -4,7 +4,8 @@ import { z } from 'zod';
export const CreateUploadDatasetFileParamsSchema = z.object({
filename: z.string().nonempty(),
datasetId: ObjectIdSchema
datasetId: ObjectIdSchema,
maxFileSize: z.number().positive().optional()
});
export type CreateUploadDatasetFileParams = z.infer<typeof CreateUploadDatasetFileParamsSchema>;
......
......@@ -16,6 +16,8 @@ export const initFastGPTConfig = (config?: FastGPTConfigFileType) => {
!!config.systemEnv.customPdfParse?.textinAppId ||
!!config.systemEnv.customPdfParse?.doc2xKey;
config.feConfigs.customPdfParsePrice = config.systemEnv.customPdfParse?.price || 0;
config.feConfigs.uploadFileMaxSize = Number(process.env.UPLOAD_FILE_MAX_SIZE || 1000);
config.feConfigs.uploadFileMaxAmount = Number(process.env.UPLOAD_FILE_MAX_AMOUNT || 1000);
global.feConfigs = config.feConfigs;
global.systemEnv = config.systemEnv;
......
......@@ -3,6 +3,7 @@ export const DatasetVectorTableName = 'modeldata';
export const PG_ADDRESS = process.env.PG_URL;
export const OCEANBASE_ADDRESS = process.env.OCEANBASE_URL;
export const SEEKDB_ADDRESS = process.env.SEEKDB_URL;
export const MILVUS_ADDRESS = process.env.MILVUS_ADDRESS;
export const MILVUS_TOKEN = process.env.MILVUS_TOKEN;
......
/* vector crud */
import { PgVectorCtrl } from './pg';
import { ObVectorCtrl } from './oceanbase';
import { SeekVectorCtrl } from './seekdb';
import { getVectorsByText } from '../../core/ai/embedding';
import type { VectorControllerType, InsertVectorControllerPropsType } from './type';
import { type EmbeddingModelItemType } from '@fastgpt/global/core/ai/model.d';
import { MILVUS_ADDRESS, PG_ADDRESS, OCEANBASE_ADDRESS } from './constants';
import { MILVUS_ADDRESS, PG_ADDRESS, OCEANBASE_ADDRESS, SEEKDB_ADDRESS } from './constants';
import { MilvusCtrl } from './milvus';
import {
setRedisCache,
......@@ -17,9 +18,10 @@ import {
import { throttle } from 'lodash';
import { retryFn } from '@fastgpt/global/common/system/utils';
const getVectorObj = () => {
if (PG_ADDRESS) return new PgVectorCtrl();
const getVectorObj = (): VectorControllerType => {
if (SEEKDB_ADDRESS) return new SeekVectorCtrl();
if (OCEANBASE_ADDRESS) return new ObVectorCtrl();
if (PG_ADDRESS) return new PgVectorCtrl();
if (MILVUS_ADDRESS) return new MilvusCtrl();
return new PgVectorCtrl();
......
/**
* SeekDB Vector Database Controller
*
* SeekDB 使用 MySQL 协议,与 OceanBase 完全兼容
* 直接复用 OceanBase 的控制器实现
*/
// 导出 OceanBase 控制器(复用)
export { ObClient as SeekClient } from '../oceanbase/controller';
export { ObVectorCtrl as SeekVectorCtrl } from '../oceanbase';
// 导出类型
export type { VectorControllerType } from '../type';
......@@ -112,11 +112,10 @@ export const loadSystemModels = async (init = false, language = 'en') => {
// Get model from db and plugin
const [dbModels, systemModels] = await Promise.all([
MongoSystemModel.find({}).lean(),
pluginClient.model.list().then((res) => {
if (res.status === 200) return res.body;
console.error('Get fastGPT plugin model error');
return [];
})
pluginClient
.listModels()
.then((res) => res)
.catch(() => [])
]);
// Load system model from local
......@@ -249,13 +248,9 @@ export const getSystemModelConfig = async (model: string): Promise<SystemModelIt
if (modelData.isCustom) return Promise.reject('Custom model not data');
// Read file
const modelDefaulConfig = await pluginClient.model.list().then((res) => {
if (res.status === 200) {
return res.body.find((item) => item.model === model) as SystemModelItemType;
}
return Promise.reject('Can not get model config from plugin');
});
const modelDefaulConfig = await pluginClient
.listModels()
.then((models) => models.find((item) => item.model === model) as SystemModelItemType);
return {
...modelDefaulConfig,
......
......@@ -11,7 +11,8 @@ export const initAppDeleteWorker = () => {
return getWorker<AppDeleteJobData>(QueueNames.appDelete, appDeleteProcessor, {
concurrency: 1, // 确保同时只有1个删除任务
removeOnFail: {
age: 30 * 24 * 60 * 60 // 保留30天失败记录
age: 90 * 24 * 60 * 60, // 保留90天失败记录
count: 10000 // 最多保留10000个失败任务
}
});
};
......
......@@ -6,9 +6,7 @@ import { pluginClient } from '../../../thirdProvider/fastgptPlugin';
import { addMinutes } from 'date-fns';
const getFileTemplates = async (): Promise<AppTemplateSchemaType[]> => {
const res = await pluginClient.workflow.getTemplateList();
if (res.status === 200) return res.body as AppTemplateSchemaType[];
else return Promise.reject(res.body);
return (await pluginClient.listWorkflows()) as AppTemplateSchemaType[];
};
const getAppTemplates = async () => {
......
import { type AppTemplateSchemaType } from '@fastgpt/global/core/app/type';
import { connectionMongo, getMongoModel } from '../../../common/mongo/index';
import { UserTagsEnum } from '@fastgpt/global/support/user/type';
const { Schema } = connectionMongo;
export const collectionName = 'app_templates';
......@@ -20,6 +21,14 @@ const AppTemplateSchema = new Schema({
type: String,
isActive: Boolean,
isPromoted: Boolean,
promoteTags: {
type: [String],
enum: UserTagsEnum.enum
},
hideTags: {
type: [String],
enum: UserTagsEnum.enum
},
recommendText: String,
userGuide: Object,
isQuickTemplate: Boolean,
......
import { RunToolWithStream } from '@fastgpt/global/sdk/fastgpt-plugin';
import { AppToolSourceEnum } from '@fastgpt/global/core/app/tool/constants';
import { pluginClient, PLUGIN_BASE_URL, PLUGIN_TOKEN } from '../../../thirdProvider/fastgptPlugin';
import { addLog } from '../../../common/system/log';
import { retryFn } from '@fastgpt/global/common/system/utils';
export async function APIGetSystemToolList() {
const res = await pluginClient.tool.list();
if (res.status === 200) {
return res.body.map((item) => {
return {
...item,
id: `${AppToolSourceEnum.systemTool}-${item.toolId}`,
parentId: item.parentId ? `${AppToolSourceEnum.systemTool}-${item.parentId}` : undefined,
avatar: item.icon
};
});
}
return Promise.reject(res.body);
const tools = await pluginClient.listTools();
return tools.map((item) => {
return {
...item,
id: `${AppToolSourceEnum.systemTool}-${item.toolId}`,
parentId: item.parentId ? `${AppToolSourceEnum.systemTool}-${item.parentId}` : undefined,
avatar: item.icon
};
});
}
const runToolInstance = new RunToolWithStream({
baseUrl: PLUGIN_BASE_URL,
token: PLUGIN_TOKEN
});
export const APIRunSystemTool = runToolInstance.run.bind(runToolInstance);
export const getSystemToolTags = () => {
return retryFn(async () => {
const res = await pluginClient.tool.getTags();
if (res.status === 200) {
const toolTypes = res.body || [];
const runToolInstance = new RunToolWithStream(PLUGIN_BASE_URL, PLUGIN_TOKEN);
return toolTypes;
}
export const APIRunSystemTool = runToolInstance.run.bind(runToolInstance);
addLog.error('Get system tool type error', res.body);
return [];
});
};
export const getSystemToolTags = () => retryFn(async () => await pluginClient.getToolTags());
......@@ -66,10 +66,12 @@ export const getSystemTools = () => getCachedData(SystemCacheKeyEnum.systemTool)
export const getSystemToolsWithInstalled = async ({
teamId,
isRoot
isRoot,
userTags = []
}: {
teamId: string;
isRoot: boolean;
userTags?: string[];
}) => {
const [tools, { installedSet, uninstalledSet }] = await Promise.all([
getSystemTools(),
......@@ -89,25 +91,46 @@ export const getSystemToolsWithInstalled = async ({
})
]);
return tools.map((tool) => {
const installed = (() => {
if (installedSet.has(tool.id)) {
return true;
return tools
.filter((tool) => {
// Filter out tools hidden by hideTags
if (userTags.length > 0 && tool.hideTags && tool.hideTags.length > 0) {
return !tool.hideTags.some((hideTag) => userTags.includes(hideTag));
}
if (isRoot && !uninstalledSet.has(tool.id)) {
return true;
}
if (tool.defaultInstalled && !uninstalledSet.has(tool.id)) {
return true;
}
return false;
})();
return true;
})
.map((tool) => {
const installed = (() => {
// 优先级1: 明确记录
if (installedSet.has(tool.id)) {
return true;
}
// 优先级2: Root用户
if (isRoot && !uninstalledSet.has(tool.id)) {
return true;
}
// 优先级3: 基于 promoteTags 的自动预安装
if (
userTags.length > 0 &&
tool.promoteTags &&
tool.promoteTags.length > 0 &&
!uninstalledSet.has(tool.id)
) {
const shouldAutoInstall = tool.promoteTags.some((tag) => userTags.includes(tag));
if (shouldAutoInstall) return true;
}
// 优先级4: 全局默认安装
if (tool.defaultInstalled && !uninstalledSet.has(tool.id)) {
return true;
}
return false;
})();
return {
...tool,
installed
};
});
return {
...tool,
installed
};
});
};
export const getSystemToolByIdAndVersionId = async (
......@@ -622,7 +645,7 @@ export const refreshSystemTools = async (): Promise<AppToolTemplateItemType[]> =
author: item.author,
courseUrl: item.courseUrl,
instructions: dbPluginConfig?.customConfig?.userGuide,
tags: item.tags,
tags: dbPluginConfig?.customConfig?.tags || item.tags,
workflow: {
nodes: [],
edges: []
......@@ -637,7 +660,9 @@ export const refreshSystemTools = async (): Promise<AppToolTemplateItemType[]> =
currentCost: dbPluginConfig?.currentCost ?? 0,
systemKeyCost: dbPluginConfig?.systemKeyCost ?? 0,
hasTokenFee: dbPluginConfig?.hasTokenFee ?? false,
pluginOrder: dbPluginConfig?.pluginOrder
pluginOrder: dbPluginConfig?.pluginOrder,
hideTags: dbPluginConfig?.hideTags,
promoteTags: dbPluginConfig?.promoteTags
};
});
......
......@@ -11,7 +11,8 @@ export const initDatasetDeleteWorker = () => {
return getWorker<DatasetDeleteJobData>(QueueNames.datasetDelete, datasetDeleteProcessor, {
concurrency: 1, // 确保同时只有1个删除任务
removeOnFail: {
age: 30 * 24 * 60 * 60 // 保留30天失败记录
age: 90 * 24 * 60 * 60, // 保留90天失败记录
count: 10000 // 最多保留10000个失败任务
}
});
};
......
import { connectionMongo, getMongoModel } from '../../../common/mongo/index';
const { Schema } = connectionMongo;
import type { SystemPluginToolCollectionType } from '@fastgpt/global/core/plugin/tool/type';
import { UserTagsEnum } from '@fastgpt/global/support/user/type';
export const collectionName = 'system_plugin_tools';
......@@ -38,6 +39,14 @@ const SystemToolSchema = new Schema({
},
customConfig: Object,
inputListVal: Object,
promoteTags: {
type: [String],
enum: UserTagsEnum.enum
},
hideTags: {
type: [String],
enum: UserTagsEnum.enum
},
// @deprecated
inputConfig: Array,
......
import { PLUGIN_TOKEN } from '../../../thirdProvider/fastgptPlugin/index';
import type { ApiRequestProps } from '../../../type/next';
import { ERROR_ENUM } from '@fastgpt/global/common/error/errorCode';
/**
* Auth plugin token from request header
* Check if the 'authtoken' header matches the PLUGIN_TOKEN environment variable
*/
export const authPluginToken = async ({ req }: { req: ApiRequestProps }) => {
const authtoken = req.headers.authtoken as string | undefined;
if (!authtoken) {
return Promise.reject(ERROR_ENUM.unAuthorization);
}
if (!PLUGIN_TOKEN) {
return Promise.reject('PLUGIN_TOKEN is not configured');
}
if (authtoken !== PLUGIN_TOKEN) {
return Promise.reject(ERROR_ENUM.unAuthorization);
}
return true;
};
import jwt from 'jsonwebtoken';
import { ERROR_ENUM } from '@fastgpt/global/common/error/errorCode';
import { z } from 'zod';
import type { NextApiRequest } from 'next';
const PLUGIN_ACCESS_TOKEN_SECRET =
process.env.PLUGIN_ACCESS_TOKEN_SECRET || 'plugin_access_token_secret';
const PLUGIN_ACCESS_TOKEN_EXPIRES_IN: number = process.env.PLUGIN_ACCESS_TOKEN_EXPIRES_IN
? parseInt(process.env.PLUGIN_ACCESS_TOKEN_EXPIRES_IN)
: 3600; // Default 1 hour (3600 seconds)
export const PluginAccessTokenPayloadSchema = z.object({
tmbId: z.string(),
teamId: z.string(),
toolId: z.string()
});
export type PluginAccessTokenPayload = z.infer<typeof PluginAccessTokenPayloadSchema>;
/**
* Generate plugin access token
* JWT with tmbId and toolId in payload
*/
export const generatePluginAccessToken = (payload: PluginAccessTokenPayload): string => {
const data = PluginAccessTokenPayloadSchema.parse(payload);
const token = jwt.sign(data, PLUGIN_ACCESS_TOKEN_SECRET, {
expiresIn: PLUGIN_ACCESS_TOKEN_EXPIRES_IN
});
return token;
};
/**
* Verify and decode plugin access token
* Returns the payload if valid, otherwise rejects with error
*/
export const authPluginAccessToken = ({
req
}: {
req: NextApiRequest;
}): Promise<PluginAccessTokenPayload> => {
const token = req.headers.authorization?.split(' ')[1];
return new Promise((resolve, reject) => {
if (!token) {
return reject(ERROR_ENUM.unAuthorization);
}
jwt.verify(token, PLUGIN_ACCESS_TOKEN_SECRET, (err, decoded: any) => {
if (err) {
return reject(ERROR_ENUM.unAuthorization);
}
try {
const payload = PluginAccessTokenPayloadSchema.parse(decoded);
return resolve(payload);
} catch (error) {
return reject(ERROR_ENUM.unAuthorization);
}
});
});
};
......@@ -47,6 +47,7 @@ export async function getUserDetail({
team: tmb,
permission: tmb.permission,
contact: user.contact,
language: user.language
language: user.language,
tags: user.tags
};
}
import { connectionMongo, getMongoModel } from '../../common/mongo';
const { Schema } = connectionMongo;
import { hashStr } from '@fastgpt/global/common/string/tools';
import type { UserModelSchema } from '@fastgpt/global/support/user/type';
import { UserTagsEnum, type UserModelSchema } from '@fastgpt/global/support/user/type';
import { UserStatusEnum, userStatusMap } from '@fastgpt/global/support/user/constant';
import { TeamMemberCollectionName } from '@fastgpt/global/support/user/team/constant';
import { LangEnum } from '@fastgpt/global/common/i18n/type';
......@@ -66,6 +66,11 @@ const UserSchema = new Schema({
phonePrefix: Number,
contact: String,
tags: {
type: [String],
enum: UserTagsEnum.enum
},
meta: Object,
/** @deprecated */
avatar: String
});
......
......@@ -52,7 +52,8 @@ async function getTeamMember(match: Record<string, any>): Promise<TeamTmbItemTyp
lafAccount: tmb.team.lafAccount,
openaiAccount: tmb.team.openaiAccount,
externalWorkflowVariables: tmb.team.externalWorkflowVariables
externalWorkflowVariables: tmb.team.externalWorkflowVariables,
isWecomTeam: !!tmb.team.meta?.wecom
};
}
......
import { getQueue, getWorker, QueueNames } from '../../../../common/bullmq';
import { teamDeleteProcessor } from './processor';
export type TeamDeleteJobData = {
teamId: string;
};
// 创建工作进程
export const initTeamDeleteWorker = () => {
return getWorker<TeamDeleteJobData>(QueueNames.teamDelete, teamDeleteProcessor, {
concurrency: 1, // 确保同时只有1个删除任务
removeOnFail: {
age: 90 * 24 * 60 * 60, // 保留90天失败记录
count: 10000 // 最多保留10000个失败任务
}
});
};
// 添加删除任务
export const addTeamDeleteJob = (data: TeamDeleteJobData) => {
// 创建删除队列
const teamDeleteQueue = getQueue<TeamDeleteJobData>(QueueNames.teamDelete, {
defaultJobOptions: {
attempts: 10,
backoff: {
type: 'exponential',
delay: 5000
},
removeOnComplete: true,
removeOnFail: { age: 30 * 24 * 60 * 60 } // 保留30天失败记录
}
});
const jobId = `${String(data.teamId)}`;
// Use jobId to automatically prevent duplicate deletion tasks (BullMQ feature)
return teamDeleteQueue.add('delete_team', data, {
jobId,
delay: 1000 // Delay 1 second to ensure API response completes
});
};
import type { Processor } from 'bullmq';
import { type TeamDeleteJobData } from './index';
import { addLog } from '../../../../common/system/log';
import { MongoImage } from '../../../../common/file/image/schema';
import { MongoOpenApi } from '../../../openapi/schema';
import { MongoGroupMemberModel } from '../../../permission/memberGroup/groupMemberSchema';
import { MongoMemberGroupModel } from '../../../permission/memberGroup/memberGroupSchema';
import { MongoOrgMemberModel } from '../../../permission/org/orgMemberSchema';
import { MongoOrgModel } from '../../../permission/org/orgSchema';
import { MongoResourcePermission } from '../../../permission/schema';
import { delUserAllSession } from '../../session';
import { MongoTeamMember } from '../teamMemberSchema';
import { MongoTeam } from '../teamSchema';
import { MongoTeamTags } from '../teamTagsSchema';
import { MongoMcpKey } from '../../../mcp/schema';
import { MongoChatSetting } from '../../../../core/chat/setting/schema';
import { MongoChatFavouriteApp } from '../../../../core/chat/favouriteApp/schema';
import { MongoDiscountCoupon } from '../../../wallet/discountCoupon/schema';
import { MongoTeamAudit } from '../../audit/schema';
import { deleteTeamAllDatasets } from '../../../../core/dataset/delete/processor';
import { onDelAllApp } from './utils';
import { MongoEvaluation } from '../../../../core/app/evaluation/evalSchema';
import { MongoEvalItem } from '../../../../core/app/evaluation/evalItemSchema';
import { MongoTeamSub } from '../../../../support/wallet/sub/schema';
export const teamDeleteProcessor: Processor<TeamDeleteJobData> = async (job) => {
const { teamId } = job.data;
const startTime = Date.now();
addLog.info(`[Team Delete] Start deleting team: ${teamId}`);
try {
// 1. 检查团队是否存在
const team = await MongoTeam.findById(teamId);
if (!team) {
addLog.warn(`[Team Delete] Team not found: ${teamId}`);
return;
}
// 2. 先删除知识库和应用(它们内部有自己的队列)
await deleteTeamAllDatasets(teamId);
await onDelAllApp(teamId);
// 删除评估
await MongoEvaluation.deleteMany({
teamId
});
// 删除评估项
await MongoEvalItem.deleteMany({
teamId
});
// 删除图片(旧的了)
await MongoImage.deleteMany({
teamId: teamId
});
// 3. 删除门户
await MongoChatSetting.deleteMany({
teamId
});
await MongoChatFavouriteApp.deleteMany({
teamId
});
// 4. 删除独立资源
// 删除 API key
await MongoOpenApi.deleteMany({
teamId
});
// 删除 MCP
await MongoMcpKey.deleteMany({
teamId
});
// 审计日志
await MongoTeamAudit.deleteMany({
teamId
});
// 5. 删除财务相关
// 删除优惠券
await MongoDiscountCoupon.deleteMany({
teamId
});
await MongoTeamSub.deleteMany({
teamId
});
// 删除使用记录(不删除,等待自动过期)
// 充值记录不删除
// 6. 删除团队信息
// 删除权限
await MongoResourcePermission.deleteMany({
teamId
});
// 删除群组
const groups = await MongoMemberGroupModel.find({ teamId });
await MongoGroupMemberModel.deleteMany({
groupId: { $in: groups.map((item) => item._id) }
});
await MongoMemberGroupModel.deleteMany({
teamId
});
// 删除组织
await MongoOrgModel.deleteMany({
teamId
});
await MongoOrgMemberModel.deleteMany({
teamId
});
// 删除 teamTags
await MongoTeamTags.deleteMany({
teamId
});
// 7. 删除成员 session 和成员信息
const members = await MongoTeamMember.find({
teamId
});
// 删除所有成员的 session
await Promise.all(members.map((member) => delUserAllSession(member.userId)));
await MongoTeamMember.deleteMany({
teamId
});
// 8. 清理团队敏感信息
team.notificationAccount = '';
team.openaiAccount = undefined;
team.lafAccount = undefined;
team.externalWorkflowVariables = undefined;
team.meta = undefined;
await team.save();
addLog.info(`[Team Delete] Successfully deleted team: ${teamId}`, {
duration: Date.now() - startTime
});
} catch (error: any) {
addLog.error(`[Team Delete] Failed to delete team: ${teamId}`, error);
throw error;
}
};
import { MongoApp } from '../../../../core/app/schema';
import { deleteAppsImmediate } from '../../../../core/app/controller';
import { addAppDeleteJob } from '../../../../core/app/delete';
export const onDelAllApp = async (teamId: string) => {
// 取根目录所有应用
const apps = await MongoApp.find(
{
teamId,
parentId: null
},
'_id'
);
const appIds = apps.map((app) => app._id);
// Stop background tasks immediately
await deleteAppsImmediate({
teamId,
appIds: appIds
});
// 标记所有应用为待删除
await MongoApp.updateMany(
{
teamId
},
{
$set: {
deleteTime: new Date()
}
}
);
// 添加到删除队列
for (const appId of appIds) {
await addAppDeleteJob({
teamId,
appId
});
}
};
......@@ -40,11 +40,14 @@ const TeamMemberSchema = new Schema({
type: Date
},
// Abandoned
/** @deprecated
* But some code still use this to judge whether the member is a owner.
* TODO: Remove this field and replace it with a more appropriate way to determine ownership.
*/
role: {
type: String
},
// Abandoned
/** @deprecated */
defaultTeam: {
type: Boolean
}
......
......@@ -57,12 +57,19 @@ const TeamSchema = new Schema({
notificationAccount: {
type: String,
required: false
},
meta: {
type: Object
},
deleteTime: {
type: Date
}
});
try {
TeamSchema.index({ name: 1 });
TeamSchema.index({ ownerId: 1 });
TeamSchema.index({ 'meta.wecom.corpId': 1 }, { sparse: true, unique: true });
} catch (error) {
console.log(error);
}
......
......@@ -66,6 +66,9 @@ const SubSchema = new Schema({
ticketResponseTime: Number,
customDomain: Number,
maxUploadFileSize: Number,
maxUploadFileCount: Number,
// stand sub and extra points sub. Plan total points
totalPoints: Number,
// plan surplus points
......
......@@ -11,7 +11,7 @@ import {
} from '@fastgpt/global/support/wallet/sub/type';
import dayjs from 'dayjs';
import { type ClientSession } from '../../../common/mongo';
import { addMonths } from 'date-fns';
import { addMonths, addDays } from 'date-fns';
import { readFromSecondary } from '../../../common/mongo/utils';
import {
setRedisCache,
......@@ -52,8 +52,12 @@ export const getTeamStandPlan = async ({ teamId }: { teamId: string }) => {
const standard = plans[0];
const standardConstants =
standard?.currentSubLevel && standardPlans
? standardPlans[standard.currentSubLevel]
standard.currentSubLevel && standardPlans
? standardPlans[
standard.currentSubLevel === StandardSubLevelEnum.custom
? StandardSubLevelEnum.advanced
: standard.currentSubLevel
]
: undefined;
return {
......@@ -83,12 +87,16 @@ export const getTeamStandPlan = async ({ teamId }: { teamId: string }) => {
export const initTeamFreePlan = async ({
teamId,
isWecomTeam = false,
session
}: {
teamId: string;
isWecomTeam?: boolean;
session?: ClientSession;
}) => {
const freePoints = global?.subPlans?.standard?.[StandardSubLevelEnum.free]?.totalPoints || 100;
const freePoints = isWecomTeam
? Math.round((global.subPlans?.standard?.basic.totalPoints ?? 4000) / 2)
: global?.subPlans?.standard?.[StandardSubLevelEnum.free]?.totalPoints || 100;
const freePlan = await MongoTeamSub.findOne({
teamId,
......@@ -96,6 +104,27 @@ export const initTeamFreePlan = async ({
currentSubLevel: StandardSubLevelEnum.free
});
// Get basic plan config for wecom mode
const specialConfig: Record<string, any> | null = (() => {
const config = global?.subPlans?.standard?.[StandardSubLevelEnum.basic];
if (isWecomTeam && config) {
return {
maxTeamMember: config.maxTeamMember,
maxApp: config.maxAppAmount,
maxDataset: config.maxDatasetAmount,
requestsPerMinute: config.requestsPerMinute,
chatHistoryStoreDuration: config.chatHistoryStoreDuration,
maxDatasetSize: config.maxDatasetSize,
websiteSyncPerDataset: config.websiteSyncPerDataset,
appRegistrationCount: config.appRegistrationCount,
auditLogStoreDuration: config.auditLogStoreDuration,
ticketResponseTime: config.ticketResponseTime,
customDomain: config.customDomain
} as TeamSubSchemaType;
}
return null;
})();
// Reset one month free plan
if (freePlan) {
freePlan.currentMode = SubModeEnum.month;
......@@ -111,6 +140,14 @@ export const initTeamFreePlan = async ({
freePlan.surplusPoints && freePlan.surplusPoints < 0
? freePlan.surplusPoints + freePoints
: freePoints;
// Apply basic plan config for wecom, but with limited points and dataset size
if (specialConfig) {
for (const key in specialConfig) {
(freePlan as any)[key] = specialConfig[key];
}
}
return freePlan.save({ session });
}
......@@ -122,13 +159,14 @@ export const initTeamFreePlan = async ({
currentMode: SubModeEnum.month,
nextMode: SubModeEnum.month,
startTime: new Date(),
expiredTime: addMonths(new Date(), 1),
expiredTime: isWecomTeam ? addDays(new Date(), 15) : addMonths(new Date(), 1),
currentSubLevel: StandardSubLevelEnum.free,
nextSubLevel: StandardSubLevelEnum.free,
totalPoints: freePoints,
surplusPoints: freePoints
surplusPoints: freePoints,
...(specialConfig && specialConfig)
}
],
{ session, ordered: true }
......@@ -178,7 +216,11 @@ export const getTeamPlanStatus = async ({
const standardMaxDatasetSize =
standardPlan?.currentSubLevel && standardPlans
? standardPlan?.maxDatasetSize ||
standardPlans[standardPlan.currentSubLevel]?.maxDatasetSize ||
standardPlans[
standardPlan.currentSubLevel === StandardSubLevelEnum.custom
? StandardSubLevelEnum.advanced
: standardPlan.currentSubLevel
]?.maxDatasetSize ||
Infinity
: Infinity;
const totalDatasetSize =
......@@ -187,13 +229,43 @@ export const getTeamPlanStatus = async ({
const standardConstants =
standardPlan?.currentSubLevel && standardPlans
? standardPlans[standardPlan.currentSubLevel]
? standardPlans[
standardPlan.currentSubLevel === StandardSubLevelEnum.custom
? StandardSubLevelEnum.advanced
: standardPlan.currentSubLevel
]
: undefined;
teamPoint.updateTeamPointsCache({ teamId, totalPoints, surplusPoints });
return {
[SubTypeEnum.standard]: standardPlan,
[SubTypeEnum.standard]:
standardPlan.currentSubLevel === StandardSubLevelEnum.custom && standardConstants
? {
...standardPlan,
maxTeamMember: standardPlan?.maxTeamMember ?? standardConstants.maxTeamMember,
maxApp: standardPlan?.maxApp ?? standardConstants.maxAppAmount,
maxDataset: standardPlan?.maxDataset ?? standardConstants.maxDatasetAmount,
requestsPerMinute:
standardPlan?.requestsPerMinute ?? standardConstants.requestsPerMinute,
chatHistoryStoreDuration:
standardPlan?.chatHistoryStoreDuration ?? standardConstants.chatHistoryStoreDuration,
maxDatasetSize: standardPlan?.maxDatasetSize ?? standardConstants.maxDatasetSize,
websiteSyncPerDataset:
standardPlan?.websiteSyncPerDataset || standardConstants.websiteSyncPerDataset,
appRegistrationCount:
standardPlan?.appRegistrationCount ?? standardConstants.appRegistrationCount,
auditLogStoreDuration:
standardPlan?.auditLogStoreDuration ?? standardConstants.auditLogStoreDuration,
ticketResponseTime:
standardPlan?.ticketResponseTime ?? standardConstants.ticketResponseTime,
customDomain: standardPlan?.customDomain ?? standardConstants.customDomain,
maxUploadFileSize:
standardPlan?.maxUploadFileSize ?? standardConstants.maxUploadFileSize,
maxUploadFileCount:
standardPlan?.maxUploadFileCount ?? standardConstants.maxUploadFileCount
}
: standardPlan,
standardConstants: standardConstants
? {
...standardConstants,
......@@ -212,7 +284,10 @@ export const getTeamPlanStatus = async ({
standardPlan?.auditLogStoreDuration ?? standardConstants.auditLogStoreDuration,
ticketResponseTime:
standardPlan?.ticketResponseTime ?? standardConstants.ticketResponseTime,
customDomain: standardPlan?.customDomain ?? standardConstants.customDomain
customDomain: standardPlan?.customDomain ?? standardConstants.customDomain,
maxUploadFileSize: standardPlan?.maxUploadFileSize ?? standardConstants.maxUploadFileSize,
maxUploadFileCount:
standardPlan?.maxUploadFileCount ?? standardConstants.maxUploadFileCount
}
: undefined,
......
import { createClient } from '@fastgpt/global/sdk/fastgpt-plugin';
import { FastGPTPluginClient } from '@fastgpt/global/sdk/fastgpt-plugin';
export const PLUGIN_BASE_URL = process.env.PLUGIN_BASE_URL || '';
export const PLUGIN_TOKEN = process.env.PLUGIN_TOKEN || '';
export const pluginClient = createClient({
export const pluginClient = new FastGPTPluginClient({
baseUrl: PLUGIN_BASE_URL,
token: PLUGIN_TOKEN
});
import { pluginClient } from '.';
export const loadModelProviders = async () => {
const res = await pluginClient.model.getProviders();
if (res.status === 200) {
return res.body;
}
return Promise.reject(res.body);
return await pluginClient.getModelProviders();
};
......@@ -18,6 +18,7 @@ declare global {
VECTOR_VQ_LEVEL: string;
PG_URL: string;
OCEANBASE_URL: string;
SEEKDB_URL: string;
MILVUS_ADDRESS: string;
MILVUS_TOKEN: string;
......
......@@ -14,6 +14,7 @@ const DateTimePicker = ({
defaultDate,
selectedDateTime,
disabled,
isDisabled,
...props
}: {
onChange?: (dateTime: Date | undefined) => void;
......@@ -21,6 +22,7 @@ const DateTimePicker = ({
defaultDate?: Date;
selectedDateTime?: Date;
disabled?: Matcher[];
isDisabled?: boolean;
} & Omit<BoxProps, 'onChange'>) => {
const containerRef = useRef<HTMLDivElement>(null);
const popoverRef = useRef<HTMLDivElement>(null);
......@@ -111,11 +113,15 @@ const DateTimePicker = ({
pr={3}
py={1}
borderRadius={'sm'}
cursor={'pointer'}
bg={'myGray.50'}
fontSize={'sm'}
onClick={() => setShowSelected((state) => !state)}
alignItems={'center'}
{...(isDisabled
? { cursor: 'not-allowed', bg: 'myGray.100', opacity: 0.6 }
: {
cursor: 'pointer',
bg: 'myGray.50',
onClick: () => setShowSelected((state) => !state)
})}
{...props}
>
<Box color={'myGray.600'} fontWeight={'400'} flex={1}>
......
import React from 'react';
import {
Box,
Flex,
VStack,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon
} from '@chakra-ui/react';
import { useTranslation } from 'next-i18next';
import { parseI18nString } from '@fastgpt/global/common/i18n/utils';
import { FlowValueTypeMap } from '@fastgpt/global/core/workflow/node/constant';
import type {
FlowNodeInputItemType,
FlowNodeOutputItemType
} from '@fastgpt/global/core/workflow/type/io';
import type { WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants';
import type { ToolDetailExtendedType } from './types';
export const ParamSection = ({
title,
params
}: {
title: string;
params: (FlowNodeInputItemType | FlowNodeOutputItemType)[];
}) => {
const { i18n } = useTranslation();
return (
<VStack
align="stretch"
p={4}
gap={0}
border="1px solid"
borderColor="myGray.200"
borderRadius="md"
bg="myGray.50"
>
<Flex alignItems="center" gap={2} mb={4}>
<Box w="4px" h="16px" bg="primary.600" borderRadius="2px" flexShrink={0} />
<Box fontSize="sm" color="myGray.900">
{title}
</Box>
</Flex>
{params.map((param, index) => {
const isInput = 'required' in param;
return (
<Box key={index}>
<Flex alignItems="center" gap={2} mb={1}>
{isInput && param.required && (
<Box as="span" color="red.500" fontSize="xs" fontWeight="medium" ml={-2} mr={-1}>
*
</Box>
)}
<Box fontWeight={500}>{parseI18nString(param.label || param.key, i18n.language)}</Box>
<Box
px={1}
borderRadius="4px"
fontSize={'11px'}
color="myGray.500"
bg={'myGray.100'}
border={'1px solid'}
borderColor={'myGray.200'}
>
{FlowValueTypeMap[param.valueType as WorkflowIOValueTypeEnum]?.label || 'String'}
</Box>
</Flex>
{param.description && (
<Box fontSize="sm" color="myGray.500" mt={1}>
{parseI18nString(param.description, i18n.language)}
</Box>
)}
{index !== params.length - 1 && <Box h={'1px'} w={'full'} bg={'myGray.200'} my={4} />}
</Box>
);
})}
</VStack>
);
};
export const SubToolAccordionItem = ({ tool }: { tool: ToolDetailExtendedType }) => {
const { t, i18n } = useTranslation();
return (
<AccordionItem borderRadius="md" mb={2} border={'none'}>
<AccordionButton
px={2}
py={2}
_hover={{ bg: 'myGray.50' }}
borderRadius="md"
alignItems={'center'}
>
<Box flex={1} textAlign="left">
<Box fontSize="md" color="myGray.900">
{parseI18nString(tool.name, i18n.language)}
</Box>
<Box fontSize={'sm'} color={'myGray.600'}>
{tool.intro || parseI18nString(tool.description, i18n.language)}
</Box>
</Box>
<AccordionIcon />
</AccordionButton>
<AccordionPanel px={2} pb={4} pt={0}>
{tool.versionList && tool.versionList.length > 0 && (
<VStack align="stretch" spacing={3} mt={3}>
{tool.versionList[0]?.inputs && tool.versionList[0].inputs.length > 0 && (
<ParamSection title={t('app:toolkit_inputs')} params={tool.versionList[0].inputs} />
)}
{tool.versionList[0]?.outputs && tool.versionList[0].outputs.length > 0 && (
<ParamSection title={t('app:toolkit_outputs')} params={tool.versionList[0].outputs} />
)}
</VStack>
)}
</AccordionPanel>
</AccordionItem>
);
};
import { useState, useEffect, useMemo } from 'react';
import type { ToolDetailResponseType, ToolDetailExtendedType } from './types';
import type { GetTeamToolDetailResponseType } from '@fastgpt/global/openapi/core/plugin/team/toolApi';
import { useRequest } from '../../../../../hooks/useRequest';
export type UseToolDetailProps = {
toolId?: string;
tags?: string[];
onFetchDetail?: (toolId: string) => Promise<GetTeamToolDetailResponseType>;
autoFetch?: boolean;
};
export const useToolDetail = ({
toolId,
tags,
onFetchDetail,
autoFetch = true
}: UseToolDetailProps) => {
const [readmeContent, setReadmeContent] = useState<string>('');
// 使用 useRequest2 替代手动的 useEffect,避免无限请求问题
const {
data: toolDetail,
loading: loadingDetail,
run: fetchToolDetail
} = useRequest(
async (id: string) => {
if (!onFetchDetail) return undefined;
const detail = await onFetchDetail(id);
return detail as any as ToolDetailResponseType;
},
{
manual: true,
errorToast: ''
}
);
// 自动获取工具详情
useEffect(() => {
if (toolId && autoFetch && onFetchDetail) {
fetchToolDetail(toolId);
}
}, [toolId, autoFetch]);
// Calculate tool structure
const isToolSet = useMemo(() => {
if (!toolDetail?.tools || !Array.isArray(toolDetail?.tools) || toolDetail?.tools.length === 0) {
return false;
}
const subTools = toolDetail?.tools.filter((subTool: any) => subTool.parentId);
return subTools.length > 0;
}, [toolDetail?.tools]);
const parentTool = useMemo(() => {
const parentTool = toolDetail?.tools.find((tool: ToolDetailExtendedType) => !tool.parentId);
return {
...parentTool,
tags
};
}, [tags, toolDetail?.tools]);
const subTools = useMemo(() => {
if (!isToolSet || !toolDetail?.tools) return [];
return toolDetail?.tools.filter((subTool: ToolDetailExtendedType) => !!subTool.parentId);
}, [isToolSet, toolDetail?.tools]);
// Fetch README
useEffect(() => {
const fetchReadme = async () => {
if (!toolDetail) return;
const readmeUrl = parentTool?.readme;
if (!readmeUrl) return;
try {
const response = await fetch(readmeUrl);
if (!response.ok) {
throw new Error(`Failed to fetch README: ${response.status}`);
}
let content = await response.text();
const baseUrl = readmeUrl.substring(0, readmeUrl.lastIndexOf('/') + 1);
content = content.replace(
/!\[([^\]]*)\]\(\.\/([^)]+)\)/g,
(match, alt, path) => `![${alt}](${baseUrl}${path})`
);
content = content.replace(
/!\[([^\]]*)\]\((?!http|https|\/\/)([^)]+)\)/g,
(match, alt, path) => `![${alt}](${baseUrl}${path})`
);
setReadmeContent(content);
} catch (error) {
console.error('Failed to fetch README:', error);
setReadmeContent('');
}
};
fetchReadme();
}, [toolDetail, parentTool?.readme]);
return {
toolDetail,
loadingDetail,
readmeContent,
isToolSet,
parentTool,
subTools
};
};
export * from './types';
export * from './components';
export * from './hooks';
export * from './styles';
export const drawerScrollbarStyles = {
overflowY: 'overlay' as any,
'&::-webkit-scrollbar': {
width: '6px',
position: 'absolute'
},
'&::-webkit-scrollbar-track': {
background: 'transparent'
},
'&::-webkit-scrollbar-thumb': {
background: 'myGray.300',
borderRadius: '3px'
},
'&::-webkit-scrollbar-thumb:hover': {
background: 'myGray.400'
},
scrollbarWidth: 'thin',
scrollbarColor: 'var(--chakra-colors-myGray-300) transparent'
};
import type { ToolDetailType } from '@fastgpt/global/sdk/fastgpt-plugin';
import type {
FlowNodeInputItemType,
FlowNodeOutputItemType
} from '@fastgpt/global/core/workflow/type/io';
export type ToolDetailExtendedType = ToolDetailType & {
versionList?: Array<{
value: string;
description?: string;
inputs?: Array<FlowNodeInputItemType>;
outputs?: Array<FlowNodeOutputItemType>;
}>;
courseUrl?: string;
readme?: string;
userGuide?: string;
currentCost?: number;
hasSystemSecret?: boolean;
secretInputConfig?: Array<{}>;
inputList?: Array<FlowNodeInputItemType>;
intro?: string;
};
export type ToolDetailResponseType = {
tools: Array<ToolDetailExtendedType & { readme: string }>;
downloadUrl: string;
};
......@@ -41,5 +41,6 @@
"type": "type",
"unit_code": "unified credit code",
"unit_code_void": "Unified credit code format error",
"update": "renew"
"update": "renew",
"wecom_not_pay_tip": "Not paid, payment address will be redirected soon"
}
......@@ -247,6 +247,12 @@
"transfer_app_ownership": "Transfer app ownership",
"transfer_dataset_ownership": "Transfer dataset ownership",
"transfer_ownership": "Transfer ownership",
"transfer_team_ownership": "Transfer Team",
"transfer_success": "Transfer successful",
"transfer_failed": "Transfer failed",
"select_new_owner": "Select new owner",
"confirm_transfer": "Confirm transfer",
"transfer_warning": "Warning: After transferring team ownership, you will lose all administrative privileges, and this action cannot be undone. Please proceed with caution.",
"type.Folder": "Folder",
"type.Http plugin": "HTTP Plugin",
"type.Plugin": "Plugin",
......
......@@ -357,6 +357,7 @@
"templateMarket.Use": "Build now",
"templateMarket.no_intro": "No introduction yet~",
"templateMarket.templateTags.Recommendation": "Recommendation",
"templateMarket.templateTags.WecomZone": "WeChat Work Zone",
"templateMarket.template_guide": "Guide",
"template_market": "Templates",
"template_market_description": "Explore more features in the template market, with configuration tutorials and usage guides to help you understand and get started with various applications.",
......@@ -447,9 +448,17 @@
"toolkit_tool_config": "{{name}} Configuration",
"toolkit_tool_list": "Tool List",
"toolkit_tool_name": "Tool Name",
"toolkit_promote_tags": "Promote Tags",
"toolkit_promote_tags_tip": "Users with the following tags will see the \"Promoted\" badge",
"toolkit_hide_tags": "Hide Tags",
"toolkit_hide_tags_tip": "Users with the following tags will not see this tool at all",
"toolkit_select_user_tags": "Select user tags",
"toolkit_uninstall": "Uninstall",
"toolkit_uninstalled": "Uninstalled",
"toolkit_update_failed": "Update failed",
"toolkit_updatable": "Updates Available",
"toolkit_updatable_plugins": "Updatable Plugins",
"toolkit_batch_update": "Batch Update",
"toolkit_user_guide": "User Guide",
"tools_no_description": "This tool has not been introduced ~",
"transition_to_workflow": "Convert to Workflow",
......
......@@ -85,6 +85,7 @@
"Select_App": "Select an application",
"Select_all": "Select all",
"Setting": "Setting",
"view_detail": "View Detail",
"Status": "Status",
"Submit": "Submit",
"Success": "Success",
......@@ -956,6 +957,9 @@
"n_chat_records_retain": "{{amount}} Days of Chat History Retention",
"n_custom_domain_amount": "{{amount}} Custom domains",
"n_custom_domain_amount_tip": "The number of custom domain names that the team can configure, which can currently be used to access Wecom intelligent robots",
"n_max_upload_file_limit": "Upload up to {{count}} files of {{size}}MB each",
"n_max_upload_file_size": "Max {{amount}}MB per file",
"n_max_upload_file_count": "Upload up to {{amount}} files",
"n_dataset_amount": "{{amount}} Dataset limit",
"n_dataset_size": "{{amount}} Dataset Indexes",
"n_team_audit_day": "{{amount}} days team operation log records",
......@@ -1151,6 +1155,7 @@
"support.user.login.Provider error": "Login Error, Please Try Again",
"support.user.login.Username": "Username",
"support.user.login.Wechat": "WeChat Login",
"support.user.login.Wecom": "Wecom Login",
"support.user.login.can_not_login": "Cannot log in? Click here to contact us",
"support.user.login.error": "Login Error",
"support.user.login.security_failed": "Security Verification Failed",
......@@ -1181,6 +1186,7 @@
"support.wallet.bill.payWay.alipay": "Alipay Payment",
"support.wallet.bill.payWay.balance": "Balance Payment",
"support.wallet.bill.payWay.bank": "Bank Transfer",
"support.wallet.bill.payWay.wecom": "WeChat Work Payment",
"support.wallet.bill.payWay.wx": "WeChat Payment",
"support.wallet.bill.status.closed": "Closed",
"support.wallet.bill.status.notpay": "Unpaid",
......@@ -1190,6 +1196,7 @@
"support.wallet.bill_tag.bill": "Bill Records",
"support.wallet.bill_tag.default_header": "Default Header",
"support.wallet.bill_tag.invoice": "Invoice Records",
"support.wallet.wecom_bill_tip": "Please go to WeCom - Checkout to query bills and apply for invoices",
"support.wallet.billable_invoice": "Billable Invoice",
"support.wallet.buy_ai_points": "Buy AI points",
"support.wallet.buy_dataset_capacity": "Buy Knowledge Base Index",
......@@ -1224,6 +1231,7 @@
"support.wallet.subscription.Extra dataset unit": " Groups/1 Month",
"support.wallet.subscription.Extra plan": "Extra Resource Pack",
"support.wallet.subscription.Extra plan tip": "When the standard package is not enough, you can purchase extra resource packs to continue using",
"support.wallet.subscription.extra_plan_disabled_tip": "Please subscribe to a plan first before purchasing extra resource packs.",
"support.wallet.subscription.FAQ": "FAQ",
"support.wallet.subscription.Month amount": "Months",
"support.wallet.subscription.Next plan": "Future Package",
......@@ -1231,6 +1239,7 @@
"support.wallet.subscription.Stand plan level": "Subscription Package",
"support.wallet.subscription.Sub plan": "Subscription Package",
"support.wallet.subscription.Sub plan tip": "Free to use [{{title}}] or upgrade to a higher package",
"support.wallet.subscription.Sub plan tip wecom": "Purchase a plan to enjoy application services",
"support.wallet.subscription.Team plan and usage": "Package and Usage",
"support.wallet.subscription.Training weight": "Training Priority: {{weight}}",
"support.wallet.subscription.Update extra ai points": "Extra AI Points",
......@@ -1258,6 +1267,9 @@
"support.wallet.subscription.standardSubLevel.experience_desc": "Unlock the full functionality of FastGPT",
"support.wallet.subscription.standardSubLevel.free": "Free",
"support.wallet.subscription.standardSubLevel.free desc": "Free trial of core features. \nIf you haven't logged in for 30 days, the knowledge base will be cleared.",
"support.wallet.subscription.standardSubLevel.trial": "Trial",
"support.wallet.subscription.standardSubLevel.trial_desc": "Enterprises can try for free for 15 days, starting from the activation of the application, limited to one experience per enterprise.",
"support.wallet.subscription.per_year": "/ year",
"support.wallet.subscription.standardSubLevel.team": "Team",
"support.wallet.subscription.standardSubLevel.team_desc": "Suitable for small teams to build Dataset applications and provide external services",
"support.wallet.subscription.status.active": "Active",
......
......@@ -35,8 +35,6 @@
"some_file_count_exceeds_limit": "Exceeded {{maxCount}} files, automatically truncated",
"some_file_size_exceeds_limit": "Some files exceed {{maxSize}}, filtered out",
"support_file_type": "Supports {{fileType}} file types",
"support_max_count": "Supports up to {{maxCount}} files",
"support_max_size": "Maximum file size is {{maxSize}}",
"template_csv_file_select_tip": "Only support {{fileType}} files that are strictly in accordance with template format</highlight>",
"template_strict_highlight": "Strictly follow the template",
"total_files": "Total {{selectFiles.length}} files",
......
......@@ -41,5 +41,6 @@
"type": "类型",
"unit_code": "统一信用代码",
"unit_code_void": "统一信用代码格式错误",
"update": "更新"
"update": "更新",
"wecom_not_pay_tip": "未支付,即将跳转支付地址"
}
......@@ -251,6 +251,12 @@
"transfer_app_ownership": "转移应用所有权",
"transfer_dataset_ownership": "转移知识库所有权",
"transfer_ownership": "转让所有者",
"transfer_team_ownership": "转让团队",
"transfer_success": "转让成功",
"transfer_failed": "转让失败",
"select_new_owner": "选择新的所有者",
"confirm_transfer": "确认转让",
"transfer_warning": "警告:转让团队所有权后,您将失去所有管理权限,且此操作不可撤销。请谨慎操作。",
"type.Folder": "文件夹",
"type.Http plugin": "HTTP 插件",
"type.Http tool set": "HTTP 工具集",
......
......@@ -371,6 +371,7 @@
"templateMarket.Use": "立即搭建",
"templateMarket.no_intro": "还没有介绍~",
"templateMarket.templateTags.Recommendation": "推荐",
"templateMarket.templateTags.WecomZone": "企微专区",
"templateMarket.template_guide": "说明",
"template_market": "模板市场",
"template_market_description": "在模板市场探索更多玩法,配置教程与使用引导,带你理解并上手各种应用",
......@@ -464,9 +465,17 @@
"toolkit_tool_config": "{{name}}配置",
"toolkit_tool_list": "工具列表",
"toolkit_tool_name": "工具名",
"toolkit_promote_tags": "推荐标签",
"toolkit_promote_tags_tip": "拥有以下标签的用户会看到\"推荐\"标识",
"toolkit_hide_tags": "隐藏标签",
"toolkit_hide_tags_tip": "拥有以下标签的用户将完全看不到此工具",
"toolkit_select_user_tags": "选择用户标签",
"toolkit_uninstall": "卸载",
"toolkit_uninstalled": "未安装",
"toolkit_update_failed": "更新失败",
"toolkit_updatable": "可更新",
"toolkit_updatable_plugins": "可更新的插件",
"toolkit_batch_update": "批量更新",
"toolkit_user_guide": "使用说明",
"tools_no_description": "这个工具没有介绍~",
"transition_to_workflow": "转成工作流",
......
......@@ -86,6 +86,7 @@
"Select_App": "选择应用",
"Select_all": "全选",
"Setting": "设置",
"view_detail": "查看详情",
"Status": "状态",
"Submit": "提交",
"Success": "成功",
......@@ -965,6 +966,9 @@
"n_custom_domain_amount_tip": "团队可以配置的自定义域名数量,目前可用于接入企微智能机器人",
"n_dataset_amount": "{{amount}} 个知识库",
"n_dataset_size": "{{amount}} 组知识库索引",
"n_max_upload_file_count": "单次可上传 {{amount}} 个文件",
"n_max_upload_file_limit": "单次可上传 {{count}} 个 {{size}} 的文件",
"n_max_upload_file_size": "单个文件最大 {{amount}}MB",
"n_team_audit_day": "{{amount}} 天团队操作日志记录",
"n_team_members": "{{amount}} 个团队成员",
"n_team_qpm": "{{amount}} QPM",
......@@ -1160,6 +1164,7 @@
"support.user.login.Provider error": "登录异常,请重试",
"support.user.login.Username": "用户名",
"support.user.login.Wechat": "微信登录",
"support.user.login.Wecom": "企业微信登录",
"support.user.login.can_not_login": "无法登录,点击联系",
"support.user.login.error": "登录异常",
"support.user.login.security_failed": "安全校验失败",
......@@ -1190,6 +1195,7 @@
"support.wallet.bill.payWay.alipay": "支付宝支付",
"support.wallet.bill.payWay.balance": "余额支付",
"support.wallet.bill.payWay.bank": "对公支付",
"support.wallet.bill.payWay.wecom": "企业微信支付",
"support.wallet.bill.payWay.wx": "微信支付",
"support.wallet.bill.status.closed": "已关闭",
"support.wallet.bill.status.notpay": "未支付",
......@@ -1240,6 +1246,7 @@
"support.wallet.subscription.Stand plan level": "订阅套餐",
"support.wallet.subscription.Sub plan": "订阅套餐",
"support.wallet.subscription.Sub plan tip": "免费使用【{{title}}】或升级更高的套餐",
"support.wallet.subscription.Sub plan tip wecom": "购买套餐以享受应用服务",
"support.wallet.subscription.Team plan and usage": "套餐与用量",
"support.wallet.subscription.Training weight": "训练优先级:{{weight}}",
"support.wallet.subscription.Update extra ai points": "额外 AI 积分",
......@@ -1250,6 +1257,7 @@
"support.wallet.subscription.Upgrade plan": "升级套餐",
"support.wallet.subscription.ai_model": "AI语言模型",
"support.wallet.subscription.eval_items_count": "单次评测数据条数: {{count}} 条",
"support.wallet.subscription.extra_plan_disabled_tip": "如需购买额外资源包,请先订阅套餐。",
"support.wallet.subscription.function.Community support tip": "可前往 FastGPT 社区免费获取帮助和技术支持",
"support.wallet.subscription.mode.Month": "按月",
"support.wallet.subscription.mode.Period": "订阅周期",
......@@ -1268,8 +1276,11 @@
"support.wallet.subscription.standardSubLevel.experience_desc": "可解锁 FastGPT 完整功能",
"support.wallet.subscription.standardSubLevel.free": "免费版",
"support.wallet.subscription.standardSubLevel.free desc": "核心功能免费试用。30 天未登录,将会清空知识库。",
"support.wallet.subscription.per_year": "/ 年",
"support.wallet.subscription.standardSubLevel.team": "团队版",
"support.wallet.subscription.standardSubLevel.team_desc": "适合小团队构建知识库应用并提供对外服务",
"support.wallet.subscription.standardSubLevel.trial": "试用版",
"support.wallet.subscription.standardSubLevel.trial_desc": "企业可免费试用15天,自激活应用时起计,每个企业限体验一次。",
"support.wallet.subscription.status.active": "生效中",
"support.wallet.subscription.status.expired": "已过期",
"support.wallet.subscription.status.inactive": "待使用",
......@@ -1297,6 +1308,7 @@
"support.wallet.usage.Total points": "AI 积分总消耗",
"support.wallet.usage.Usage Detail": "使用详情",
"support.wallet.usage.Whisper": "语音输入",
"support.wallet.wecom_bill_tip": "请前往企微-收银台进行账单查询和开票",
"sure_delete_tool_cannot_undo": "是否确认删除该工具?该操作无法撤回",
"sync_link": "同步链接",
"sync_success": "同步成功",
......
......@@ -35,8 +35,6 @@
"some_file_count_exceeds_limit": "超出 {{maxCount}} 个文件,已自动截取",
"some_file_size_exceeds_limit": "部分文件超出 {{maxSize}},已被过滤",
"support_file_type": "支持 {{fileType}} 类型文件",
"support_max_count": "最多支持 {{maxCount}} 个文件",
"support_max_size": "单个文件最大 {{maxSize}}",
"template_csv_file_select_tip": "仅支持<highlight>严格按照模板</highlight>填写的 {{fileType}} 文件",
"template_strict_highlight": "严格按照模版",
"total_files": "共{{selectFiles.length}}个文件",
......
......@@ -41,5 +41,6 @@
"type": "類型",
"unit_code": "統一信用代碼",
"unit_code_void": "統一信用代碼格式錯誤",
"update": "更新"
"update": "更新",
"wecom_not_pay_tip": "未支付,即將跳轉支付地址"
}
......@@ -247,6 +247,12 @@
"transfer_app_ownership": "轉移應用程式所有權",
"transfer_dataset_ownership": "轉移知識庫所有權",
"transfer_ownership": "轉讓所有者",
"transfer_team_ownership": "轉讓團隊",
"transfer_success": "轉讓成功",
"transfer_failed": "轉讓失敗",
"select_new_owner": "選擇新的所有者",
"confirm_transfer": "確認轉讓",
"transfer_warning": "警告:轉讓團隊所有權後,您將失去所有管理權限,且此操作不可撤銷。請謹慎操作。",
"type.Folder": "資料夾",
"type.Http plugin": "HTTP 外掛",
"type.Plugin": "外掛",
......
......@@ -356,6 +356,7 @@
"templateMarket.Use": "立即搭建",
"templateMarket.no_intro": "還沒有介紹~",
"templateMarket.templateTags.Recommendation": "推薦",
"templateMarket.templateTags.WecomZone": "企微專區",
"templateMarket.template_guide": "說明",
"template_market": "範本市集",
"template_market_description": "在範本市集探索更多玩法,設定教學與使用指引,帶您理解並上手各種應用程式",
......@@ -445,9 +446,17 @@
"toolkit_tool_config": "{{name}}配置",
"toolkit_tool_list": "工具列表",
"toolkit_tool_name": "工具名",
"toolkit_promote_tags": "推薦標籤",
"toolkit_promote_tags_tip": "擁有以下標籤的使用者會看到「推薦」標識",
"toolkit_hide_tags": "隱藏標籤",
"toolkit_hide_tags_tip": "擁有以下標籤的使用者將完全看不到此工具",
"toolkit_select_user_tags": "選擇使用者標籤",
"toolkit_uninstall": "卸載",
"toolkit_uninstalled": "未安裝",
"toolkit_update_failed": "更新失敗",
"toolkit_updatable": "可更新",
"toolkit_updatable_plugins": "可更新的外掛程式",
"toolkit_batch_update": "批次更新",
"toolkit_user_guide": "使用說明",
"tools_no_description": "這個工具沒有介紹~",
"transition_to_workflow": "轉換成工作流程",
......
......@@ -85,6 +85,7 @@
"Select_App": "選擇應用",
"Select_all": "全選",
"Setting": "設定",
"view_detail": "檢視詳情",
"Status": "狀態",
"Submit": "送出",
"Success": "成功",
......@@ -956,6 +957,9 @@
"n_custom_domain_amount_tip": "團隊可以配置的自定義域名數量,目前可用於接入企微智能機器人",
"n_dataset_amount": "{{amount}} 個知識庫",
"n_dataset_size": "{{amount}} 組知識庫索引",
"n_max_upload_file_count": "單次可上傳 {{amount}} 個文件",
"n_max_upload_file_limit": "單次可上傳 {{count}} 個 {{size}}MB 的文件",
"n_max_upload_file_size": "單個文件最大 {{amount}}MB",
"n_team_audit_day": "{{amount}} 天團隊操作日誌記錄",
"n_team_members": "{{amount}} 個團隊成員",
"n_team_qpm": "{{amount}} QPM",
......@@ -1178,6 +1182,7 @@
"support.wallet.bill.payWay.alipay": "支付寶支付",
"support.wallet.bill.payWay.balance": "餘額支付",
"support.wallet.bill.payWay.bank": "對公支付",
"support.wallet.bill.payWay.wecom": "企業微信支付",
"support.wallet.bill.payWay.wx": "微信支付",
"support.wallet.bill.status.closed": "已關閉",
"support.wallet.bill.status.notpay": "未付款",
......@@ -1187,6 +1192,7 @@
"support.wallet.bill_tag.bill": "帳單紀錄",
"support.wallet.bill_tag.default_header": "預設抬頭",
"support.wallet.bill_tag.invoice": "發票紀錄",
"support.wallet.wecom_bill_tip": "請前往企微-收銀台進行帳單查詢和開票",
"support.wallet.billable_invoice": "可開立發票的帳單",
"support.wallet.buy_ai_points": "購買 AI 積分",
"support.wallet.buy_dataset_capacity": "購買知識庫索引量",
......@@ -1221,6 +1227,7 @@
"support.wallet.subscription.Extra dataset unit": "組/1個月",
"support.wallet.subscription.Extra plan": "額外資源包",
"support.wallet.subscription.Extra plan tip": "當標準方案不足時,您可以購買額外資源包繼續使用",
"support.wallet.subscription.extra_plan_disabled_tip": "如需購買額外資源包,請先訂閱方案。",
"support.wallet.subscription.FAQ": "常見問題",
"support.wallet.subscription.Month amount": "月數",
"support.wallet.subscription.Next plan": "未來方案",
......@@ -1228,6 +1235,7 @@
"support.wallet.subscription.Stand plan level": "訂閱方案",
"support.wallet.subscription.Sub plan": "訂閱方案",
"support.wallet.subscription.Sub plan tip": "免費使用【{{title}}】或升級更進階的方案",
"support.wallet.subscription.Sub plan tip wecom": "購買方案以享受應用服務",
"support.wallet.subscription.Team plan and usage": "方案與使用量",
"support.wallet.subscription.Training weight": "訓練優先權:{{weight}}",
"support.wallet.subscription.Update extra ai points": "額外 AI 點數",
......@@ -1255,6 +1263,9 @@
"support.wallet.subscription.standardSubLevel.experience_desc": "可解鎖 FastGPT 完整功能",
"support.wallet.subscription.standardSubLevel.free": "免費版",
"support.wallet.subscription.standardSubLevel.free desc": "核心功能免費試用。 \n30 天未登錄,將會清空知識庫。",
"support.wallet.subscription.standardSubLevel.trial": "試用版",
"support.wallet.subscription.standardSubLevel.trial_desc": "企業可免費試用15天,自啟用應用時起計,每個企業限體驗一次。",
"support.wallet.subscription.per_year": "/ 年",
"support.wallet.subscription.standardSubLevel.team": "團隊版",
"support.wallet.subscription.standardSubLevel.team_desc": "適合小團隊建構知識庫應用並提供對外服務",
"support.wallet.subscription.status.active": "使用中",
......
......@@ -35,8 +35,6 @@
"some_file_count_exceeds_limit": "已超過 {{maxCount}} 個檔案上限,系統已自動截斷",
"some_file_size_exceeds_limit": "部分檔案超過 {{maxSize}} 大小限制,已自動過濾",
"support_file_type": "支援 {{fileType}} 格式的檔案",
"support_max_count": "最多可支援 {{maxCount}} 個檔案",
"support_max_size": "單一檔案大小上限為 {{maxSize}}",
"template_csv_file_select_tip": "僅支持<highlight>嚴格按照模板格式</highlight>的 {{fileType}} 文件",
"template_strict_highlight": "嚴格按照模版",
"total_files": "共{{selectFiles.length}}個文件",
......
......@@ -72,8 +72,8 @@ importers:
specifier: ^1.2.8
version: 1.2.8
'@fastgpt-sdk/plugin':
specifier: 0.2.17
version: 0.2.17(@types/node@20.14.0)
specifier: 0.3.6
version: 0.3.6
axios:
specifier: ^1.13.2
version: 1.13.2
......@@ -2605,8 +2605,8 @@ packages:
resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
'@fastgpt-sdk/plugin@0.2.17':
resolution: {integrity: sha512-TU93FD9JIeAV+isoLVVbW+yX14J27Kgd5Sn8LPvYWkrorUEtWeVfd8rOzh/KXPd43hCgD3bSDZ1W3hC06Spnog==}
'@fastgpt-sdk/plugin@0.3.6':
resolution: {integrity: sha512-glaLoTzrK9uvzAaIshVD6KpAE1ky0QOtX2Crbpbz0qZ1ERnlgI1q8N3vjx/qYih5t1ocUYeMce1SN7j84OxTCg==}
'@fastgpt-sdk/storage@0.6.15':
resolution: {integrity: sha512-oPbm6EtXQ3ysad/OebF2ovwbIax6PeCvYqA3cGAVEHEJMBU3633ktl1ZaIIkmyjWJLsABZpMf6m7lPBMyISGrA==}
......@@ -4628,17 +4628,6 @@ packages:
resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==}
engines: {node: '>=10.13.0'}
'@ts-rest/core@3.52.1':
resolution: {integrity: sha512-tAjz7Kxq/grJodcTA1Anop4AVRDlD40fkksEV5Mmal88VoZeRKAG8oMHsDwdwPZz+B/zgnz0q2sF+cm5M7Bc7g==}
peerDependencies:
'@types/node': ^18.18.7 || >=20.8.4
zod: ^3.22.3
peerDependenciesMeta:
'@types/node':
optional: true
zod:
optional: true
'@tsconfig/node10@1.0.11':
resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==}
......@@ -14716,13 +14705,10 @@ snapshots:
'@eslint/js@8.57.1': {}
'@fastgpt-sdk/plugin@0.2.17(@types/node@20.14.0)':
'@fastgpt-sdk/plugin@0.3.6':
dependencies:
'@fortaine/fetch-event-source': 3.0.6
'@ts-rest/core': 3.52.1(@types/node@20.14.0)(zod@3.25.76)
zod: 3.25.76
transitivePeerDependencies:
- '@types/node'
zod: 4.1.12
'@fastgpt-sdk/storage@0.6.15(@opentelemetry/api@1.9.0)(@types/node@20.17.24)(jiti@2.6.0)(lightningcss@1.30.1)(proxy-agent@6.5.0)(sass@1.85.1)(terser@5.39.0)(tsx@4.20.6)(yaml@2.8.1)':
dependencies:
......@@ -17180,11 +17166,6 @@ snapshots:
'@trysound/sax@0.2.0': {}
'@ts-rest/core@3.52.1(@types/node@20.14.0)(zod@3.25.76)':
optionalDependencies:
'@types/node': 20.14.0
zod: 3.25.76
'@tsconfig/node10@1.0.11': {}
'@tsconfig/node12@1.0.11': {}
......@@ -20219,17 +20200,6 @@ snapshots:
'@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@5.8.2)
eslint: 8.57.1
eslint-import-resolver-node: 0.3.9
eslint-import-resolver-typescript: 3.9.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1)
transitivePeerDependencies:
- supports-color
eslint-module-utils@2.12.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.9.0)(eslint@8.57.1):
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@5.8.2)
eslint: 8.57.1
eslint-import-resolver-node: 0.3.9
eslint-import-resolver-typescript: 3.9.0(eslint-plugin-import@2.31.0)(eslint@8.57.1)
transitivePeerDependencies:
- supports-color
......@@ -20303,7 +20273,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.57.1
eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.12.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.9.0)(eslint@8.57.1)
eslint-module-utils: 2.12.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.8.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.9.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.8.2))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1)
hasown: 2.0.2
is-core-module: 2.16.1
is-glob: 4.0.3
......
......@@ -98,6 +98,12 @@ WORKFLOW_MAX_LOOP_TIMES=50
SERVICE_REQUEST_MAX_CONTENT_LENGTH=10
# 启用内网 IP 检查
CHECK_INTERNAL_IP=false
# 文件上传
# 最大上传文件大小,单位 MB
UPLOAD_FILE_MAX_SIZE=1000
# 最大上传文件数量
UPLOAD_FILE_MAX_AMOUNT=1000
# 密码错误锁时长:s
PASSWORD_LOGIN_LOCK_SECONDS=
# 密码过期月份,不设置则不会过期
......
{
"name": "app",
"version": "4.14.5.1",
"version": "4.14.6",
"private": false,
"scripts": {
"dev": "npm run build:workers && next dev",
......
......@@ -4,10 +4,13 @@ import MyModal from '@fastgpt/web/components/common/MyModal';
import { useTranslation } from 'next-i18next';
import Markdown from '../Markdown';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { useUserStore } from '@/web/support/user/useUserStore';
const CommunityModal = ({ onClose }: { onClose: () => void }) => {
const { t } = useTranslation();
const { feConfigs } = useSystemStore();
const { userInfo } = useUserStore();
const isWecomTeam = !!userInfo?.team.isWecomTeam;
return (
<MyModal
......@@ -17,7 +20,11 @@ const CommunityModal = ({ onClose }: { onClose: () => void }) => {
title={t('common:system.Concat us')}
>
<ModalBody textAlign={'center'}>
<Markdown source={feConfigs?.concatMd || ''} />
{isWecomTeam ? (
'邮箱联系: archer@fastgpt.io'
) : (
<Markdown source={feConfigs?.concatMd || ''} />
)}
</ModalBody>
<ModalFooter>
......
......@@ -8,6 +8,7 @@ import { useTranslation } from 'next-i18next';
import React, { type DragEvent, useCallback, useMemo, useState } from 'react';
import { getFileIcon } from '@fastgpt/global/common/file/icon';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { useUserStore } from '@/web/support/user/useUserStore';
export type SelectFileItemType = {
file: File;
......@@ -21,7 +22,6 @@ const FileSelector = ({
selectFiles,
setSelectFiles,
maxCount = 1000,
maxSize,
FileTypeNode,
...props
}: {
......@@ -29,19 +29,25 @@ const FileSelector = ({
selectFiles: SelectFileItemType[];
setSelectFiles: (files: SelectFileItemType[]) => void;
maxCount?: number;
maxSize?: string;
FileTypeNode?: React.ReactNode;
} & FlexProps) => {
const { t } = useTranslation();
const { toast } = useToast();
const { feConfigs } = useSystemStore();
const { teamPlanStatus } = useUserStore();
const systemMaxSize = (feConfigs?.uploadFileMaxSize || 1024) * 1024 * 1024;
const displayMaxSize = maxSize || formatFileSize(systemMaxSize);
const formatMaxCount = feConfigs.uploadFileMaxAmount
? Math.min(maxCount, feConfigs.uploadFileMaxAmount)
: maxCount;
// 文件大小限制(B):团队套餐 || 系统配置 || 默认值
const displayMaxSize = formatFileSize(
(teamPlanStatus?.standardConstants?.maxUploadFileSize || feConfigs.uploadFileMaxSize) *
1024 *
1024
);
// 文件数量限制:组件传入的maxCount || 团队套餐 || 系统配置
const formatMaxCount = Math.min(
maxCount,
teamPlanStatus?.standardConstants?.maxUploadFileCount || feConfigs.uploadFileMaxAmount
);
const { File, onOpen } = useSelectFile({
fileType,
......@@ -208,10 +214,14 @@ const FileSelector = ({
</Box>
)}
<Box color={'myGray.500'} fontSize={'xs'}>
{/* max count */}
{formatMaxCount && <>{t('file:support_max_count', { maxCount: formatMaxCount })}, </>}
{/* max size */}
{t('file:support_max_size', { maxSize: displayMaxSize })}
{formatMaxCount && (
<>
{t('common:n_max_upload_file_limit', {
count: formatMaxCount,
size: displayMaxSize
})}
</>
)}
</Box>
</>
......
......@@ -20,6 +20,7 @@ import ChatFunctionTip from './Tip';
import FormLabel from '@fastgpt/web/components/common/MyBox/FormLabel';
import { useMount } from 'ahooks';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { useUserStore } from '@/web/support/user/useUserStore';
import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip';
import MyTag from '@fastgpt/web/components/common/Tag/index';
import { defaultAppSelectFileConfig } from '@fastgpt/global/core/app/constants';
......@@ -38,8 +39,14 @@ const FileSelect = ({
}) => {
const { t } = useTranslation();
const { feConfigs } = useSystemStore();
const { teamPlanStatus } = useUserStore();
const { isOpen, onOpen, onClose } = useDisclosure();
const maxSelectFiles = Math.min(feConfigs?.uploadFileMaxAmount ?? 20, 30);
// 文件数量限制:团队套餐 || 系统配置 || 默认值(这里是指对话中,最多上传多少文件)
const maxSelectFiles = Math.min(
teamPlanStatus?.standardConstants?.maxUploadFileCount || feConfigs.uploadFileMaxAmount,
50
);
const [localValue, setLocalValue] = useState(value);
......
......@@ -16,9 +16,9 @@ import { ChatFileTypeEnum } from '@fastgpt/global/core/chat/constants';
import { getFileIcon } from '@fastgpt/global/common/file/icon';
import type { AppFileSelectConfigType } from '@fastgpt/global/core/app/type';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { useUserStore } from '@/web/support/user/useUserStore';
import { getUploadFileType } from '@fastgpt/global/core/app/constants';
import { useToast } from '@fastgpt/web/hooks/useToast';
import { useTranslation } from 'next-i18next';
import { useSelectFile } from '@/web/common/file/hooks/useSelectFile';
import { getNanoid } from '@fastgpt/global/common/string/tools';
import MyDivider from '@fastgpt/web/components/common/MyDivider';
......@@ -53,6 +53,7 @@ const FileSelector = ({
isDisabled?: boolean;
}) => {
const { feConfigs } = useSystemStore();
const { teamPlanStatus } = useUserStore();
const { toast } = useToast();
const { t } = useSafeTranslation();
......@@ -88,8 +89,17 @@ const FileSelector = ({
canSelectCustomFileExtension,
customFileExtensionList
]);
const maxSelectFiles = maxFiles ?? 10;
const maxSize = (feConfigs?.uploadFileMaxSize || 1024) * 1024 * 1024; // nkb
// 文件数量限制:组件参数 || 团队套餐 || 系统配置 || 默认值
const maxSelectFiles =
maxFiles ||
teamPlanStatus?.standardConstants?.maxUploadFileCount ||
feConfigs?.uploadFileMaxAmount ||
10;
// 文件大小限制(MB):团队套餐 || 系统配置 || 默认值
const maxSize =
(teamPlanStatus?.standardConstants?.maxUploadFileSize || feConfigs?.uploadFileMaxSize || 500) *
1024 *
1024;
const canSelectFileAmount = maxSelectFiles - value.length;
const isMaxSelected = canSelectFileAmount <= 0;
......
......@@ -11,6 +11,7 @@ type TimeInputProps = {
timeGranularity?: 'day' | 'hour' | 'minute' | 'second';
minDate?: Date;
maxDate?: Date;
isDisabled?: boolean;
};
const TimeInput: React.FC<TimeInputProps> = ({
......@@ -19,7 +20,8 @@ const TimeInput: React.FC<TimeInputProps> = ({
popPosition = 'bottom',
timeGranularity = 'second',
minDate,
maxDate
maxDate,
isDisabled
}) => {
const formatValue = useMemo(() => {
const val = initialValue ? new Date(initialValue) : undefined;
......@@ -89,6 +91,7 @@ const TimeInput: React.FC<TimeInputProps> = ({
...(minDate ? [{ before: minDate }] : []),
...(maxDate ? [{ after: maxDate }] : [])
]}
isDisabled={isDisabled}
w={'168px'}
h={8}
borderColor={'myGray.200'}
......@@ -103,12 +106,12 @@ const TimeInput: React.FC<TimeInputProps> = ({
w={'48px'}
size={'sm'}
hideStepper
isDisabled={!enableHour}
isDisabled={isDisabled || !enableHour}
inputFieldProps={{
pr: '20px',
pl: '8px',
bg: enableHour ? 'white' : 'myGray.100',
color: enableHour ? 'inherit' : 'myGray.400'
bg: isDisabled || !enableHour ? 'myGray.100' : 'white',
color: isDisabled || !enableHour ? 'myGray.400' : 'inherit'
}}
/>
<Box
......@@ -117,7 +120,7 @@ const TimeInput: React.FC<TimeInputProps> = ({
top={'50%'}
transform={'translateY(-50%)'}
fontSize={'12px'}
color={enableHour ? 'myGray.500' : 'myGray.300'}
color={isDisabled || !enableHour ? 'myGray.300' : 'myGray.500'}
pointerEvents={'none'}
zIndex={1}
>
......@@ -133,12 +136,12 @@ const TimeInput: React.FC<TimeInputProps> = ({
w={'48px'}
size={'sm'}
hideStepper
isDisabled={!enableMinute}
isDisabled={isDisabled || !enableMinute}
inputFieldProps={{
pr: '20px',
pl: '8px',
bg: enableMinute ? 'white' : 'myGray.100',
color: enableMinute ? 'inherit' : 'myGray.400'
bg: isDisabled || !enableMinute ? 'myGray.100' : 'white',
color: isDisabled || !enableMinute ? 'myGray.400' : 'inherit'
}}
/>
<Box
......@@ -147,7 +150,7 @@ const TimeInput: React.FC<TimeInputProps> = ({
top={'50%'}
transform={'translateY(-50%)'}
fontSize={'12px'}
color={enableMinute ? 'myGray.500' : 'myGray.300'}
color={isDisabled || !enableMinute ? 'myGray.300' : 'myGray.500'}
pointerEvents={'none'}
zIndex={1}
>
......@@ -163,12 +166,12 @@ const TimeInput: React.FC<TimeInputProps> = ({
w={'48px'}
size={'sm'}
hideStepper
isDisabled={!enableSecond}
isDisabled={isDisabled || !enableSecond}
inputFieldProps={{
pr: '20px',
pl: '8px',
bg: enableSecond ? 'white' : 'myGray.100',
color: enableSecond ? 'inherit' : 'myGray.400'
bg: isDisabled || !enableSecond ? 'myGray.100' : 'white',
color: isDisabled || !enableSecond ? 'myGray.400' : 'inherit'
}}
/>
<Box
......@@ -177,7 +180,7 @@ const TimeInput: React.FC<TimeInputProps> = ({
top={'50%'}
transform={'translateY(-50%)'}
fontSize={'12px'}
color={enableSecond ? 'myGray.500' : 'myGray.300'}
color={isDisabled || !enableSecond ? 'myGray.300' : 'myGray.500'}
pointerEvents={'none'}
zIndex={1}
>
......
......@@ -13,7 +13,7 @@ import TimeInput from './TimeInput';
import { useSafeTranslation } from '@fastgpt/web/hooks/useSafeTranslation';
import { isSecretValue } from '@fastgpt/global/common/secret/utils';
import FileSelector from '../FileSelector/index';
import { formatTime2YMDHMS } from '@fastgpt/global/common/string/time';
import { formatTime2YMDHMS, formatToISOWithTimezone } from '@fastgpt/global/common/string/time';
import { useMemoEnhance } from '@fastgpt/web/hooks/useMemoEnhance';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import type { SelectedDatasetType } from '@fastgpt/global/core/workflow/type/io';
......@@ -274,10 +274,11 @@ const InputRender = (props: InputRenderProps) => {
return (
<TimeInput
value={val ? new Date(val) : undefined}
onDateTimeChange={(date) => onChange?.(date ? date.toISOString() : undefined)}
onDateTimeChange={(date) => onChange?.(date ? formatToISOWithTimezone(date) : undefined)}
timeGranularity={props.timeGranularity}
minDate={timeRangeStart ? new Date(timeRangeStart) : undefined}
maxDate={timeRangeEnd ? new Date(timeRangeEnd) : undefined}
isDisabled={isDisabled}
/>
);
}
......@@ -296,7 +297,7 @@ const InputRender = (props: InputRenderProps) => {
value={startDate ? new Date(formatTime2YMDHMS(startDate)) : undefined}
onDateTimeChange={(date) => {
const newArray = [...rangeArray];
newArray[0] = date ? date.toISOString() : undefined;
newArray[0] = date ? formatToISOWithTimezone(date) : undefined;
onChange?.(newArray);
}}
timeGranularity={props.timeGranularity}
......@@ -304,6 +305,7 @@ const InputRender = (props: InputRenderProps) => {
endDate ? new Date(endDate) : timeRangeEnd ? new Date(timeRangeEnd) : undefined
}
minDate={timeRangeStart ? new Date(timeRangeStart) : undefined}
isDisabled={isDisabled}
/>
</Box>
<Box>
......@@ -314,7 +316,7 @@ const InputRender = (props: InputRenderProps) => {
value={endDate ? new Date(formatTime2YMDHMS(endDate)) : undefined}
onDateTimeChange={(date) => {
const newArray = [...rangeArray];
newArray[1] = date ? date.toISOString() : undefined;
newArray[1] = date ? formatToISOWithTimezone(date) : undefined;
onChange?.(newArray);
}}
timeGranularity={props.timeGranularity}
......@@ -326,6 +328,7 @@ const InputRender = (props: InputRenderProps) => {
: undefined
}
maxDate={timeRangeEnd ? new Date(timeRangeEnd) : undefined}
isDisabled={isDisabled}
/>
</Box>
</Box>
......
......@@ -12,6 +12,7 @@ import { type UseFieldArrayReturn } from 'react-hook-form';
import { type ChatBoxInputFormType, type UserInputFileItemType } from '../type';
import { type AppFileSelectConfigType } from '@fastgpt/global/core/app/type';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { useUserStore } from '@/web/support/user/useUserStore';
import { type OutLinkChatAuthProps } from '@fastgpt/global/support/permission/chat';
import { getPresignedChatFileGetUrl, getUploadChatFilePresignedUrl } from '@/web/common/file/api';
import { getUploadFileType } from '@fastgpt/global/core/app/constants';
......@@ -31,6 +32,7 @@ export const useFileUpload = (props: UseFileUploadOptions) => {
const { toast } = useToast();
const { t } = useTranslation();
const { feConfigs } = useSystemStore();
const { teamPlanStatus } = useUserStore();
const {
update: updateFiles,
......@@ -52,8 +54,17 @@ export const useFileUpload = (props: UseFileUploadOptions) => {
showSelectVideo ||
showSelectAudio ||
showSelectCustomFileExtension;
const maxSelectFiles = fileSelectConfig?.maxFiles ?? 10;
const maxSize = (feConfigs?.uploadFileMaxSize || 1024) * 1024 * 1024; // nkb
// 文件数量限制:配置的maxFiles || 团队套餐 || 系统配置 || 默认值
const maxSelectFiles =
fileSelectConfig?.maxFiles ||
teamPlanStatus?.standardConstants?.maxUploadFileCount ||
feConfigs?.uploadFileMaxAmount ||
10;
// 文件大小限制(MB):团队套餐 || 系统配置 || 默认值
const maxSize =
(teamPlanStatus?.standardConstants?.maxUploadFileSize || feConfigs?.uploadFileMaxSize || 500) *
1024 *
1024;
const canSelectFileAmount = maxSelectFiles - fileList.length;
const { icon: selectFileIcon, label: selectFileLabel } = useMemo(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment