Compare commits

..

8 Commits

Author SHA1 Message Date
Archer
d857a391b3 4.8.20 update (#3706)
* fix: rerank auth token

* feat: check null value

* bind notify

* perf: reasoning config

* Adapt mongo 4.x index
2025-02-06 14:34:43 +08:00
Archer
772c1cde77 remove log (#3692) 2025-02-05 11:17:38 +08:00
Archer
b6e441c5eb fix: replace img host (#3691) 2025-02-05 10:21:35 +08:00
Archer
ac95828660 update doc (#3690) 2025-02-05 10:01:57 +08:00
Archer
f252918228 model config doc (#3689) 2025-02-05 09:52:03 +08:00
Archer
5c360b5ae6 doc (#3688) 2025-02-05 01:34:10 +08:00
Archer
09fa602dde readme (#3687)
* fix: doc deploy

* readme
2025-02-05 00:26:24 +08:00
Archer
db2c0a0bdb V4.8.20 feature (#3686)
* Aiproxy (#3649)

* model config

* feat: model config ui

* perf: rename variable

* feat: custom request url

* perf: model buffer

* perf: init model

* feat: json model config

* auto login

* fix: ts

* update packages

* package

* fix: dockerfile

* feat: usage filter & export & dashbord (#3538)

* feat: usage filter & export & dashbord

* adjust ui

* fix tmb scroll

* fix code & selecte all

* merge

* perf: usages list;perf: move components (#3654)

* perf: usages list

* team sub plan load

* perf: usage dashboard code

* perf: dashboard ui

* perf: move components

* add default model config (#3653)

* 4.8.20 test (#3656)

* provider

* perf: model config

* model perf (#3657)

* fix: model

* dataset quote

* perf: model config

* model tag

* doubao model config

* perf: config model

* feat: model test

* fix: POST 500 error on dingtalk bot (#3655)

* feat: default model (#3662)

* move model config

* feat: default model

* fix: false triggerd org selection (#3661)

* export usage csv i18n (#3660)

* export usage csv i18n

* fix build

* feat: markdown extension (#3663)

* feat: markdown extension

* media cros

* rerank test

* default price

* perf: default model

* fix: cannot custom provider

* fix: default model select

* update bg

* perf: default model selector

* fix: usage export

* i18n

* fix: rerank

* update init extension

* perf: ip limit check

* doubao model order

* web default modle

* perf: tts selector

* perf: tts error

* qrcode package

* reload buffer (#3665)

* reload buffer

* reload buffer

* tts selector

* fix: err tip (#3666)

* fix: err tip

* perf: training queue

* doc

* fix interactive edge (#3659)

* fix interactive edge

* fix

* comment

* add gemini model

* fix: chat model select

* perf: supplement assistant empty response (#3669)

* perf: supplement assistant empty response

* check array

* perf: max_token count;feat: support resoner output;fix: member scroll (#3681)

* perf: supplement assistant empty response

* check array

* perf: max_token count

* feat: support resoner output

* member scroll

* update provider order

* i18n

* fix: stream response (#3682)

* perf: supplement assistant empty response

* check array

* fix: stream response

* fix: model config cannot set to null

* fix: reasoning response (#3684)

* perf: supplement assistant empty response

* check array

* fix: reasoning response

* fix: reasoning response

* doc (#3685)

* perf: supplement assistant empty response

* check array

* doc

* lock

* animation

* update doc

* update compose

* doc

* doc

---------

Co-authored-by: heheer <heheer@sealos.io>
Co-authored-by: a.e. <49438478+I-Info@users.noreply.github.com>
2025-02-05 00:10:47 +08:00
26 changed files with 144 additions and 75 deletions

View File

@@ -58,7 +58,7 @@ jobs:
# Step 4 - Builds the site using Hugo
- name: Build
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
# Step 5 - Push our generated site to Vercel
- name: Deploy to Vercel

View File

@@ -58,7 +58,7 @@ jobs:
# Step 4 - Builds the site using Hugo
- name: Build
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
# Step 5 - Push our generated site to Vercel
- name: Deploy to Vercel

View File

@@ -83,6 +83,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
- [x] 统一查阅对话记录,并对数据进行标注
`6` 其他
- [x] 可视化模型配置。
- [x] 支持语音输入和输出 (可配置语音输入语音回答)
- [x] 模糊输入提示
- [x] 模板市场

View File

@@ -3,7 +3,7 @@ FROM hugomods/hugo:0.117.0 AS builder
WORKDIR /app
ADD ./docSite hugo
RUN cd /app/hugo && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
RUN cd /app/hugo && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
FROM fholzer/nginx-brotli:latest

View File

@@ -11,7 +11,9 @@ weight: 744
从 4.8.20 版本开始,你可以直接在 FastGPT 页面中进行模型配置,并且系统内置了大量模型,无需从 0 开始配置。下面介绍模型配置的基本流程:
## 1. 使用 OneAPI 对接模型提供商
## 配置模型
### 1. 使用 OneAPI 对接模型提供商
可以使用 [OneAPI 接入教程](/docs/development/modelconfig/one-api) 来进行模型聚合,从而可以对接更多模型提供商。你需要先在各服务商申请好 API 接入 OneAPI 后,才能在 FastGPT 中使用这些模型。示例流程如下:
@@ -26,44 +28,46 @@ weight: 744
在 OneAPI 配置好模型后,你就可以打开 FastGPT 页面,启用对应模型了。
## 2. 登录 root 用户
### 2. 登录 root 用户
仅 root 用户可以进行模型配置。
## 3. 进入模型配置页面
### 3. 进入模型配置页面
登录 root 用户后,在`账号-模型提供商-模型配置`中,你可以看到所有内置的模型和自定义模型,以及哪些模型启用了。
![alt text](/image-90.png)
## 4. 配置介绍
### 4. 配置介绍
{{% alert icon="🤖 " context="success" %}}
注意:目前语音识别模型和重排模型仅会生效一个,所以配置时候,只需要配置一个即可。
注意:
1. 目前语音识别模型和重排模型仅会生效一个,所以配置时候,只需要配置一个即可。
2. 用于知识库文件处理的语言模型,至少需要开启一个,否则知识库会报错。
{{% /alert %}}
### 核心配置
#### 核心配置
- 模型 ID接口请求时候Body 中`model`字段的值,全局唯一。
- 自定义请求地址/Key如果需要绕过`OneAPI`,可以设置自定义请求地址和 Token。一般情况下不需要如果 OneAPI 不支持某些模型,可以使用该特性。
### 模型类型
#### 模型类型
1. 语言模型 - 进行文本对话,多模态模型支持图片识别。
2. 索引模型 - 对文本块进行索引,用于相关文本检索。
3. 语音合成 - 将文本转换为语音
4. 语音识别 - 将语音转换为文本
5. 重排模型 - 对文本进行重排,用于优化文本质量
3. 重排模型 - 对检索结果进行重排,用于优化检索排名
4. 语音合成 - 将文本转换为语音
5. 语音识别 - 将语音转换为文本
### 启用模型
#### 启用模型
系统内置了目前主流厂商的模型,如果你不熟悉配置,直接点击`启用`即可,需要注意是,模型 ID 需要和 OneAPI 中渠道的`模型`一致。
系统内置了目前主流厂商的模型,如果你不熟悉配置,直接点击`启用`即可,需要注意是,`模型 ID`需要和 OneAPI 中渠道的`模型`一致。
| | |
| --- | --- |
| ![alt text](/imgs/image-91.png) | ![alt text](/imgs/image-92.png) |
### 修改模型配置
#### 修改模型配置
点击模型右侧的齿轮即可进行模型配置,不同类型模型的配置有区别。
@@ -71,7 +75,7 @@ weight: 744
| --- | --- |
| ![alt text](/imgs/image-93.png) | ![alt text](/imgs/image-94.png) |
### 新增自定义模型
## 新增自定义模型
如果系统内置的模型无法满足你的需求,你可以添加自定义模型。自定义模型中,如果`模型 ID`与系统内置的模型 ID 一致,则会被认为是修改系统模型。
@@ -79,7 +83,7 @@ weight: 744
| --- | --- |
| ![alt text](/imgs/image-96.png) | ![alt text](/imgs/image-97.png) |
### 通过配置文件配置
#### 通过配置文件配置
如果你觉得通过页面配置模型比较麻烦,你也可以通过配置文件来配置模型。或者希望快速将一个系统的配置,复制到另一个系统,也可以通过配置文件来实现。
@@ -258,6 +262,30 @@ OneAPI 的语言识别接口,无法正确的识别其他模型(会始终识
由于 OpenAI 没有提供 ReRank 模型,遵循的是 Cohere 的格式。[点击查看接口请求示例](/docs/development/faq/#如何检查模型问题)
### 模型价格配置
商业版用户可以通过配置模型价格,来进行账号计费。系统包含两种计费模式:按总 tokens 计费和输入输出 Tokens 分开计费。
如果需要配置`输入输出 Tokens 分开计费模式`,则填写`模型输入价格``模型输出价格`两个值。
如果需要配置`按总 tokens 计费模式`,则填写`模型综合价格`一个值。
## 如何提交内置模型
由于模型更新非常频繁,官方不一定及时更新,如果未能找到你期望的内置模型,你可以[提交 Issue](https://github.com/labring/FastGPT/issues),提供模型的名字和对应官网。或者直接[提交 PR](https://github.com/labring/FastGPT/pulls),提供模型配置。
### 添加模型提供商
如果你需要添加模型提供商,需要修改以下代码:
1. FastGPT/packages/web/components/common/Icon/icons/model - 在此目录下,添加模型提供商的 svg 头像地址。
2. 在 FastGPT 根目录下,运行`pnpm initIcon`,将图片加载到配置文件中。
3. FastGPT/packages/global/core/ai/provider.ts - 在此文件中,追加模型提供商的配置。
### 添加模型
你可以在`FastGPT/packages/service/core/ai/config/provider`目录下,找对应模型提供商的配置文件,并追加模型配置。请自行全文检查,`model`字段,必须在所有模型中唯一。具体配置字段说明,参考[模型配置字段说明](/docs/development/modelconfig/intro/#通过配置文件配置)
## 旧版模型配置说明
配置好 OneAPI 后,需要在`config.json`文件中,手动的增加模型配置,并重启。

View File

@@ -1,5 +1,5 @@
---
title: 'V4.8.19(进行中)'
title: 'V4.8.19(包含升级脚本)'
description: 'FastGPT V4.8.19 更新说明'
icon: 'upgrade'
draft: false

View File

@@ -1,5 +1,5 @@
---
title: 'V4.8.20(进行中)'
title: 'V4.8.20(包含升级脚本)'
description: 'FastGPT V4.8.20 更新说明'
icon: 'upgrade'
draft: false
@@ -17,8 +17,8 @@ weight: 804
### 3. 更新镜像:
- 更新 fastgpt 镜像 tag: v4.8.20
- 更新 fastgpt-pro 商业版镜像 tag: v4.8.20
- 更新 fastgpt 镜像 tag: v4.8.20-fix
- 更新 fastgpt-pro 商业版镜像 tag: v4.8.20-fix
- Sandbox 镜像无需更新
### 4. 运行升级脚本

View File

@@ -114,15 +114,15 @@ services:
# fastgpt
sandbox:
container_name: sandbox
image: ghcr.io/labring/fastgpt-sandbox:v4.8.20 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.20 # 阿里云
image: ghcr.io/labring/fastgpt-sandbox:v4.8.20-fix # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.20-fix # 阿里云
networks:
- fastgpt
restart: always
fastgpt:
container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.8.20 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.20 # 阿里云
image: ghcr.io/labring/fastgpt:v4.8.20-fix # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.20-fix # 阿里云
ports:
- 3000:3000
networks:

View File

@@ -72,15 +72,15 @@ services:
# fastgpt
sandbox:
container_name: sandbox
image: ghcr.io/labring/fastgpt-sandbox:v4.8.20 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.20 # 阿里云
image: ghcr.io/labring/fastgpt-sandbox:v4.8.20-fix # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.20-fix # 阿里云
networks:
- fastgpt
restart: always
fastgpt:
container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.8.20 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.20 # 阿里云
image: ghcr.io/labring/fastgpt:v4.8.20-fix # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.20-fix # 阿里云
ports:
- 3000:3000
networks:

View File

@@ -53,15 +53,15 @@ services:
wait $$!
sandbox:
container_name: sandbox
image: ghcr.io/labring/fastgpt-sandbox:v4.8.20 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.20 # 阿里云
image: ghcr.io/labring/fastgpt-sandbox:v4.8.20-fix # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.20-fix # 阿里云
networks:
- fastgpt
restart: always
fastgpt:
container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.8.20 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.20 # 阿里云
image: ghcr.io/labring/fastgpt:v4.8.20-fix # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.20-fix # 阿里云
ports:
- 3000:3000
networks:

View File

@@ -61,6 +61,9 @@ export const getModelFromList = (
model: string
) => {
const modelData = modelList.find((item) => item.model === model) ?? modelList[0];
if (!modelData) {
throw new Error('No Key model is configured');
}
const provider = getModelProvider(modelData.provider);
return {
...modelData,

View File

@@ -63,6 +63,13 @@ export const getMongoModel = <T>(name: string, schema: mongoose.Schema) => {
const model = connectionMongo.model<T>(name, schema);
// Sync index
syncMongoIndex(model);
return model;
};
const syncMongoIndex = async (model: Model<any>) => {
if (process.env.SYNC_INDEX !== '0' && process.env.NODE_ENV !== 'test') {
try {
model.syncIndexes({ background: true });
@@ -70,8 +77,6 @@ export const getMongoModel = <T>(name: string, schema: mongoose.Schema) => {
addLog.error('Create index error', error);
}
}
return model;
};
export const ReadPreference = connectionMongo.mongo.ReadPreference;

View File

@@ -24,7 +24,7 @@ export const aiTranscriptions = async ({
? { url: modelData.requestUrl }
: {
baseURL: aiAxiosConfig.baseUrl,
url: modelData.requestUrl || '/audio/transcriptions'
url: '/audio/transcriptions'
}),
headers: {
Authorization: modelData.requestAuth

View File

@@ -11,7 +11,11 @@ import {
ReRankModelItemType
} from '@fastgpt/global/core/ai/model.d';
import { debounce } from 'lodash';
import { ModelProviderType } from '@fastgpt/global/core/ai/provider';
import {
getModelProvider,
ModelProviderIdType,
ModelProviderType
} from '@fastgpt/global/core/ai/provider';
import { findModelFromAlldata } from '../model';
import {
reloadFastGPTConfigBuffer,
@@ -91,7 +95,7 @@ export const loadSystemModels = async (init = false) => {
await Promise.all(
providerList.map(async (name) => {
const fileContent = (await import(`./provider/${name}`))?.default as {
provider: ModelProviderType;
provider: ModelProviderIdType;
list: SystemModelItemType[];
};
@@ -101,7 +105,7 @@ export const loadSystemModels = async (init = false) => {
const modelData: any = {
...fileModel,
...dbModel?.metadata,
provider: dbModel?.metadata?.provider || fileContent.provider,
provider: getModelProvider(dbModel?.metadata?.provider || fileContent.provider).id,
type: dbModel?.metadata?.type || fileModel.type,
isCustom: false
};

View File

@@ -32,12 +32,14 @@ export async function getVectorsByText({ model, input, type }: GetVectorProps) {
model: model.model,
input: [input]
},
model.requestUrl && model.requestAuth
model.requestUrl
? {
path: model.requestUrl,
headers: {
Authorization: `Bearer ${model.requestAuth}`
}
headers: model.requestAuth
? {
Authorization: `Bearer ${model.requestAuth}`
}
: undefined
}
: {}
)

View File

@@ -26,7 +26,7 @@ export function reRankRecall({
return Promise.reject('no rerank model');
}
const { baseUrl, authorization } = getAxiosConfig({});
const { baseUrl, authorization } = getAxiosConfig();
let start = Date.now();
return POST<PostReRankResponse>(
@@ -38,7 +38,7 @@ export function reRankRecall({
},
{
headers: {
Authorization: model.requestAuth ? model.requestAuth : authorization
Authorization: model.requestAuth ? `Bearer ${model.requestAuth}` : authorization
},
timeout: 30000
}

View File

@@ -92,7 +92,10 @@ export const loadRequestMessages = async ({
const baseURL = process.env.FE_DOMAIN;
if (!baseURL) return text;
// 匹配 /api/system/img/xxx.xx 的图片链接,并追加 baseURL
return text.replace(/(\/api\/system\/img\/[^\s.]*\.[^\s]*)/g, (match, p1) => `${baseURL}${p1}`);
return text.replace(
/(?<!https?:\/\/[^\s]*)(?:\/api\/system\/img\/[^\s.]*\.[^\s]*)/g,
(match) => `${baseURL}${match}`
);
};
const parseSystemMessage = (
content: string | ChatCompletionContentPartText[]

View File

@@ -37,12 +37,7 @@ try {
{ teamId: 1, datasetId: 1, fullTextToken: 'text' },
{
name: 'teamId_1_datasetId_1_fullTextToken_text',
default_language: 'none',
collation: {
locale: 'simple', // 使用简单匹配规则
strength: 2, // 忽略大小写
caseLevel: false // 进一步确保大小写不敏感
}
default_language: 'none'
}
);
DatasetDataTextSchema.index({ dataId: 1 }, { unique: true });

View File

@@ -20,9 +20,9 @@
"model.charsPointsPrice": "Chars Price",
"model.charsPointsPrice_tip": "Combine the model input and output for Token billing. If the language model is configured with input and output billing separately, the input and output will be calculated separately.",
"model.custom_cq_prompt": "Custom question classification prompt words",
"model.custom_cq_prompt_tip": "Override the system's default question classification prompt words, which default to:\n\"\"\"\n请帮我执行一个“问题分类”任务,将问题分类为以下几种类型之一:\n\n\"\"\"\n{{typeList}}\n\"\"\"\n\n## 背景知识\n{{systemPrompt}}\n\n## 对话记录\n{{history}}\n\n## 开始任务\n\n现在我们开始分类我会给你一个\"问题\"请结合背景知识和对话记录将问题分类到对应的类型中并返回类型ID。\n\n问题\"{{question}}\"\n类型ID=\n\"\"\"",
"model.custom_cq_prompt_tip": "Override the system's default question classification prompt words, which default to:\n\"\"\"\n{{prompt}}\n\"\"\"",
"model.custom_extract_prompt": "Custom content extraction prompt words",
"model.custom_extract_prompt_tip": "Override system prompt word, default is:\n\"\"\"\n你可以从 <对话记录></对话记录> 中提取指定 Json 信息,你仅需返回 Json 字符串,无需回答问题。\n<提取要求>\n{{description}}\n</提取要求>\n\n<提取规则>\n- 本次需提取的 json 字符串,需符合 JsonSchema 的规则。\n- type 代表数据类型; key 代表字段名; description 代表字段的描述; enum 是枚举值,代表可选的 value。\n- 如果没有可提取的内容,忽略该字段。\n</提取规则>\n\n<JsonSchema>\n{{json}}\n</JsonSchema>\n\n<对话记录>\n{{text}}\n</对话记录>\n\n提取的 json 字符串:\n\"\"\"",
"model.custom_extract_prompt_tip": "The reminder word of the coverage of the system, the default:\n\"\"\"\n{{prompt}}\n\"\"\"",
"model.dataset_process": "Dataset file parse",
"model.defaultConfig": "Additional Body parameters",
"model.defaultConfig_tip": "Each request will carry this additional Body parameter.",
@@ -49,6 +49,8 @@
"model.output_price": "Output price",
"model.output_price_tip": "The language model output price. If this item is configured, the model comprehensive price will be invalid.",
"model.param_name": "Parameter name",
"model.reasoning": "Support output thinking",
"model.reasoning_tip": "For example, Deepseek-reasoner can output the thinking process.",
"model.request_auth": "Custom key",
"model.request_auth_tip": "When making a request to a custom request address, carry the request header: Authorization: Bearer xxx to make the request.",
"model.request_url": "Custom url",

View File

@@ -20,9 +20,9 @@
"model.charsPointsPrice": "模型综合价格",
"model.charsPointsPrice_tip": "将模型输入和输出合并起来进行 Token 计费,语言模型如果单独配置了输入和输出计费,则按输入和输出分别计算",
"model.custom_cq_prompt": "自定义问题分类提示词",
"model.custom_cq_prompt_tip": "覆盖系统默认的问题分类提示词,默认为:\n",
"model.custom_cq_prompt_tip": "覆盖系统默认的问题分类提示词,默认为:\n\"\"\"\n{{prompt}}\n\"\"\"",
"model.custom_extract_prompt": "自定义内容提取提示词",
"model.custom_extract_prompt_tip": "覆盖系统的提示词,默认为:\n\"\"\"\n你可以从 <对话记录></对话记录> 中提取指定 Json 信息,你仅需返回 Json 字符串,无需回答问题。\n<提取要求>\n{{description}}\n</提取要求>\n\n<提取规则>\n- 本次需提取的 json 字符串,需符合 JsonSchema 的规则。\n- type 代表数据类型; key 代表字段名; description 代表字段的描述; enum 是枚举值,代表可选的 value。\n- 如果没有可提取的内容,忽略该字段。\n</提取规则>\n\n<JsonSchema>\n{{json}}\n</JsonSchema>\n\n<对话记录>\n{{text}}\n</对话记录>\n\n提取的 json 字符串:\n\"\"\"",
"model.custom_extract_prompt_tip": "覆盖系统的提示词,默认为:\n\"\"\"\n{{prompt}}\n\"\"\"",
"model.dataset_process": "用于知识库文件处理",
"model.defaultConfig": "额外 Body 参数",
"model.defaultConfig_tip": "每次请求时候,都会携带该额外 Body 参数",
@@ -49,6 +49,8 @@
"model.output_price": "模型输出价格",
"model.output_price_tip": "语言模型输出价格,如果配置了该项,则模型综合价格会失效",
"model.param_name": "参数名",
"model.reasoning": "支持输出思考",
"model.reasoning_tip": "例如 Deepseek-reasoner可以输出思考过程。",
"model.request_auth": "自定义请求 Key",
"model.request_auth_tip": "向自定义请求地址发起请求时候携带请求头Authorization: Bearer xxx 进行请求",
"model.request_url": "自定义请求地址",

View File

@@ -19,9 +19,9 @@
"model.charsPointsPrice": "模型綜合價格",
"model.charsPointsPrice_tip": "將模型輸入和輸出合併起來進行 Token 計費,語言模型如果單獨配置了輸入和輸出計費,則按輸入和輸出分別計算",
"model.custom_cq_prompt": "自訂問題分類提示詞",
"model.custom_cq_prompt_tip": "覆蓋系統預設的問題分類提示詞,預設為:\n\"\"\"\n请帮我执行一个“问题分类”任务,将问题分类为以下几种类型之一:\n\n\"\"\"\n{{typeList}}\n\"\"\"\n\n## 背景知识\n{{systemPrompt}}\n\n## 对话记录\n{{history}}\n\n## 开始任务\n\n现在我们开始分类我会给你一个\"问题\"请结合背景知识和对话记录将问题分类到对应的类型中并返回类型ID。\n\n问题\"{{question}}\"\n类型ID=\n\"\"\"",
"model.custom_cq_prompt_tip": "覆蓋系統預設的問題分類提示詞,預設為:\n\"\"\"\n{{prompt}}\n\"\"\"",
"model.custom_extract_prompt": "自訂內容提取提示詞",
"model.custom_extract_prompt_tip": "覆蓋系統的提示詞,預設為:\n\"\"\"\n你可以从 <对话记录></对话记录> 中提取指定 Json 信息,你仅需返回 Json 字符串,无需回答问题。\n<提取要求>\n{{description}}\n</提取要求>\n\n<提取规则>\n- 本次需提取的 json 字符串,需符合 JsonSchema 的规则。\n- type 代表数据类型; key 代表字段名; description 代表字段的描述; enum 是枚举值,代表可选的 value。\n- 如果没有可提取的内容,忽略该字段。\n</提取规则>\n\n<JsonSchema>\n{{json}}\n</JsonSchema>\n\n<对话记录>\n{{text}}\n</对话记录>\n\n提取的 json 字符串:\n\"\"\"",
"model.custom_extract_prompt_tip": "覆蓋系統的提示詞,默認為:\n\"\"\"\n{{prompt}}\n\"\"\"",
"model.dataset_process": "用於知識庫文件處理",
"model.defaultConfig": "額外 Body 參數",
"model.defaultConfig_tip": "每次請求時候,都會攜帶該額外 Body 參數",
@@ -48,6 +48,8 @@
"model.output_price": "模型輸出價格",
"model.output_price_tip": "語言模型輸出價格,如果配置了該項,則模型綜合價格會失效",
"model.param_name": "參數名",
"model.reasoning": "支持輸出思考",
"model.reasoning_tip": "例如 Deepseek-reasoner可以輸出思考過程。",
"model.request_auth": "自訂請求 Key",
"model.request_auth_tip": "向自訂請求地址發起請求時候攜帶請求頭Authorization: Bearer xxx 進行請求",
"model.request_url": "自訂請求地址",

View File

@@ -1,11 +1,8 @@
### 常见问题
- [**Git 地址**,点击查看项目地址](https://github.com/labring/FastGPT)
- [本地部署 FastGPT](https://doc.tryfastgpt.ai/docs/installation)
- [API 文档](https://doc.tryfastgpt.ai/docs/development/openapi?pre_pathname=%2Fdrive%2Fhome%2F)
- **反馈问卷**: 如果你遇到任何使用问题或有期望的功能,可以[填写该问卷](https://www.wjx.cn/vm/rLIw1uD.aspx#)
- **问题文档**: [先看文档,再提问](https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh)
- [点击查看商业版文档](https://doc.tryfastgpt.ai/docs/commercial)
- [点击查看官方文档](https://doc.tryfastgpt.ai/docs/)
- [点击查看商业版文档](https://doc.tryfastgpt.ai/docs/shopping_cart/intro/)
- [计费规则](https://doc.tryfastgpt.ai/docs/pricing/)
**其他问题**

View File

@@ -73,6 +73,8 @@ const Layout = ({ children }: { children: JSX.Element }) => {
const showUpdateNotification =
isUpdateNotification &&
feConfigs?.bind_notification_method &&
feConfigs?.bind_notification_method.length > 0 &&
!userInfo?.team.notificationAccount &&
!!userInfo?.team.permission.isOwner;

View File

@@ -58,6 +58,7 @@ import CopyBox from '@fastgpt/web/components/common/String/CopyBox';
import MyIcon from '@fastgpt/web/components/common/Icon';
import AIModelSelector from '@/components/Select/AIModelSelector';
import { useRefresh } from '../../../../../../packages/web/hooks/useRefresh';
import { Prompt_CQJson, Prompt_ExtractJson } from '@fastgpt/global/core/ai/prompt/agent';
const MyModal = dynamic(() => import('@fastgpt/web/components/common/MyModal'));
@@ -921,6 +922,19 @@ const ModelEditModal = ({
</Flex>
</Td>
</Tr>
<Tr>
<Td>
<HStack spacing={1}>
<Box>{t('account:model.reasoning')}</Box>
<QuestionTip label={t('account:model.reasoning_tip')} />
</HStack>
</Td>
<Td textAlign={'right'}>
<Flex justifyContent={'flex-end'}>
<Switch {...register('reasoning')} />
</Flex>
</Td>
</Tr>
{feConfigs?.isPlus && (
<Tr>
<Td>
@@ -983,7 +997,9 @@ const ModelEditModal = ({
<Td>
<HStack spacing={1}>
<Box>{t('account:model.custom_cq_prompt')}</Box>
<QuestionTip label={t('account:model.custom_cq_prompt_tip')} />
<QuestionTip
label={t('account:model.custom_cq_prompt_tip', { prompt: Prompt_CQJson })}
/>
</HStack>
</Td>
<Td textAlign={'right'}>
@@ -994,7 +1010,11 @@ const ModelEditModal = ({
<Td>
<HStack spacing={1}>
<Box>{t('account:model.custom_extract_prompt')}</Box>
<QuestionTip label={t('account:model.custom_extract_prompt_tip')} />
<QuestionTip
label={t('account:model.custom_extract_prompt_tip', {
prompt: Prompt_ExtractJson
})}
/>
</HStack>
</Td>
<Td textAlign={'right'}>

View File

@@ -66,9 +66,11 @@ const testLLMModel = async (model: LLMModelItemType) => {
},
{
...(model.requestUrl ? { path: model.requestUrl } : {}),
headers: {
...(model.requestAuth ? { Authorization: `Bearer ${model.requestAuth}` } : {})
}
headers: model.requestAuth
? {
Authorization: `Bearer ${model.requestAuth}`
}
: undefined
}
);
@@ -98,12 +100,14 @@ const testTTSModel = async (model: TTSModelType) => {
response_format: 'mp3',
speed: 1
},
model.requestUrl && model.requestAuth
model.requestUrl
? {
path: model.requestUrl,
headers: {
Authorization: `Bearer ${model.requestAuth}`
}
headers: model.requestAuth
? {
Authorization: `Bearer ${model.requestAuth}`
}
: undefined
}
: {}
);

View File

@@ -9,7 +9,6 @@ export const getChatModelNameListByModules = (nodes: StoreNodeItemType[]): strin
return model ? getLLMModel(model)?.name : '';
})
.filter(Boolean);
console.log(JSON.stringify(nodes, null, 2), '---=');
console.log(modelList, '---=');
return Array.from(new Set(modelList));
};