mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
perf: update test model ux (#4375)
* perf: update test model ux * feat: oceanbase vector db doc
This commit is contained in:
@@ -8,6 +8,11 @@ weight: 798
|
|||||||
---
|
---
|
||||||
## 更新指南
|
## 更新指南
|
||||||
|
|
||||||
|
### 配置参数变更
|
||||||
|
|
||||||
|
修改`config.json`文件中`systemEnv.pgHNSWEfSearch`参数名,改成`hnswEfSearch`。
|
||||||
|
商业版用户直接在后台`系统配置-基础配置`中进行变更。
|
||||||
|
|
||||||
### SSO 迁移
|
### SSO 迁移
|
||||||
|
|
||||||
使用了 SSO 或成员同步的商业版用户,并且是对接`钉钉`、`企微`的,需要迁移已有的 SSO 相关配置:
|
使用了 SSO 或成员同步的商业版用户,并且是对接`钉钉`、`企微`的,需要迁移已有的 SSO 相关配置:
|
||||||
@@ -29,6 +34,7 @@ weight: 798
|
|||||||
3. 外部变量改名:自定义变量。 并且支持在测试时调试,在分享链接中,该变量直接隐藏。
|
3. 外部变量改名:自定义变量。 并且支持在测试时调试,在分享链接中,该变量直接隐藏。
|
||||||
4. 集合同步时,支持同步修改标题。
|
4. 集合同步时,支持同步修改标题。
|
||||||
5. 团队成员管理重构,抽离主流 IM SSO(企微、飞书、钉钉),并支持通过自定义 SSO 接入 FastGPT。同时完善与外部系统的成员同步。
|
5. 团队成员管理重构,抽离主流 IM SSO(企微、飞书、钉钉),并支持通过自定义 SSO 接入 FastGPT。同时完善与外部系统的成员同步。
|
||||||
|
6. 支持 `oceanbase` 向量数据库。填写环境变量`OCEANBASE_URL`即可。
|
||||||
|
|
||||||
## ⚙️ 优化
|
## ⚙️ 优化
|
||||||
|
|
||||||
@@ -41,7 +47,8 @@ weight: 798
|
|||||||
7. 工作流节点数组类型,自动进行 JSON parse 解析 string 输入。
|
7. 工作流节点数组类型,自动进行 JSON parse 解析 string 输入。
|
||||||
8. AI proxy 日志优化,去除重试失败的日志,仅保留最后一份错误日志。
|
8. AI proxy 日志优化,去除重试失败的日志,仅保留最后一份错误日志。
|
||||||
9. 个人信息和通知展示优化。
|
9. 个人信息和通知展示优化。
|
||||||
10. 分块算法小调整:
|
10. 模型测试 loading 动画优化。
|
||||||
|
11. 分块算法小调整:
|
||||||
* 跨处理符号之间连续性更强。
|
* 跨处理符号之间连续性更强。
|
||||||
* 代码块分割时,用 LLM 模型上下文作为分块大小,尽可能保证代码块完整性。
|
* 代码块分割时,用 LLM 模型上下文作为分块大小,尽可能保证代码块完整性。
|
||||||
* 表格分割时,用 LLM 模型上下文作为分块大小,尽可能保证表格完整性。
|
* 表格分割时,用 LLM 模型上下文作为分块大小,尽可能保证表格完整性。
|
||||||
|
@@ -97,53 +97,49 @@ const ModelTest = ({
|
|||||||
|
|
||||||
const { runAsync: onStartTest, loading: isAnyModelLoading } = useRequest2(
|
const { runAsync: onStartTest, loading: isAnyModelLoading } = useRequest2(
|
||||||
async () => {
|
async () => {
|
||||||
try {
|
let errorNum = 0;
|
||||||
let errorNum = 0;
|
setTestModelList((prev) => prev.map((item) => ({ ...item, loading: true })));
|
||||||
const testModel = async (model: string) => {
|
|
||||||
|
const testModel = async (model: string) => {
|
||||||
|
setTestModelList((prev) =>
|
||||||
|
prev.map((item) =>
|
||||||
|
item.model === model ? { ...item, status: 'running', message: '' } : item
|
||||||
|
)
|
||||||
|
);
|
||||||
|
const start = Date.now();
|
||||||
|
try {
|
||||||
|
await getTestModel({ model, channelId });
|
||||||
|
const duration = Date.now() - start;
|
||||||
setTestModelList((prev) =>
|
setTestModelList((prev) =>
|
||||||
prev.map((item) =>
|
prev.map((item) =>
|
||||||
item.model === model
|
item.model === model
|
||||||
? { ...item, status: 'running', message: '', loading: true }
|
? { ...item, status: 'success', duration: duration / 1000, loading: false }
|
||||||
: item
|
: item
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const start = Date.now();
|
} catch (error) {
|
||||||
try {
|
setTestModelList((prev) =>
|
||||||
await getTestModel({ model, channelId });
|
prev.map((item) =>
|
||||||
const duration = Date.now() - start;
|
item.model === model
|
||||||
setTestModelList((prev) =>
|
? { ...item, status: 'error', message: getErrText(error), loading: false }
|
||||||
prev.map((item) =>
|
: item
|
||||||
item.model === model
|
)
|
||||||
? { ...item, status: 'success', duration: duration / 1000, loading: false }
|
);
|
||||||
: item
|
errorNum++;
|
||||||
)
|
|
||||||
);
|
|
||||||
} catch (error) {
|
|
||||||
setTestModelList((prev) =>
|
|
||||||
prev.map((item) =>
|
|
||||||
item.model === model
|
|
||||||
? { ...item, status: 'error', message: getErrText(error), loading: false }
|
|
||||||
: item
|
|
||||||
)
|
|
||||||
);
|
|
||||||
errorNum++;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
await batchRun(
|
|
||||||
testModelList.map((item) => item.model),
|
|
||||||
testModel,
|
|
||||||
5
|
|
||||||
);
|
|
||||||
|
|
||||||
if (errorNum > 0) {
|
|
||||||
toast({
|
|
||||||
status: 'warning',
|
|
||||||
title: t('account_model:test_failed', { num: errorNum })
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
};
|
||||||
console.error('Error during model testing:', error);
|
|
||||||
|
await batchRun(
|
||||||
|
testModelList.map((item) => item.model),
|
||||||
|
testModel,
|
||||||
|
5
|
||||||
|
);
|
||||||
|
|
||||||
|
if (errorNum > 0) {
|
||||||
|
toast({
|
||||||
|
status: 'warning',
|
||||||
|
title: t('account_model:test_failed', { num: errorNum })
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -187,6 +183,8 @@ const ModelTest = ({
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const isTesting = isAnyModelLoading || testingOneModel;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MyModal
|
<MyModal
|
||||||
iconSrc={'core/chat/sendLight'}
|
iconSrc={'core/chat/sendLight'}
|
||||||
@@ -230,12 +228,14 @@ const ModelTest = ({
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Td>
|
</Td>
|
||||||
<Td>
|
<Td>
|
||||||
<MyIconButton
|
{(!isAnyModelLoading || item.loading) && (
|
||||||
isLoading={item.loading}
|
<MyIconButton
|
||||||
icon={'core/chat/sendLight'}
|
isLoading={item.loading}
|
||||||
tip={t('account:model.test_model')}
|
icon={'core/chat/sendLight'}
|
||||||
onClick={() => onTestOneModel(item.model)}
|
tip={t('account:model.test_model')}
|
||||||
/>
|
onClick={() => onTestOneModel(item.model)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Td>
|
</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
);
|
);
|
||||||
@@ -248,11 +248,7 @@ const ModelTest = ({
|
|||||||
<Button mr={4} variant={'whiteBase'} onClick={onClose}>
|
<Button mr={4} variant={'whiteBase'} onClick={onClose}>
|
||||||
{t('common:common.Cancel')}
|
{t('common:common.Cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button isLoading={isTesting} variant={'primary'} onClick={onStartTest}>
|
||||||
isLoading={isAnyModelLoading || testingOneModel}
|
|
||||||
variant={'primary'}
|
|
||||||
onClick={onStartTest}
|
|
||||||
>
|
|
||||||
{t('account_model:start_test', { num: testModelList.length })}
|
{t('account_model:start_test', { num: testModelList.length })}
|
||||||
</Button>
|
</Button>
|
||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
|
Reference in New Issue
Block a user