Compare commits
8 Commits
v4.8.20
...
v4.8.20-fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d857a391b3 | ||
|
|
772c1cde77 | ||
|
|
b6e441c5eb | ||
|
|
ac95828660 | ||
|
|
f252918228 | ||
|
|
5c360b5ae6 | ||
|
|
09fa602dde | ||
|
|
db2c0a0bdb |
2
.github/workflows/docs-deploy-vercel.yml
vendored
2
.github/workflows/docs-deploy-vercel.yml
vendored
@@ -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
|
||||
|
||||
2
.github/workflows/docs-preview.yml
vendored
2
.github/workflows/docs-preview.yml
vendored
@@ -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
|
||||
|
||||
@@ -83,6 +83,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
||||
- [x] 统一查阅对话记录,并对数据进行标注
|
||||
|
||||
`6` 其他
|
||||
- [x] 可视化模型配置。
|
||||
- [x] 支持语音输入和输出 (可配置语音输入语音回答)
|
||||
- [x] 模糊输入提示
|
||||
- [x] 模板市场
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 用户后,在`账号-模型提供商-模型配置`中,你可以看到所有内置的模型和自定义模型,以及哪些模型启用了。
|
||||
|
||||

|
||||
|
||||
## 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 中渠道的`模型`一致。
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
|  |  |
|
||||
|
||||
### 修改模型配置
|
||||
#### 修改模型配置
|
||||
|
||||
点击模型右侧的齿轮即可进行模型配置,不同类型模型的配置有区别。
|
||||
|
||||
@@ -71,7 +75,7 @@ weight: 744
|
||||
| --- | --- |
|
||||
|  |  |
|
||||
|
||||
### 新增自定义模型
|
||||
## 新增自定义模型
|
||||
|
||||
如果系统内置的模型无法满足你的需求,你可以添加自定义模型。自定义模型中,如果`模型 ID`与系统内置的模型 ID 一致,则会被认为是修改系统模型。
|
||||
|
||||
@@ -79,7 +83,7 @@ weight: 744
|
||||
| --- | --- |
|
||||
|  |  |
|
||||
|
||||
### 通过配置文件配置
|
||||
#### 通过配置文件配置
|
||||
|
||||
如果你觉得通过页面配置模型比较麻烦,你也可以通过配置文件来配置模型。或者希望快速将一个系统的配置,复制到另一个系统,也可以通过配置文件来实现。
|
||||
|
||||
@@ -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`文件中,手动的增加模型配置,并重启。
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'V4.8.19(进行中)'
|
||||
title: 'V4.8.19(包含升级脚本)'
|
||||
description: 'FastGPT V4.8.19 更新说明'
|
||||
icon: 'upgrade'
|
||||
draft: false
|
||||
|
||||
@@ -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. 运行升级脚本
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -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
|
||||
}
|
||||
: {}
|
||||
)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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[]
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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": "自定义请求地址",
|
||||
|
||||
@@ -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": "自訂請求地址",
|
||||
|
||||
@@ -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/)
|
||||
|
||||
**其他问题**
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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'}>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
: {}
|
||||
);
|
||||
|
||||
@@ -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));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user