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
This commit is contained in:
parent
02fcb6a61e
commit
d2948d7e57
@ -32,5 +32,6 @@ curl --location --request POST 'https://{{host}}/api/admin/initv4820' \
|
|||||||
|
|
||||||
1. 新增 - 可视化模型参数配置。预设超过 100 个模型配置。同时支持所有类型模型的一键测试。(预计下个版本会完全支持在页面上配置渠道)。
|
1. 新增 - 可视化模型参数配置。预设超过 100 个模型配置。同时支持所有类型模型的一键测试。(预计下个版本会完全支持在页面上配置渠道)。
|
||||||
2. 新增 - 使用记录导出和仪表盘。
|
2. 新增 - 使用记录导出和仪表盘。
|
||||||
3. 优化 - 页面组件抽离,减少页面组件路由。
|
3. 新增 - markdown 语法扩展,支持音视频(代码块 audio 和 video)。
|
||||||
4. 优化 - 全文检索,忽略大小写。
|
4. 优化 - 页面组件抽离,减少页面组件路由。
|
||||||
|
5. 优化 - 全文检索,忽略大小写。
|
||||||
@ -1,6 +1,5 @@
|
|||||||
import { ApiRequestProps } from '../../type/next';
|
import { ApiRequestProps } from '../../type/next';
|
||||||
import requestIp from 'request-ip';
|
import requestIp from 'request-ip';
|
||||||
import { ERROR_ENUM } from '@fastgpt/global/common/error/errorCode';
|
|
||||||
import { authFrequencyLimit } from '../system/frequencyLimit/utils';
|
import { authFrequencyLimit } from '../system/frequencyLimit/utils';
|
||||||
import { addSeconds } from 'date-fns';
|
import { addSeconds } from 'date-fns';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
@ -9,7 +8,17 @@ import { jsonRes } from '../response';
|
|||||||
// unit: times/s
|
// unit: times/s
|
||||||
// how to use?
|
// how to use?
|
||||||
// export default NextAPI(useQPSLimit(10), handler); // limit 10 times per second for a ip
|
// export default NextAPI(useQPSLimit(10), handler); // limit 10 times per second for a ip
|
||||||
export function useIPFrequencyLimit(seconds: number, limit: number, force = false) {
|
export function useIPFrequencyLimit({
|
||||||
|
id,
|
||||||
|
seconds,
|
||||||
|
limit,
|
||||||
|
force = false
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
seconds: number;
|
||||||
|
limit: number;
|
||||||
|
force?: boolean;
|
||||||
|
}) {
|
||||||
return async (req: ApiRequestProps, res: NextApiResponse) => {
|
return async (req: ApiRequestProps, res: NextApiResponse) => {
|
||||||
const ip = requestIp.getClientIp(req);
|
const ip = requestIp.getClientIp(req);
|
||||||
if (!ip || (process.env.USE_IP_LIMIT !== 'true' && !force)) {
|
if (!ip || (process.env.USE_IP_LIMIT !== 'true' && !force)) {
|
||||||
@ -17,14 +26,14 @@ export function useIPFrequencyLimit(seconds: number, limit: number, force = fals
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await authFrequencyLimit({
|
await authFrequencyLimit({
|
||||||
eventId: 'ip-qps-limit' + ip,
|
eventId: `ip-qps-limit-${id}-` + ip,
|
||||||
maxAmount: limit,
|
maxAmount: limit,
|
||||||
expiredTime: addSeconds(new Date(), seconds)
|
expiredTime: addSeconds(new Date(), seconds)
|
||||||
});
|
});
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
jsonRes(res, {
|
jsonRes(res, {
|
||||||
code: 429,
|
code: 429,
|
||||||
error: ERROR_ENUM.tooManyRequest
|
error: `Too many request, request ${limit} times every ${seconds} seconds`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -33,7 +33,15 @@ export const jsonRes = <T = any>(
|
|||||||
|
|
||||||
addLog.error(`Api response error: ${url}`, ERROR_RESPONSE[errResponseKey]);
|
addLog.error(`Api response error: ${url}`, ERROR_RESPONSE[errResponseKey]);
|
||||||
|
|
||||||
return res.status(code).json(ERROR_RESPONSE[errResponseKey]);
|
res.status(code);
|
||||||
|
|
||||||
|
if (message) {
|
||||||
|
res.send(message);
|
||||||
|
} else {
|
||||||
|
res.json(ERROR_RESPONSE[errResponseKey]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// another error
|
// another error
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
"provider": "Doubao",
|
"provider": "Doubao",
|
||||||
"list": [
|
"list": [
|
||||||
{
|
{
|
||||||
"model": "Doubao-lite-128k",
|
"model": "Doubao-lite-4k",
|
||||||
"name": "Doubao-lite-128k",
|
"name": "Doubao-lite-4k",
|
||||||
"maxContext": 128000,
|
"maxContext": 4000,
|
||||||
"maxResponse": 4000,
|
"maxResponse": 4000,
|
||||||
"quoteMaxToken": 120000,
|
"quoteMaxToken": 4000,
|
||||||
"maxTemperature": 1,
|
"maxTemperature": 1,
|
||||||
"vision": false,
|
"vision": false,
|
||||||
"toolChoice": true,
|
"toolChoice": true,
|
||||||
@ -46,11 +46,11 @@
|
|||||||
"type": "llm"
|
"type": "llm"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"model": "Doubao-lite-4k",
|
"model": "Doubao-lite-128k",
|
||||||
"name": "Doubao-lite-4k",
|
"name": "Doubao-lite-128k",
|
||||||
"maxContext": 4000,
|
"maxContext": 128000,
|
||||||
"maxResponse": 4000,
|
"maxResponse": 4000,
|
||||||
"quoteMaxToken": 4000,
|
"quoteMaxToken": 120000,
|
||||||
"maxTemperature": 1,
|
"maxTemperature": 1,
|
||||||
"vision": false,
|
"vision": false,
|
||||||
"toolChoice": true,
|
"toolChoice": true,
|
||||||
@ -68,11 +68,33 @@
|
|||||||
"type": "llm"
|
"type": "llm"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"model": "Doubao-pro-128k",
|
"model": "Doubao-vision-lite-32k",
|
||||||
"name": "Doubao-pro-128k",
|
"name": "Doubao-vision-lite-32k",
|
||||||
"maxContext": 128000,
|
"maxContext": 32000,
|
||||||
"maxResponse": 4000,
|
"maxResponse": 4000,
|
||||||
"quoteMaxToken": 120000,
|
"quoteMaxToken": 32000,
|
||||||
|
"maxTemperature": 1,
|
||||||
|
"vision": true,
|
||||||
|
"toolChoice": false,
|
||||||
|
"functionCall": false,
|
||||||
|
"defaultSystemChatPrompt": "",
|
||||||
|
"datasetProcess": true,
|
||||||
|
"usedInClassify": true,
|
||||||
|
"customCQPrompt": "",
|
||||||
|
"usedInExtractFields": true,
|
||||||
|
"usedInQueryExtension": true,
|
||||||
|
"customExtractPrompt": "",
|
||||||
|
"usedInToolCall": true,
|
||||||
|
"defaultConfig": {},
|
||||||
|
"fieldMap": {},
|
||||||
|
"type": "llm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "Doubao-pro-4k",
|
||||||
|
"name": "Doubao-pro-4k",
|
||||||
|
"maxContext": 4000,
|
||||||
|
"maxResponse": 4000,
|
||||||
|
"quoteMaxToken": 4000,
|
||||||
"maxTemperature": 1,
|
"maxTemperature": 1,
|
||||||
"vision": false,
|
"vision": false,
|
||||||
"toolChoice": true,
|
"toolChoice": true,
|
||||||
@ -112,11 +134,11 @@
|
|||||||
"type": "llm"
|
"type": "llm"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"model": "Doubao-pro-4k",
|
"model": "Doubao-pro-128k",
|
||||||
"name": "Doubao-pro-4k",
|
"name": "Doubao-pro-128k",
|
||||||
"maxContext": 4000,
|
"maxContext": 128000,
|
||||||
"maxResponse": 4000,
|
"maxResponse": 4000,
|
||||||
"quoteMaxToken": 4000,
|
"quoteMaxToken": 120000,
|
||||||
"maxTemperature": 1,
|
"maxTemperature": 1,
|
||||||
"vision": false,
|
"vision": false,
|
||||||
"toolChoice": true,
|
"toolChoice": true,
|
||||||
@ -133,28 +155,6 @@
|
|||||||
"fieldMap": {},
|
"fieldMap": {},
|
||||||
"type": "llm"
|
"type": "llm"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"model": "Doubao-vision-lite-32k",
|
|
||||||
"name": "Doubao-vision-lite-32k",
|
|
||||||
"maxContext": 32000,
|
|
||||||
"maxResponse": 4000,
|
|
||||||
"quoteMaxToken": 32000,
|
|
||||||
"maxTemperature": 1,
|
|
||||||
"vision": true,
|
|
||||||
"toolChoice": false,
|
|
||||||
"functionCall": false,
|
|
||||||
"defaultSystemChatPrompt": "",
|
|
||||||
"datasetProcess": true,
|
|
||||||
"usedInClassify": true,
|
|
||||||
"customCQPrompt": "",
|
|
||||||
"usedInExtractFields": true,
|
|
||||||
"usedInQueryExtension": true,
|
|
||||||
"customExtractPrompt": "",
|
|
||||||
"usedInToolCall": true,
|
|
||||||
"defaultConfig": {},
|
|
||||||
"fieldMap": {},
|
|
||||||
"type": "llm"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"model": "Doubao-vision-pro-32k",
|
"model": "Doubao-vision-pro-32k",
|
||||||
"name": "Doubao-vision-pro-32k",
|
"name": "Doubao-vision-pro-32k",
|
||||||
@ -192,4 +192,4 @@
|
|||||||
"type": "embedding"
|
"type": "embedding"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,194 +47,194 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"model": "speech-01-turbo",
|
"model": "speech-01-turbo",
|
||||||
"name": "Minimax-speech-01-turbo",
|
"name": "speech-01-turbo",
|
||||||
"voices": [
|
"voices": [
|
||||||
{
|
{
|
||||||
"label": "minimax-male-qn-qingse",
|
"label": "male-qn-qingse",
|
||||||
"value": "male-qn-qingse"
|
"value": "male-qn-qingse"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-male-qn-jingying",
|
"label": "male-qn-jingying",
|
||||||
"value": "male-qn-jingying"
|
"value": "male-qn-jingying"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-male-qn-badao",
|
"label": "male-qn-badao",
|
||||||
"value": "male-qn-badao"
|
"value": "male-qn-badao"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-male-qn-daxuesheng",
|
"label": "male-qn-daxuesheng",
|
||||||
"value": "male-qn-daxuesheng"
|
"value": "male-qn-daxuesheng"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-female-shaonv",
|
"label": "female-shaonv",
|
||||||
"value": "female-shaonv"
|
"value": "female-shaonv"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-female-yujie",
|
"label": "female-yujie",
|
||||||
"value": "female-yujie"
|
"value": "female-yujie"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-female-chengshu",
|
"label": "female-chengshu",
|
||||||
"value": "female-chengshu"
|
"value": "female-chengshu"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-female-tianmei",
|
"label": "female-tianmei",
|
||||||
"value": "female-tianmei"
|
"value": "female-tianmei"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-presenter_male",
|
"label": "presenter_male",
|
||||||
"value": "presenter_male"
|
"value": "presenter_male"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-presenter_female",
|
"label": "presenter_female",
|
||||||
"value": "presenter_female"
|
"value": "presenter_female"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-audiobook_male_1",
|
"label": "audiobook_male_1",
|
||||||
"value": "audiobook_male_1"
|
"value": "audiobook_male_1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-audiobook_male_2",
|
"label": "audiobook_male_2",
|
||||||
"value": "audiobook_male_2"
|
"value": "audiobook_male_2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-audiobook_female_1",
|
"label": "audiobook_female_1",
|
||||||
"value": "audiobook_female_1"
|
"value": "audiobook_female_1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-audiobook_female_2",
|
"label": "audiobook_female_2",
|
||||||
"value": "audiobook_female_2"
|
"value": "audiobook_female_2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-male-qn-qingse-jingpin",
|
"label": "male-qn-qingse-jingpin",
|
||||||
"value": "male-qn-qingse-jingpin"
|
"value": "male-qn-qingse-jingpin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-male-qn-jingying-jingpin",
|
"label": "male-qn-jingying-jingpin",
|
||||||
"value": "male-qn-jingying-jingpin"
|
"value": "male-qn-jingying-jingpin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-male-qn-badao-jingpin",
|
"label": "male-qn-badao-jingpin",
|
||||||
"value": "male-qn-badao-jingpin"
|
"value": "male-qn-badao-jingpin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-male-qn-daxuesheng-jingpin",
|
"label": "male-qn-daxuesheng-jingpin",
|
||||||
"value": "male-qn-daxuesheng-jingpin"
|
"value": "male-qn-daxuesheng-jingpin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-female-shaonv-jingpin",
|
"label": "female-shaonv-jingpin",
|
||||||
"value": "female-shaonv-jingpin"
|
"value": "female-shaonv-jingpin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-female-yujie-jingpin",
|
"label": "female-yujie-jingpin",
|
||||||
"value": "female-yujie-jingpin"
|
"value": "female-yujie-jingpin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-female-chengshu-jingpin",
|
"label": "female-chengshu-jingpin",
|
||||||
"value": "female-chengshu-jingpin"
|
"value": "female-chengshu-jingpin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-female-tianmei-jingpin",
|
"label": "female-tianmei-jingpin",
|
||||||
"value": "female-tianmei-jingpin"
|
"value": "female-tianmei-jingpin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-clever_boy",
|
"label": "clever_boy",
|
||||||
"value": "clever_boy"
|
"value": "clever_boy"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-cute_boy",
|
"label": "cute_boy",
|
||||||
"value": "cute_boy"
|
"value": "cute_boy"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-lovely_girl",
|
"label": "lovely_girl",
|
||||||
"value": "lovely_girl"
|
"value": "lovely_girl"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-cartoon_pig",
|
"label": "cartoon_pig",
|
||||||
"value": "cartoon_pig"
|
"value": "cartoon_pig"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-bingjiao_didi",
|
"label": "bingjiao_didi",
|
||||||
"value": "bingjiao_didi"
|
"value": "bingjiao_didi"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-junlang_nanyou",
|
"label": "junlang_nanyou",
|
||||||
"value": "junlang_nanyou"
|
"value": "junlang_nanyou"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-chunzhen_xuedi",
|
"label": "chunzhen_xuedi",
|
||||||
"value": "chunzhen_xuedi"
|
"value": "chunzhen_xuedi"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-lengdan_xiongzhang",
|
"label": "lengdan_xiongzhang",
|
||||||
"value": "lengdan_xiongzhang"
|
"value": "lengdan_xiongzhang"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-badao_shaoye",
|
"label": "badao_shaoye",
|
||||||
"value": "badao_shaoye"
|
"value": "badao_shaoye"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-tianxin_xiaoling",
|
"label": "tianxin_xiaoling",
|
||||||
"value": "tianxin_xiaoling"
|
"value": "tianxin_xiaoling"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-qiaopi_mengmei",
|
"label": "qiaopi_mengmei",
|
||||||
"value": "qiaopi_mengmei"
|
"value": "qiaopi_mengmei"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-wumei_yujie",
|
"label": "wumei_yujie",
|
||||||
"value": "wumei_yujie"
|
"value": "wumei_yujie"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-diadia_xuemei",
|
"label": "diadia_xuemei",
|
||||||
"value": "diadia_xuemei"
|
"value": "diadia_xuemei"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-danya_xuejie",
|
"label": "danya_xuejie",
|
||||||
"value": "danya_xuejie"
|
"value": "danya_xuejie"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-Santa_Claus",
|
"label": "Santa_Claus",
|
||||||
"value": "Santa_Claus"
|
"value": "Santa_Claus"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-Grinch",
|
"label": "Grinch",
|
||||||
"value": "Grinch"
|
"value": "Grinch"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-Rudolph",
|
"label": "Rudolph",
|
||||||
"value": "Rudolph"
|
"value": "Rudolph"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-Arnold",
|
"label": "Arnold",
|
||||||
"value": "Arnold"
|
"value": "Arnold"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-Charming_Santa",
|
"label": "Charming_Santa",
|
||||||
"value": "Charming_Santa"
|
"value": "Charming_Santa"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-Charming_Lady",
|
"label": "Charming_Lady",
|
||||||
"value": "Charming_Lady"
|
"value": "Charming_Lady"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-Sweet_Girl",
|
"label": "Sweet_Girl",
|
||||||
"value": "Sweet_Girl"
|
"value": "Sweet_Girl"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-Cute_Elf",
|
"label": "Cute_Elf",
|
||||||
"value": "Cute_Elf"
|
"value": "Cute_Elf"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-Attractive_Girl",
|
"label": "Attractive_Girl",
|
||||||
"value": "Attractive_Girl"
|
"value": "Attractive_Girl"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "minimax-Serene_Woman",
|
"label": "Serene_Woman",
|
||||||
"value": "Serene_Woman"
|
"value": "Serene_Woman"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "tts"
|
"type": "tts"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"maxTemperature": 1.2,
|
"maxTemperature": 1.2,
|
||||||
"vision": true,
|
"vision": true,
|
||||||
"toolChoice": true,
|
"toolChoice": true,
|
||||||
"functionCall": false,
|
"functionCall": true,
|
||||||
"defaultSystemChatPrompt": "",
|
"defaultSystemChatPrompt": "",
|
||||||
"datasetProcess": true,
|
"datasetProcess": true,
|
||||||
"usedInClassify": true,
|
"usedInClassify": true,
|
||||||
@ -53,7 +53,7 @@
|
|||||||
"maxTemperature": 1.2,
|
"maxTemperature": 1.2,
|
||||||
"vision": false,
|
"vision": false,
|
||||||
"toolChoice": false,
|
"toolChoice": false,
|
||||||
"functionCall": false,
|
"functionCall": true,
|
||||||
"defaultSystemChatPrompt": "",
|
"defaultSystemChatPrompt": "",
|
||||||
"datasetProcess": true,
|
"datasetProcess": true,
|
||||||
"usedInClassify": true,
|
"usedInClassify": true,
|
||||||
@ -77,7 +77,7 @@
|
|||||||
"maxTemperature": 1.2,
|
"maxTemperature": 1.2,
|
||||||
"vision": false,
|
"vision": false,
|
||||||
"toolChoice": false,
|
"toolChoice": false,
|
||||||
"functionCall": false,
|
"functionCall": true,
|
||||||
"defaultSystemChatPrompt": "",
|
"defaultSystemChatPrompt": "",
|
||||||
"datasetProcess": true,
|
"datasetProcess": true,
|
||||||
"usedInClassify": true,
|
"usedInClassify": true,
|
||||||
@ -102,7 +102,7 @@
|
|||||||
"maxTemperature": 1.2,
|
"maxTemperature": 1.2,
|
||||||
"vision": false,
|
"vision": false,
|
||||||
"toolChoice": false,
|
"toolChoice": false,
|
||||||
"functionCall": false,
|
"functionCall": true,
|
||||||
"defaultSystemChatPrompt": "",
|
"defaultSystemChatPrompt": "",
|
||||||
"datasetProcess": true,
|
"datasetProcess": true,
|
||||||
"usedInClassify": true,
|
"usedInClassify": true,
|
||||||
@ -127,7 +127,7 @@
|
|||||||
"maxTemperature": 1.2,
|
"maxTemperature": 1.2,
|
||||||
"vision": false,
|
"vision": false,
|
||||||
"toolChoice": true,
|
"toolChoice": true,
|
||||||
"functionCall": false,
|
"functionCall": true,
|
||||||
"defaultSystemChatPrompt": "",
|
"defaultSystemChatPrompt": "",
|
||||||
"datasetProcess": true,
|
"datasetProcess": true,
|
||||||
"usedInClassify": true,
|
"usedInClassify": true,
|
||||||
@ -147,7 +147,7 @@
|
|||||||
"maxTemperature": 1.2,
|
"maxTemperature": 1.2,
|
||||||
"vision": true,
|
"vision": true,
|
||||||
"toolChoice": true,
|
"toolChoice": true,
|
||||||
"functionCall": false,
|
"functionCall": true,
|
||||||
"defaultSystemChatPrompt": "",
|
"defaultSystemChatPrompt": "",
|
||||||
"datasetProcess": true,
|
"datasetProcess": true,
|
||||||
"usedInClassify": true,
|
"usedInClassify": true,
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import {
|
|||||||
} from '@fastgpt/global/core/ai/model.d';
|
} from '@fastgpt/global/core/ai/model.d';
|
||||||
import { debounce } from 'lodash';
|
import { debounce } from 'lodash';
|
||||||
import { ModelProviderType } from '@fastgpt/global/core/ai/provider';
|
import { ModelProviderType } from '@fastgpt/global/core/ai/provider';
|
||||||
|
import { findModelFromAlldata } from '../model';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TODO: 分优先级读取:
|
TODO: 分优先级读取:
|
||||||
@ -95,7 +96,7 @@ export const loadSystemModels = async (init = false) => {
|
|||||||
const modelData: any = {
|
const modelData: any = {
|
||||||
...fileModel,
|
...fileModel,
|
||||||
...dbModel?.metadata,
|
...dbModel?.metadata,
|
||||||
provider: fileContent.provider,
|
provider: dbModel?.metadata?.provider || fileContent.provider,
|
||||||
type: dbModel?.metadata?.type || fileModel.type,
|
type: dbModel?.metadata?.type || fileModel.type,
|
||||||
isCustom: false
|
isCustom: false
|
||||||
};
|
};
|
||||||
@ -140,6 +141,28 @@ export const loadSystemModels = async (init = false) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getSystemModelConfig = async (model: string): Promise<SystemModelItemType> => {
|
||||||
|
const modelData = findModelFromAlldata(model);
|
||||||
|
if (!modelData) return Promise.reject('Model is not found');
|
||||||
|
if (modelData.isCustom) return Promise.reject('Custom model not data');
|
||||||
|
|
||||||
|
// Read file
|
||||||
|
const fileContent = (await import(`./provider/${modelData.provider}`))?.default as {
|
||||||
|
provider: ModelProviderType;
|
||||||
|
list: SystemModelItemType[];
|
||||||
|
};
|
||||||
|
|
||||||
|
const config = fileContent.list.find((item) => item.model === model);
|
||||||
|
|
||||||
|
if (!config) return Promise.reject('Model config is not found');
|
||||||
|
|
||||||
|
return {
|
||||||
|
...config,
|
||||||
|
provider: modelData.provider,
|
||||||
|
isCustom: false
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
export const watchSystemModelUpdate = () => {
|
export const watchSystemModelUpdate = () => {
|
||||||
const changeStream = MongoSystemModel.watch();
|
const changeStream = MongoSystemModel.watch();
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { addLog } from '../../../common/system/log';
|
|||||||
import { POST } from '../../../common/api/serverRequest';
|
import { POST } from '../../../common/api/serverRequest';
|
||||||
import { getDefaultRerankModel } from '../model';
|
import { getDefaultRerankModel } from '../model';
|
||||||
import { getAxiosConfig } from '../config';
|
import { getAxiosConfig } from '../config';
|
||||||
|
import { ReRankModelItemType } from '@fastgpt/global/core/ai/model.d';
|
||||||
|
|
||||||
type PostReRankResponse = {
|
type PostReRankResponse = {
|
||||||
id: string;
|
id: string;
|
||||||
@ -13,15 +14,15 @@ type PostReRankResponse = {
|
|||||||
type ReRankCallResult = { id: string; score?: number }[];
|
type ReRankCallResult = { id: string; score?: number }[];
|
||||||
|
|
||||||
export function reRankRecall({
|
export function reRankRecall({
|
||||||
|
model = getDefaultRerankModel(),
|
||||||
query,
|
query,
|
||||||
documents
|
documents
|
||||||
}: {
|
}: {
|
||||||
|
model?: ReRankModelItemType;
|
||||||
query: string;
|
query: string;
|
||||||
documents: { id: string; text: string }[];
|
documents: { id: string; text: string }[];
|
||||||
}): Promise<ReRankCallResult> {
|
}): Promise<ReRankCallResult> {
|
||||||
const model = getDefaultRerankModel();
|
if (!model) {
|
||||||
|
|
||||||
if (!model || !model?.requestUrl) {
|
|
||||||
return Promise.reject('no rerank model');
|
return Promise.reject('no rerank model');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ export function reRankRecall({
|
|||||||
|
|
||||||
let start = Date.now();
|
let start = Date.now();
|
||||||
return POST<PostReRankResponse>(
|
return POST<PostReRankResponse>(
|
||||||
model.requestUrl ? model.requestUrl : `${baseUrl}/v1/rerank`,
|
model.requestUrl ? model.requestUrl : `${baseUrl}/rerank`,
|
||||||
{
|
{
|
||||||
model: model.model,
|
model: model.model,
|
||||||
query,
|
query,
|
||||||
@ -57,6 +58,6 @@ export function reRankRecall({
|
|||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
addLog.error('rerank error', err);
|
addLog.error('rerank error', err);
|
||||||
|
|
||||||
return [];
|
return Promise.reject(err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,11 +26,12 @@ const MyNumberInput = (props: Props) => {
|
|||||||
{...restProps}
|
{...restProps}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (!onChange) return;
|
if (!onChange) return;
|
||||||
if (e === '') {
|
const numE = Number(e);
|
||||||
|
if (isNaN(numE)) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
onChange('');
|
onChange('');
|
||||||
} else {
|
} else {
|
||||||
onChange(Number(e));
|
onChange(numE);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -58,7 +58,6 @@ export const MultipleRowSelect = ({
|
|||||||
const selectedValue = cloneValue[index];
|
const selectedValue = cloneValue[index];
|
||||||
const selectedIndex = list.findIndex((item) => item.value === selectedValue);
|
const selectedIndex = list.findIndex((item) => item.value === selectedValue);
|
||||||
const children = list[selectedIndex]?.children || [];
|
const children = list[selectedIndex]?.children || [];
|
||||||
const hasChildren = list.some((item) => item.children && item.children?.length > 0);
|
|
||||||
|
|
||||||
// Store current scroll position before update
|
// Store current scroll position before update
|
||||||
const currentScrollTop = MenuRef.current[index]?.scrollTop;
|
const currentScrollTop = MenuRef.current[index]?.scrollTop;
|
||||||
@ -84,54 +83,58 @@ export const MultipleRowSelect = ({
|
|||||||
overflowY={'auto'}
|
overflowY={'auto'}
|
||||||
whiteSpace={'nowrap'}
|
whiteSpace={'nowrap'}
|
||||||
>
|
>
|
||||||
{list.map((item) => (
|
{list.map((item) => {
|
||||||
<Flex
|
const hasChildren = item.children && item.children.length > 0;
|
||||||
key={item.value}
|
|
||||||
ref={(ref) => {
|
|
||||||
if (item.value === selectedValue) {
|
|
||||||
SelectedItemRef.current[index] = ref;
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
py={1.5}
|
|
||||||
_notLast={{ mb: 1 }}
|
|
||||||
cursor={'pointer'}
|
|
||||||
px={1.5}
|
|
||||||
borderRadius={'sm'}
|
|
||||||
_hover={{
|
|
||||||
bg: 'primary.50'
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
const newValue = [...cloneValue];
|
|
||||||
|
|
||||||
if (item.value === selectedValue) {
|
return (
|
||||||
for (let i = index; i < newValue.length; i++) {
|
<Flex
|
||||||
newValue[i] = undefined;
|
key={item.value}
|
||||||
|
ref={(ref) => {
|
||||||
|
if (item.value === selectedValue) {
|
||||||
|
SelectedItemRef.current[index] = ref;
|
||||||
}
|
}
|
||||||
setCloneValue(newValue);
|
}}
|
||||||
onSelect(newValue);
|
py={1.5}
|
||||||
} else {
|
_notLast={{ mb: 1 }}
|
||||||
newValue[index] = item.value;
|
cursor={'pointer'}
|
||||||
setCloneValue(newValue);
|
px={1.5}
|
||||||
|
borderRadius={'sm'}
|
||||||
|
_hover={{
|
||||||
|
bg: 'primary.50'
|
||||||
|
}}
|
||||||
|
onClick={() => {
|
||||||
|
const newValue = [...cloneValue];
|
||||||
|
|
||||||
if (changeOnEverySelect || !hasChildren) {
|
if (item.value === selectedValue) {
|
||||||
|
for (let i = index; i < newValue.length; i++) {
|
||||||
|
newValue[i] = undefined;
|
||||||
|
}
|
||||||
|
setCloneValue(newValue);
|
||||||
onSelect(newValue);
|
onSelect(newValue);
|
||||||
}
|
} else {
|
||||||
|
newValue[index] = item.value;
|
||||||
|
setCloneValue(newValue);
|
||||||
|
|
||||||
if (!hasChildren) {
|
if (changeOnEverySelect || !hasChildren) {
|
||||||
onClose();
|
onSelect(newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasChildren) {
|
||||||
|
onClose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}}
|
||||||
}}
|
{...(item.value === selectedValue
|
||||||
{...(item.value === selectedValue
|
? {
|
||||||
? {
|
bg: 'primary.50',
|
||||||
bg: 'primary.50',
|
color: 'primary.600'
|
||||||
color: 'primary.600'
|
}
|
||||||
}
|
: {})}
|
||||||
: {})}
|
>
|
||||||
>
|
{item.label}
|
||||||
{item.label}
|
</Flex>
|
||||||
</Flex>
|
);
|
||||||
))}
|
})}
|
||||||
{list.length === 0 && (
|
{list.length === 0 && (
|
||||||
<EmptyTip
|
<EmptyTip
|
||||||
text={emptyTip ?? t('common:common.MultipleRowSelect.No data')}
|
text={emptyTip ?? t('common:common.MultipleRowSelect.No data')}
|
||||||
|
|||||||
@ -70,6 +70,7 @@
|
|||||||
"personal_information": "Personal",
|
"personal_information": "Personal",
|
||||||
"personalization": "Personalization",
|
"personalization": "Personalization",
|
||||||
"promotion_records": "Promotions",
|
"promotion_records": "Promotions",
|
||||||
|
"reset_default": "Restore the default configuration",
|
||||||
"team": "Team",
|
"team": "Team",
|
||||||
"third_party": "Third Party",
|
"third_party": "Third Party",
|
||||||
"usage_records": "Usage"
|
"usage_records": "Usage"
|
||||||
|
|||||||
@ -146,6 +146,9 @@
|
|||||||
"transition_to_workflow": "Convert to Workflow",
|
"transition_to_workflow": "Convert to Workflow",
|
||||||
"transition_to_workflow_create_new_placeholder": "Create a new app instead of modifying the current app",
|
"transition_to_workflow_create_new_placeholder": "Create a new app instead of modifying the current app",
|
||||||
"transition_to_workflow_create_new_tip": "Once converted to a workflow, it cannot be reverted to simple mode. Please confirm!",
|
"transition_to_workflow_create_new_tip": "Once converted to a workflow, it cannot be reverted to simple mode. Please confirm!",
|
||||||
|
"tts_ai_model": "Use a speech synthesis model",
|
||||||
|
"tts_browser": "Browser's own (free)",
|
||||||
|
"tts_close": "Close",
|
||||||
"type.All": "All",
|
"type.All": "All",
|
||||||
"type.Create http plugin tip": "Batch create plugins through OpenAPI Schema, compatible with GPTs format.",
|
"type.Create http plugin tip": "Batch create plugins through OpenAPI Schema, compatible with GPTs format.",
|
||||||
"type.Create one plugin tip": "Customizable input and output workflows, usually used to encapsulate reusable workflows.",
|
"type.Create one plugin tip": "Customizable input and output workflows, usually used to encapsulate reusable workflows.",
|
||||||
|
|||||||
@ -375,12 +375,10 @@
|
|||||||
"core.app.tool_label.github": "GitHub Address",
|
"core.app.tool_label.github": "GitHub Address",
|
||||||
"core.app.tool_label.price": "Pricing",
|
"core.app.tool_label.price": "Pricing",
|
||||||
"core.app.tool_label.view_doc": "View Documentation",
|
"core.app.tool_label.view_doc": "View Documentation",
|
||||||
"core.app.tts.Close": "Do Not Use",
|
|
||||||
"core.app.tts.Speech model": "Speech Model",
|
"core.app.tts.Speech model": "Speech Model",
|
||||||
"core.app.tts.Speech speed": "Speech Speed",
|
"core.app.tts.Speech speed": "Speech Speed",
|
||||||
"core.app.tts.Test Listen": "Test Listen",
|
"core.app.tts.Test Listen": "Test Listen",
|
||||||
"core.app.tts.Test Listen Text": "Hello, this is a voice test. If you can hear this sentence, the voice playback function is normal.",
|
"core.app.tts.Test Listen Text": "Hello, this is a voice test. If you can hear this sentence, the voice playback function is normal.",
|
||||||
"core.app.tts.Web": "Browser Built-in (Free)",
|
|
||||||
"core.app.whisper.Auto send": "Auto Send",
|
"core.app.whisper.Auto send": "Auto Send",
|
||||||
"core.app.whisper.Auto send tip": "Automatically send after voice input is completed, no need to click the send button manually",
|
"core.app.whisper.Auto send tip": "Automatically send after voice input is completed, no need to click the send button manually",
|
||||||
"core.app.whisper.Auto tts response": "Auto Voice Response",
|
"core.app.whisper.Auto tts response": "Auto Voice Response",
|
||||||
@ -922,10 +920,10 @@
|
|||||||
"model.name": "Model name",
|
"model.name": "Model name",
|
||||||
"model.provider": "Provider",
|
"model.provider": "Provider",
|
||||||
"model.search_name_placeholder": "Search by model name",
|
"model.search_name_placeholder": "Search by model name",
|
||||||
"model.type.chat": "language model",
|
"model.type.chat": "LLM",
|
||||||
"model.type.embedding": "Embedding",
|
"model.type.embedding": "Embedding",
|
||||||
"model.type.reRank": "ReRank",
|
"model.type.reRank": "ReRank",
|
||||||
"model.type.stt": "speech recognition",
|
"model.type.stt": "STT",
|
||||||
"model.type.tts": "TTS",
|
"model.type.tts": "TTS",
|
||||||
"model_alicloud": "Ali Cloud",
|
"model_alicloud": "Ali Cloud",
|
||||||
"model_baai": "BAAI",
|
"model_baai": "BAAI",
|
||||||
|
|||||||
@ -71,6 +71,7 @@
|
|||||||
"personal_information": "个人信息",
|
"personal_information": "个人信息",
|
||||||
"personalization": "个性化",
|
"personalization": "个性化",
|
||||||
"promotion_records": "促销记录",
|
"promotion_records": "促销记录",
|
||||||
|
"reset_default": "恢复默认配置",
|
||||||
"team": "团队管理",
|
"team": "团队管理",
|
||||||
"third_party": "第三方账号",
|
"third_party": "第三方账号",
|
||||||
"usage_records": "使用记录"
|
"usage_records": "使用记录"
|
||||||
|
|||||||
@ -146,6 +146,9 @@
|
|||||||
"transition_to_workflow": "转成工作流",
|
"transition_to_workflow": "转成工作流",
|
||||||
"transition_to_workflow_create_new_placeholder": "创建一个新的应用,而不是修改当前应用",
|
"transition_to_workflow_create_new_placeholder": "创建一个新的应用,而不是修改当前应用",
|
||||||
"transition_to_workflow_create_new_tip": "转化成工作流后,将无法转化回简易模式,请确认!",
|
"transition_to_workflow_create_new_tip": "转化成工作流后,将无法转化回简易模式,请确认!",
|
||||||
|
"tts_ai_model": "使用语音合成模型",
|
||||||
|
"tts_browser": "浏览器自带(免费)",
|
||||||
|
"tts_close": "关闭",
|
||||||
"type.All": "全部",
|
"type.All": "全部",
|
||||||
"type.Create http plugin tip": "通过 OpenAPI Schema 批量创建插件,兼容 GPTs 格式",
|
"type.Create http plugin tip": "通过 OpenAPI Schema 批量创建插件,兼容 GPTs 格式",
|
||||||
"type.Create one plugin tip": "可以自定义输入和输出的工作流,通常用于封装重复使用的工作流",
|
"type.Create one plugin tip": "可以自定义输入和输出的工作流,通常用于封装重复使用的工作流",
|
||||||
|
|||||||
@ -378,12 +378,10 @@
|
|||||||
"core.app.tool_label.github": "GitHub地址",
|
"core.app.tool_label.github": "GitHub地址",
|
||||||
"core.app.tool_label.price": "计费说明",
|
"core.app.tool_label.price": "计费说明",
|
||||||
"core.app.tool_label.view_doc": "查看说明文档",
|
"core.app.tool_label.view_doc": "查看说明文档",
|
||||||
"core.app.tts.Close": "不使用",
|
|
||||||
"core.app.tts.Speech model": "语音模型",
|
"core.app.tts.Speech model": "语音模型",
|
||||||
"core.app.tts.Speech speed": "语速",
|
"core.app.tts.Speech speed": "语速",
|
||||||
"core.app.tts.Test Listen": "试听",
|
"core.app.tts.Test Listen": "试听",
|
||||||
"core.app.tts.Test Listen Text": "你好,这是语音测试,如果你能听到这句话,说明语音播放功能正常",
|
"core.app.tts.Test Listen Text": "你好,这是语音测试,如果你能听到这句话,说明语音播放功能正常",
|
||||||
"core.app.tts.Web": "浏览器自带(免费)",
|
|
||||||
"core.app.whisper.Auto send": "自动发送",
|
"core.app.whisper.Auto send": "自动发送",
|
||||||
"core.app.whisper.Auto send tip": "语音输入完毕后直接发送,不需要再手动点击发送按键",
|
"core.app.whisper.Auto send tip": "语音输入完毕后直接发送,不需要再手动点击发送按键",
|
||||||
"core.app.whisper.Auto tts response": "自动语音回复",
|
"core.app.whisper.Auto tts response": "自动语音回复",
|
||||||
|
|||||||
@ -69,6 +69,7 @@
|
|||||||
"personal_information": "個人資訊",
|
"personal_information": "個人資訊",
|
||||||
"personalization": "個人化",
|
"personalization": "個人化",
|
||||||
"promotion_records": "促銷記錄",
|
"promotion_records": "促銷記錄",
|
||||||
|
"reset_default": "恢復默認配置",
|
||||||
"team": "團隊管理",
|
"team": "團隊管理",
|
||||||
"third_party": "第三方账号",
|
"third_party": "第三方账号",
|
||||||
"usage_records": "使用記錄"
|
"usage_records": "使用記錄"
|
||||||
|
|||||||
@ -146,6 +146,9 @@
|
|||||||
"transition_to_workflow": "轉換成工作流程",
|
"transition_to_workflow": "轉換成工作流程",
|
||||||
"transition_to_workflow_create_new_placeholder": "建立新的應用程式,而不是修改目前應用程式",
|
"transition_to_workflow_create_new_placeholder": "建立新的應用程式,而不是修改目前應用程式",
|
||||||
"transition_to_workflow_create_new_tip": "轉換成工作流程後,將無法轉換回簡易模式,請確認!",
|
"transition_to_workflow_create_new_tip": "轉換成工作流程後,將無法轉換回簡易模式,請確認!",
|
||||||
|
"tts_ai_model": "使用語音合成模型",
|
||||||
|
"tts_browser": "瀏覽器自帶(免費)",
|
||||||
|
"tts_close": "關閉",
|
||||||
"type.All": "全部",
|
"type.All": "全部",
|
||||||
"type.Create http plugin tip": "透過 OpenAPI Schema 批次建立外掛,相容 GPTs 格式",
|
"type.Create http plugin tip": "透過 OpenAPI Schema 批次建立外掛,相容 GPTs 格式",
|
||||||
"type.Create one plugin tip": "可以自訂輸入和輸出的工作流程,通常用於封裝重複使用的工作流程",
|
"type.Create one plugin tip": "可以自訂輸入和輸出的工作流程,通常用於封裝重複使用的工作流程",
|
||||||
|
|||||||
@ -374,12 +374,10 @@
|
|||||||
"core.app.tool_label.github": "GitHub 網址",
|
"core.app.tool_label.github": "GitHub 網址",
|
||||||
"core.app.tool_label.price": "收費說明",
|
"core.app.tool_label.price": "收費說明",
|
||||||
"core.app.tool_label.view_doc": "檢視說明文件",
|
"core.app.tool_label.view_doc": "檢視說明文件",
|
||||||
"core.app.tts.Close": "不使用",
|
|
||||||
"core.app.tts.Speech model": "語音模型",
|
"core.app.tts.Speech model": "語音模型",
|
||||||
"core.app.tts.Speech speed": "語速",
|
"core.app.tts.Speech speed": "語速",
|
||||||
"core.app.tts.Test Listen": "測試聆聽",
|
"core.app.tts.Test Listen": "測試聆聽",
|
||||||
"core.app.tts.Test Listen Text": "您好,這是語音測試。如果您能聽到這句話,表示語音播放功能正常",
|
"core.app.tts.Test Listen Text": "您好,這是語音測試。如果您能聽到這句話,表示語音播放功能正常",
|
||||||
"core.app.tts.Web": "瀏覽器內建(免費)",
|
|
||||||
"core.app.whisper.Auto send": "自動傳送",
|
"core.app.whisper.Auto send": "自動傳送",
|
||||||
"core.app.whisper.Auto send tip": "語音輸入完成後自動傳送,無需手動點選傳送按鈕",
|
"core.app.whisper.Auto send tip": "語音輸入完成後自動傳送,無需手動點選傳送按鈕",
|
||||||
"core.app.whisper.Auto tts response": "自動語音回應",
|
"core.app.whisper.Auto tts response": "自動語音回應",
|
||||||
|
|||||||
162
pnpm-lock.yaml
generated
162
pnpm-lock.yaml
generated
@ -22,7 +22,7 @@ importers:
|
|||||||
version: 13.3.0
|
version: 13.3.0
|
||||||
next-i18next:
|
next-i18next:
|
||||||
specifier: 15.3.0
|
specifier: 15.3.0
|
||||||
version: 15.3.0(i18next@23.11.5)(next@14.2.5(@babel/core@7.24.9)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)
|
version: 15.3.0(i18next@23.11.5)(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)
|
||||||
prettier:
|
prettier:
|
||||||
specifier: 3.2.4
|
specifier: 3.2.4
|
||||||
version: 3.2.4
|
version: 3.2.4
|
||||||
@ -67,7 +67,7 @@ importers:
|
|||||||
version: 4.0.2
|
version: 4.0.2
|
||||||
next:
|
next:
|
||||||
specifier: 14.2.5
|
specifier: 14.2.5
|
||||||
version: 14.2.5(@babel/core@7.24.9)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)
|
version: 14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)
|
||||||
openai:
|
openai:
|
||||||
specifier: 4.61.0
|
specifier: 4.61.0
|
||||||
version: 4.61.0(encoding@0.1.13)
|
version: 4.61.0(encoding@0.1.13)
|
||||||
@ -210,7 +210,7 @@ importers:
|
|||||||
version: 1.4.5-lts.1
|
version: 1.4.5-lts.1
|
||||||
next:
|
next:
|
||||||
specifier: 14.2.5
|
specifier: 14.2.5
|
||||||
version: 14.2.5(@babel/core@7.24.9)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)
|
version: 14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)
|
||||||
nextjs-cors:
|
nextjs-cors:
|
||||||
specifier: ^2.2.0
|
specifier: ^2.2.0
|
||||||
version: 2.2.0(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))
|
version: 2.2.0(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))
|
||||||
@ -295,7 +295,7 @@ importers:
|
|||||||
version: 2.1.1(@chakra-ui/system@2.6.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(react@18.3.1))(react@18.3.1)
|
version: 2.1.1(@chakra-ui/system@2.6.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(react@18.3.1))(react@18.3.1)
|
||||||
'@chakra-ui/next-js':
|
'@chakra-ui/next-js':
|
||||||
specifier: 2.1.5
|
specifier: 2.1.5
|
||||||
version: 2.1.5(@chakra-ui/react@2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(next@14.2.5(@babel/core@7.24.9)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1)
|
version: 2.1.5(@chakra-ui/react@2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1)
|
||||||
'@chakra-ui/react':
|
'@chakra-ui/react':
|
||||||
specifier: 2.8.1
|
specifier: 2.8.1
|
||||||
version: 2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
version: 2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||||
@ -358,7 +358,7 @@ importers:
|
|||||||
version: 4.17.21
|
version: 4.17.21
|
||||||
next-i18next:
|
next-i18next:
|
||||||
specifier: 15.3.0
|
specifier: 15.3.0
|
||||||
version: 15.3.0(i18next@23.11.5)(next@14.2.5(@babel/core@7.24.9)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)
|
version: 15.3.0(i18next@23.11.5)(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)
|
||||||
papaparse:
|
papaparse:
|
||||||
specifier: ^5.4.1
|
specifier: ^5.4.1
|
||||||
version: 5.4.1
|
version: 5.4.1
|
||||||
@ -531,6 +531,9 @@ importers:
|
|||||||
nprogress:
|
nprogress:
|
||||||
specifier: ^0.2.0
|
specifier: ^0.2.0
|
||||||
version: 0.2.0
|
version: 0.2.0
|
||||||
|
qrcode:
|
||||||
|
specifier: ^1.5.4
|
||||||
|
version: 1.5.4
|
||||||
react:
|
react:
|
||||||
specifier: 18.3.1
|
specifier: 18.3.1
|
||||||
version: 18.3.1
|
version: 18.3.1
|
||||||
@ -616,6 +619,9 @@ importers:
|
|||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: ^20.14.2
|
specifier: ^20.14.2
|
||||||
version: 20.14.11
|
version: 20.14.11
|
||||||
|
'@types/qrcode':
|
||||||
|
specifier: ^1.5.5
|
||||||
|
version: 1.5.5
|
||||||
'@types/react':
|
'@types/react':
|
||||||
specifier: 18.3.1
|
specifier: 18.3.1
|
||||||
version: 18.3.1
|
version: 18.3.1
|
||||||
@ -3490,6 +3496,9 @@ packages:
|
|||||||
'@types/prop-types@15.7.12':
|
'@types/prop-types@15.7.12':
|
||||||
resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==}
|
resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==}
|
||||||
|
|
||||||
|
'@types/qrcode@1.5.5':
|
||||||
|
resolution: {integrity: sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg==}
|
||||||
|
|
||||||
'@types/qs@6.9.15':
|
'@types/qs@6.9.15':
|
||||||
resolution: {integrity: sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==}
|
resolution: {integrity: sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==}
|
||||||
|
|
||||||
@ -4325,6 +4334,9 @@ packages:
|
|||||||
client-only@0.0.1:
|
client-only@0.0.1:
|
||||||
resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==}
|
resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==}
|
||||||
|
|
||||||
|
cliui@6.0.0:
|
||||||
|
resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==}
|
||||||
|
|
||||||
cliui@8.0.1:
|
cliui@8.0.1:
|
||||||
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
|
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@ -4767,6 +4779,10 @@ packages:
|
|||||||
supports-color:
|
supports-color:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
decamelize@1.2.0:
|
||||||
|
resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==}
|
||||||
|
engines: {node: '>=0.10.0'}
|
||||||
|
|
||||||
decimal.js-light@2.5.1:
|
decimal.js-light@2.5.1:
|
||||||
resolution: {integrity: sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==}
|
resolution: {integrity: sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==}
|
||||||
|
|
||||||
@ -4897,6 +4913,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==}
|
resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==}
|
||||||
engines: {node: '>=0.3.1'}
|
engines: {node: '>=0.3.1'}
|
||||||
|
|
||||||
|
dijkstrajs@1.0.3:
|
||||||
|
resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==}
|
||||||
|
|
||||||
dingbat-to-unicode@1.0.1:
|
dingbat-to-unicode@1.0.1:
|
||||||
resolution: {integrity: sha512-98l0sW87ZT58pU4i61wa2OHwxbiYSbuxsCBozaVnYX2iCnr3bLM3fIes1/ej7h1YdOKuKt/MLs706TVnALA65w==}
|
resolution: {integrity: sha512-98l0sW87ZT58pU4i61wa2OHwxbiYSbuxsCBozaVnYX2iCnr3bLM3fIes1/ej7h1YdOKuKt/MLs706TVnALA65w==}
|
||||||
|
|
||||||
@ -7571,6 +7590,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==}
|
resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==}
|
||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
|
|
||||||
|
pngjs@5.0.0:
|
||||||
|
resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==}
|
||||||
|
engines: {node: '>=10.13.0'}
|
||||||
|
|
||||||
possible-typed-array-names@1.0.0:
|
possible-typed-array-names@1.0.0:
|
||||||
resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==}
|
resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@ -7701,6 +7724,11 @@ packages:
|
|||||||
pure-rand@6.1.0:
|
pure-rand@6.1.0:
|
||||||
resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==}
|
resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==}
|
||||||
|
|
||||||
|
qrcode@1.5.4:
|
||||||
|
resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==}
|
||||||
|
engines: {node: '>=10.13.0'}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
qs@6.11.0:
|
qs@6.11.0:
|
||||||
resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==}
|
resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==}
|
||||||
engines: {node: '>=0.6'}
|
engines: {node: '>=0.6'}
|
||||||
@ -8003,6 +8031,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
|
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
|
|
||||||
|
require-main-filename@2.0.0:
|
||||||
|
resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==}
|
||||||
|
|
||||||
resize-observer-polyfill@1.5.1:
|
resize-observer-polyfill@1.5.1:
|
||||||
resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==}
|
resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==}
|
||||||
|
|
||||||
@ -9160,6 +9191,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==}
|
resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
|
which-module@2.0.1:
|
||||||
|
resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==}
|
||||||
|
|
||||||
which-typed-array@1.1.15:
|
which-typed-array@1.1.15:
|
||||||
resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==}
|
resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@ -9231,6 +9265,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
|
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
|
||||||
engines: {node: '>=0.4'}
|
engines: {node: '>=0.4'}
|
||||||
|
|
||||||
|
y18n@4.0.3:
|
||||||
|
resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==}
|
||||||
|
|
||||||
y18n@5.0.8:
|
y18n@5.0.8:
|
||||||
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
|
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
@ -9249,10 +9286,18 @@ packages:
|
|||||||
resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==}
|
resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==}
|
||||||
engines: {node: '>= 14'}
|
engines: {node: '>= 14'}
|
||||||
|
|
||||||
|
yargs-parser@18.1.3:
|
||||||
|
resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==}
|
||||||
|
engines: {node: '>=6'}
|
||||||
|
|
||||||
yargs-parser@21.1.1:
|
yargs-parser@21.1.1:
|
||||||
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
|
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
|
|
||||||
|
yargs@15.4.1:
|
||||||
|
resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
yargs@17.7.2:
|
yargs@17.7.2:
|
||||||
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
|
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@ -10537,6 +10582,14 @@ snapshots:
|
|||||||
next: 14.2.5(@babel/core@7.24.9)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)
|
next: 14.2.5(@babel/core@7.24.9)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)
|
||||||
react: 18.3.1
|
react: 18.3.1
|
||||||
|
|
||||||
|
'@chakra-ui/next-js@2.1.5(@chakra-ui/react@2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react@18.3.1)':
|
||||||
|
dependencies:
|
||||||
|
'@chakra-ui/react': 2.8.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(framer-motion@9.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||||
|
'@emotion/cache': 11.11.0
|
||||||
|
'@emotion/react': 11.11.1(@types/react@18.3.1)(react@18.3.1)
|
||||||
|
next: 14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)
|
||||||
|
react: 18.3.1
|
||||||
|
|
||||||
'@chakra-ui/number-input@2.1.1(@chakra-ui/system@2.6.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(react@18.3.1))(react@18.3.1)':
|
'@chakra-ui/number-input@2.1.1(@chakra-ui/system@2.6.1(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@emotion/styled@11.11.0(@emotion/react@11.11.1(@types/react@18.3.1)(react@18.3.1))(@types/react@18.3.1)(react@18.3.1))(react@18.3.1))(react@18.3.1)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@chakra-ui/counter': 2.1.0(react@18.3.1)
|
'@chakra-ui/counter': 2.1.0(react@18.3.1)
|
||||||
@ -12623,6 +12676,10 @@ snapshots:
|
|||||||
|
|
||||||
'@types/prop-types@15.7.12': {}
|
'@types/prop-types@15.7.12': {}
|
||||||
|
|
||||||
|
'@types/qrcode@1.5.5':
|
||||||
|
dependencies:
|
||||||
|
'@types/node': 20.14.11
|
||||||
|
|
||||||
'@types/qs@6.9.15': {}
|
'@types/qs@6.9.15': {}
|
||||||
|
|
||||||
'@types/qs@6.9.16': {}
|
'@types/qs@6.9.16': {}
|
||||||
@ -13276,7 +13333,7 @@ snapshots:
|
|||||||
|
|
||||||
axios@1.7.7:
|
axios@1.7.7:
|
||||||
dependencies:
|
dependencies:
|
||||||
follow-redirects: 1.15.9(debug@4.3.7)
|
follow-redirects: 1.15.9
|
||||||
form-data: 4.0.1
|
form-data: 4.0.1
|
||||||
proxy-from-env: 1.1.0
|
proxy-from-env: 1.1.0
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
@ -13674,6 +13731,12 @@ snapshots:
|
|||||||
|
|
||||||
client-only@0.0.1: {}
|
client-only@0.0.1: {}
|
||||||
|
|
||||||
|
cliui@6.0.0:
|
||||||
|
dependencies:
|
||||||
|
string-width: 4.2.3
|
||||||
|
strip-ansi: 6.0.1
|
||||||
|
wrap-ansi: 6.2.0
|
||||||
|
|
||||||
cliui@8.0.1:
|
cliui@8.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
string-width: 4.2.3
|
string-width: 4.2.3
|
||||||
@ -14125,6 +14188,8 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
ms: 2.1.3
|
ms: 2.1.3
|
||||||
|
|
||||||
|
decamelize@1.2.0: {}
|
||||||
|
|
||||||
decimal.js-light@2.5.1: {}
|
decimal.js-light@2.5.1: {}
|
||||||
|
|
||||||
decode-named-character-reference@1.0.2:
|
decode-named-character-reference@1.0.2:
|
||||||
@ -14269,6 +14334,8 @@ snapshots:
|
|||||||
|
|
||||||
diff@5.2.0: {}
|
diff@5.2.0: {}
|
||||||
|
|
||||||
|
dijkstrajs@1.0.3: {}
|
||||||
|
|
||||||
dingbat-to-unicode@1.0.1: {}
|
dingbat-to-unicode@1.0.1: {}
|
||||||
|
|
||||||
dir-glob@3.0.1:
|
dir-glob@3.0.1:
|
||||||
@ -15070,6 +15137,8 @@ snapshots:
|
|||||||
|
|
||||||
follow-redirects@1.15.6: {}
|
follow-redirects@1.15.6: {}
|
||||||
|
|
||||||
|
follow-redirects@1.15.9: {}
|
||||||
|
|
||||||
follow-redirects@1.15.9(debug@4.3.4):
|
follow-redirects@1.15.9(debug@4.3.4):
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
debug: 4.3.4
|
debug: 4.3.4
|
||||||
@ -17417,6 +17486,18 @@ snapshots:
|
|||||||
react: 18.3.1
|
react: 18.3.1
|
||||||
react-i18next: 14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
react-i18next: 14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||||
|
|
||||||
|
next-i18next@15.3.0(i18next@23.11.5)(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8))(react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1):
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.24.8
|
||||||
|
'@types/hoist-non-react-statics': 3.3.5
|
||||||
|
core-js: 3.37.1
|
||||||
|
hoist-non-react-statics: 3.3.2
|
||||||
|
i18next: 23.11.5
|
||||||
|
i18next-fs-backend: 2.3.1
|
||||||
|
next: 14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)
|
||||||
|
react: 18.3.1
|
||||||
|
react-i18next: 14.1.2(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||||
|
|
||||||
next@14.2.5(@babel/core@7.24.9)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8):
|
next@14.2.5(@babel/core@7.24.9)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@next/env': 14.2.5
|
'@next/env': 14.2.5
|
||||||
@ -17443,10 +17524,36 @@ snapshots:
|
|||||||
- '@babel/core'
|
- '@babel/core'
|
||||||
- babel-plugin-macros
|
- babel-plugin-macros
|
||||||
|
|
||||||
|
next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8):
|
||||||
|
dependencies:
|
||||||
|
'@next/env': 14.2.5
|
||||||
|
'@swc/helpers': 0.5.5
|
||||||
|
busboy: 1.6.0
|
||||||
|
caniuse-lite: 1.0.30001669
|
||||||
|
graceful-fs: 4.2.11
|
||||||
|
postcss: 8.4.31
|
||||||
|
react: 18.3.1
|
||||||
|
react-dom: 18.3.1(react@18.3.1)
|
||||||
|
styled-jsx: 5.1.1(react@18.3.1)
|
||||||
|
optionalDependencies:
|
||||||
|
'@next/swc-darwin-arm64': 14.2.5
|
||||||
|
'@next/swc-darwin-x64': 14.2.5
|
||||||
|
'@next/swc-linux-arm64-gnu': 14.2.5
|
||||||
|
'@next/swc-linux-arm64-musl': 14.2.5
|
||||||
|
'@next/swc-linux-x64-gnu': 14.2.5
|
||||||
|
'@next/swc-linux-x64-musl': 14.2.5
|
||||||
|
'@next/swc-win32-arm64-msvc': 14.2.5
|
||||||
|
'@next/swc-win32-ia32-msvc': 14.2.5
|
||||||
|
'@next/swc-win32-x64-msvc': 14.2.5
|
||||||
|
sass: 1.77.8
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- '@babel/core'
|
||||||
|
- babel-plugin-macros
|
||||||
|
|
||||||
nextjs-cors@2.2.0(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)):
|
nextjs-cors@2.2.0(next@14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)):
|
||||||
dependencies:
|
dependencies:
|
||||||
cors: 2.8.5
|
cors: 2.8.5
|
||||||
next: 14.2.5(@babel/core@7.24.9)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)
|
next: 14.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.8)
|
||||||
|
|
||||||
nextjs-node-loader@1.1.5(webpack@5.92.1):
|
nextjs-node-loader@1.1.5(webpack@5.92.1):
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -17870,6 +17977,8 @@ snapshots:
|
|||||||
|
|
||||||
pluralize@8.0.0: {}
|
pluralize@8.0.0: {}
|
||||||
|
|
||||||
|
pngjs@5.0.0: {}
|
||||||
|
|
||||||
possible-typed-array-names@1.0.0: {}
|
possible-typed-array-names@1.0.0: {}
|
||||||
|
|
||||||
postcss@8.4.31:
|
postcss@8.4.31:
|
||||||
@ -17998,6 +18107,12 @@ snapshots:
|
|||||||
|
|
||||||
pure-rand@6.1.0: {}
|
pure-rand@6.1.0: {}
|
||||||
|
|
||||||
|
qrcode@1.5.4:
|
||||||
|
dependencies:
|
||||||
|
dijkstrajs: 1.0.3
|
||||||
|
pngjs: 5.0.0
|
||||||
|
yargs: 15.4.1
|
||||||
|
|
||||||
qs@6.11.0:
|
qs@6.11.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
side-channel: 1.0.6
|
side-channel: 1.0.6
|
||||||
@ -18417,6 +18532,8 @@ snapshots:
|
|||||||
|
|
||||||
require-from-string@2.0.2: {}
|
require-from-string@2.0.2: {}
|
||||||
|
|
||||||
|
require-main-filename@2.0.0: {}
|
||||||
|
|
||||||
resize-observer-polyfill@1.5.1: {}
|
resize-observer-polyfill@1.5.1: {}
|
||||||
|
|
||||||
resolve-cwd@3.0.0:
|
resolve-cwd@3.0.0:
|
||||||
@ -18597,8 +18714,7 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
set-blocking@2.0.0:
|
set-blocking@2.0.0: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
set-cookie-parser@2.6.0: {}
|
set-cookie-parser@2.6.0: {}
|
||||||
|
|
||||||
@ -18883,6 +18999,11 @@ snapshots:
|
|||||||
'@babel/core': 7.24.9
|
'@babel/core': 7.24.9
|
||||||
babel-plugin-macros: 3.1.0
|
babel-plugin-macros: 3.1.0
|
||||||
|
|
||||||
|
styled-jsx@5.1.1(react@18.3.1):
|
||||||
|
dependencies:
|
||||||
|
client-only: 0.0.1
|
||||||
|
react: 18.3.1
|
||||||
|
|
||||||
stylis@4.2.0: {}
|
stylis@4.2.0: {}
|
||||||
|
|
||||||
stylis@4.3.2: {}
|
stylis@4.3.2: {}
|
||||||
@ -19662,6 +19783,8 @@ snapshots:
|
|||||||
is-weakmap: 2.0.2
|
is-weakmap: 2.0.2
|
||||||
is-weakset: 2.0.3
|
is-weakset: 2.0.3
|
||||||
|
|
||||||
|
which-module@2.0.1: {}
|
||||||
|
|
||||||
which-typed-array@1.1.15:
|
which-typed-array@1.1.15:
|
||||||
dependencies:
|
dependencies:
|
||||||
available-typed-arrays: 1.0.7
|
available-typed-arrays: 1.0.7
|
||||||
@ -19749,6 +19872,8 @@ snapshots:
|
|||||||
|
|
||||||
xtend@4.0.2: {}
|
xtend@4.0.2: {}
|
||||||
|
|
||||||
|
y18n@4.0.3: {}
|
||||||
|
|
||||||
y18n@5.0.8: {}
|
y18n@5.0.8: {}
|
||||||
|
|
||||||
yallist@3.1.1: {}
|
yallist@3.1.1: {}
|
||||||
@ -19759,8 +19884,27 @@ snapshots:
|
|||||||
|
|
||||||
yaml@2.3.1: {}
|
yaml@2.3.1: {}
|
||||||
|
|
||||||
|
yargs-parser@18.1.3:
|
||||||
|
dependencies:
|
||||||
|
camelcase: 5.3.1
|
||||||
|
decamelize: 1.2.0
|
||||||
|
|
||||||
yargs-parser@21.1.1: {}
|
yargs-parser@21.1.1: {}
|
||||||
|
|
||||||
|
yargs@15.4.1:
|
||||||
|
dependencies:
|
||||||
|
cliui: 6.0.0
|
||||||
|
decamelize: 1.2.0
|
||||||
|
find-up: 4.1.0
|
||||||
|
get-caller-file: 2.0.5
|
||||||
|
require-directory: 2.1.1
|
||||||
|
require-main-filename: 2.0.0
|
||||||
|
set-blocking: 2.0.0
|
||||||
|
string-width: 4.2.3
|
||||||
|
which-module: 2.0.1
|
||||||
|
y18n: 4.0.3
|
||||||
|
yargs-parser: 18.1.3
|
||||||
|
|
||||||
yargs@17.7.2:
|
yargs@17.7.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
cliui: 8.0.1
|
cliui: 8.0.1
|
||||||
|
|||||||
@ -51,6 +51,7 @@
|
|||||||
"next-i18next": "15.3.0",
|
"next-i18next": "15.3.0",
|
||||||
"nextjs-node-loader": "^1.1.5",
|
"nextjs-node-loader": "^1.1.5",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
|
"qrcode": "^1.5.4",
|
||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
"react-day-picker": "^8.7.1",
|
"react-day-picker": "^8.7.1",
|
||||||
"react-dom": "18.3.1",
|
"react-dom": "18.3.1",
|
||||||
@ -81,6 +82,7 @@
|
|||||||
"@types/jsonwebtoken": "^9.0.3",
|
"@types/jsonwebtoken": "^9.0.3",
|
||||||
"@types/lodash": "^4.14.191",
|
"@types/lodash": "^4.14.191",
|
||||||
"@types/node": "^20.14.2",
|
"@types/node": "^20.14.2",
|
||||||
|
"@types/qrcode": "^1.5.5",
|
||||||
"@types/react": "18.3.1",
|
"@types/react": "18.3.1",
|
||||||
"@types/react-dom": "18.3.0",
|
"@types/react-dom": "18.3.0",
|
||||||
"@types/react-syntax-highlighter": "^15.5.6",
|
"@types/react-syntax-highlighter": "^15.5.6",
|
||||||
|
|||||||
1
projects/app/public/js/qrcode.min.js
vendored
1
projects/app/public/js/qrcode.min.js
vendored
File diff suppressed because one or more lines are too long
31
projects/app/src/components/Markdown/codeBlock/Audio.tsx
Normal file
31
projects/app/src/components/Markdown/codeBlock/Audio.tsx
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import React, { useEffect } from 'react';
|
||||||
|
import { Box } from '@chakra-ui/react';
|
||||||
|
import { useMarkdownWidth } from '../hooks';
|
||||||
|
|
||||||
|
const AudioBlock = ({ code: audioUrl }: { code: string }) => {
|
||||||
|
const { width, Ref } = useMarkdownWidth();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetch(audioUrl?.trim(), {
|
||||||
|
mode: 'cors',
|
||||||
|
credentials: 'omit'
|
||||||
|
})
|
||||||
|
.then((response) => response.blob())
|
||||||
|
.then((blob) => {
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const audio = document.getElementById('player');
|
||||||
|
audio?.setAttribute('src', url);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
}, [audioUrl]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box w={width} ref={Ref}>
|
||||||
|
<audio id="player" controls style={{ width: '100%' }} />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AudioBlock;
|
||||||
31
projects/app/src/components/Markdown/codeBlock/Video.tsx
Normal file
31
projects/app/src/components/Markdown/codeBlock/Video.tsx
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import React, { useEffect } from 'react';
|
||||||
|
import { Box } from '@chakra-ui/react';
|
||||||
|
import { useMarkdownWidth } from '../hooks';
|
||||||
|
|
||||||
|
const VideoBlock = ({ code: videoUrl }: { code: string }) => {
|
||||||
|
const { width, Ref } = useMarkdownWidth();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetch(videoUrl?.trim(), {
|
||||||
|
mode: 'cors',
|
||||||
|
credentials: 'omit'
|
||||||
|
})
|
||||||
|
.then((response) => response.blob())
|
||||||
|
.then((blob) => {
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const video = document.getElementById('player');
|
||||||
|
video?.setAttribute('src', url);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
}, [videoUrl]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box w={width} ref={Ref}>
|
||||||
|
<video id="player" controls />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default VideoBlock;
|
||||||
@ -16,7 +16,7 @@ import { useCopyData } from '@fastgpt/web/hooks/useCopyData';
|
|||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import { useMarkdownWidth } from '../hooks';
|
import { useMarkdownWidth } from '../hooks';
|
||||||
import type { IconNameType } from '@fastgpt/web/components/common/Icon/type.d';
|
import type { IconNameType } from '@fastgpt/web/components/common/Icon/type.d';
|
||||||
import { codeLight } from '../CodeLight';
|
import { codeLight } from './CodeLight';
|
||||||
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
|
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
|
||||||
|
|
||||||
const StyledButton = ({
|
const StyledButton = ({
|
||||||
|
|||||||
@ -13,12 +13,14 @@ import dynamic from 'next/dynamic';
|
|||||||
import { Box } from '@chakra-ui/react';
|
import { Box } from '@chakra-ui/react';
|
||||||
import { CodeClassNameEnum } from './utils';
|
import { CodeClassNameEnum } from './utils';
|
||||||
|
|
||||||
const CodeLight = dynamic(() => import('./CodeLight'), { ssr: false });
|
const CodeLight = dynamic(() => import('./codeBlock/CodeLight'), { ssr: false });
|
||||||
const MermaidCodeBlock = dynamic(() => import('./img/MermaidCodeBlock'), { ssr: false });
|
const MermaidCodeBlock = dynamic(() => import('./img/MermaidCodeBlock'), { ssr: false });
|
||||||
const MdImage = dynamic(() => import('./img/Image'), { ssr: false });
|
const MdImage = dynamic(() => import('./img/Image'), { ssr: false });
|
||||||
const EChartsCodeBlock = dynamic(() => import('./img/EChartsCodeBlock'), { ssr: false });
|
const EChartsCodeBlock = dynamic(() => import('./img/EChartsCodeBlock'), { ssr: false });
|
||||||
const IframeCodeBlock = dynamic(() => import('./codeBlock/Iframe'), { ssr: false });
|
const IframeCodeBlock = dynamic(() => import('./codeBlock/Iframe'), { ssr: false });
|
||||||
const IframeHtmlCodeBlock = dynamic(() => import('./codeBlock/iframe-html'), { ssr: false });
|
const IframeHtmlCodeBlock = dynamic(() => import('./codeBlock/iframe-html'), { ssr: false });
|
||||||
|
const VideoBlock = dynamic(() => import('./codeBlock/Video'), { ssr: false });
|
||||||
|
const AudioBlock = dynamic(() => import('./codeBlock/Audio'), { ssr: false });
|
||||||
|
|
||||||
const ChatGuide = dynamic(() => import('./chat/Guide'), { ssr: false });
|
const ChatGuide = dynamic(() => import('./chat/Guide'), { ssr: false });
|
||||||
const QuestionGuide = dynamic(() => import('./chat/QuestionGuide'), { ssr: false });
|
const QuestionGuide = dynamic(() => import('./chat/QuestionGuide'), { ssr: false });
|
||||||
@ -139,6 +141,12 @@ function Code(e: any) {
|
|||||||
</IframeHtmlCodeBlock>
|
</IframeHtmlCodeBlock>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (codeType === CodeClassNameEnum.video) {
|
||||||
|
return <VideoBlock code={strChildren} />;
|
||||||
|
}
|
||||||
|
if (codeType === CodeClassNameEnum.audio) {
|
||||||
|
return <AudioBlock code={strChildren} />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CodeLight className={className} codeBlock={codeBlock} match={match}>
|
<CodeLight className={className} codeBlock={codeBlock} match={match}>
|
||||||
|
|||||||
@ -7,7 +7,9 @@ export enum CodeClassNameEnum {
|
|||||||
files = 'files',
|
files = 'files',
|
||||||
latex = 'latex',
|
latex = 'latex',
|
||||||
iframe = 'iframe',
|
iframe = 'iframe',
|
||||||
html = 'html'
|
html = 'html',
|
||||||
|
video = 'video',
|
||||||
|
audio = 'audio'
|
||||||
}
|
}
|
||||||
|
|
||||||
function htmlTableToLatex(html: string) {
|
function htmlTableToLatex(html: string) {
|
||||||
|
|||||||
@ -80,7 +80,9 @@ const AIChatSettingsModal = ({
|
|||||||
const temperature = watch('temperature');
|
const temperature = watch('temperature');
|
||||||
const useVision = watch('aiChatVision');
|
const useVision = watch('aiChatVision');
|
||||||
|
|
||||||
const selectedModel = getWebLLMModel(model);
|
const selectedModel = useMemo(() => {
|
||||||
|
return getWebLLMModel(model);
|
||||||
|
}, [model]);
|
||||||
const llmSupportVision = !!selectedModel?.vision;
|
const llmSupportVision = !!selectedModel?.vision;
|
||||||
|
|
||||||
const tokenLimit = useMemo(() => {
|
const tokenLimit = useMemo(() => {
|
||||||
@ -244,7 +246,7 @@ const AIChatSettingsModal = ({
|
|||||||
</Box>
|
</Box>
|
||||||
<Box flex={'1 0 0'}>
|
<Box flex={'1 0 0'}>
|
||||||
<InputSlider
|
<InputSlider
|
||||||
min={100}
|
min={0}
|
||||||
max={tokenLimit}
|
max={tokenLimit}
|
||||||
step={200}
|
step={200}
|
||||||
isDisabled={maxToken === undefined}
|
isDisabled={maxToken === undefined}
|
||||||
|
|||||||
@ -7,8 +7,8 @@ import AISettingModal, { AIChatSettingsModalProps } from '@/components/core/ai/A
|
|||||||
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
|
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||||
import { useMount } from 'ahooks';
|
|
||||||
import AIModelSelector from '@/components/Select/AIModelSelector';
|
import AIModelSelector from '@/components/Select/AIModelSelector';
|
||||||
|
import { getWebDefaultModel } from '@/web/common/system/utils';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
llmModelType?: `${LLMModelTypeEnum}`;
|
llmModelType?: `${LLMModelTypeEnum}`;
|
||||||
@ -24,7 +24,7 @@ const SettingLLMModel = ({
|
|||||||
...props
|
...props
|
||||||
}: AIChatSettingsModalProps & Props) => {
|
}: AIChatSettingsModalProps & Props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { llmModelList, defaultModels } = useSystemStore();
|
const { llmModelList } = useSystemStore();
|
||||||
|
|
||||||
const model = defaultData.model;
|
const model = defaultData.model;
|
||||||
|
|
||||||
@ -39,16 +39,19 @@ const SettingLLMModel = ({
|
|||||||
}),
|
}),
|
||||||
[llmModelList, llmModelType]
|
[llmModelList, llmModelType]
|
||||||
);
|
);
|
||||||
|
const defaultModel = useMemo(() => {
|
||||||
|
return getWebDefaultModel(modelList).model;
|
||||||
|
}, [modelList]);
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!llmModelList.find((item) => item.model === model) && !!defaultModels.llm) {
|
if (!modelList.find((item) => item.model === model) && !!defaultModel) {
|
||||||
onChange({
|
onChange({
|
||||||
...defaultData,
|
...defaultData,
|
||||||
model: defaultModels.llm.model
|
model: defaultModel
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [model, defaultData, llmModelList, defaultModels.llm, onChange]);
|
}, [modelList, model, defaultModel, onChange]);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
isOpen: isOpenAIChatSetting,
|
isOpen: isOpenAIChatSetting,
|
||||||
|
|||||||
@ -65,7 +65,7 @@ const DatasetParamsModal = ({
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const { teamPlanStatus } = useUserStore();
|
const { teamPlanStatus } = useUserStore();
|
||||||
const { reRankModelList, llmModelList } = useSystemStore();
|
const { reRankModelList, llmModelList, defaultModels } = useSystemStore();
|
||||||
const [refresh, setRefresh] = useState(false);
|
const [refresh, setRefresh] = useState(false);
|
||||||
const [currentTabType, setCurrentTabType] = useState(SearchSettingTabEnum.searchMode);
|
const [currentTabType, setCurrentTabType] = useState(SearchSettingTabEnum.searchMode);
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ const DatasetParamsModal = ({
|
|||||||
searchMode,
|
searchMode,
|
||||||
usingReRank: !!usingReRank && teamPlanStatus?.standardConstants?.permissionReRank !== false,
|
usingReRank: !!usingReRank && teamPlanStatus?.standardConstants?.permissionReRank !== false,
|
||||||
datasetSearchUsingExtensionQuery,
|
datasetSearchUsingExtensionQuery,
|
||||||
datasetSearchExtensionModel: datasetSearchExtensionModel || chatModelSelectList[0]?.value,
|
datasetSearchExtensionModel: datasetSearchExtensionModel || defaultModels.llm?.model,
|
||||||
datasetSearchExtensionBg
|
datasetSearchExtensionBg
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||||
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
|
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
|
||||||
import { Box, Button, Flex, ModalBody, useDisclosure, Image } from '@chakra-ui/react';
|
import { Box, Button, Flex, ModalBody, useDisclosure, Image, HStack } from '@chakra-ui/react';
|
||||||
import React, { useCallback, useMemo } from 'react';
|
import React, { useCallback, useMemo } from 'react';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import { TTSTypeEnum } from '@/web/core/app/constants';
|
import { TTSTypeEnum } from '@/web/core/app/constants';
|
||||||
@ -9,13 +9,15 @@ import { useAudioPlay } from '@/web/common/utils/voice';
|
|||||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||||
import MyModal from '@fastgpt/web/components/common/MyModal';
|
import MyModal from '@fastgpt/web/components/common/MyModal';
|
||||||
import MySlider from '@/components/Slider';
|
import MySlider from '@/components/Slider';
|
||||||
import MySelect from '@fastgpt/web/components/common/MySelect';
|
|
||||||
import { defaultTTSConfig } from '@fastgpt/global/core/app/constants';
|
import { defaultTTSConfig } from '@fastgpt/global/core/app/constants';
|
||||||
import ChatFunctionTip from './Tip';
|
import ChatFunctionTip from './Tip';
|
||||||
import FormLabel from '@fastgpt/web/components/common/MyBox/FormLabel';
|
import FormLabel from '@fastgpt/web/components/common/MyBox/FormLabel';
|
||||||
import MyImage from '@fastgpt/web/components/common/Image/MyImage';
|
import MyImage from '@fastgpt/web/components/common/Image/MyImage';
|
||||||
import { useContextSelector } from 'use-context-selector';
|
import { useContextSelector } from 'use-context-selector';
|
||||||
import { AppContext } from '@/pageComponents/app/detail/context';
|
import { AppContext } from '@/pageComponents/app/detail/context';
|
||||||
|
import Avatar from '@fastgpt/web/components/common/Avatar';
|
||||||
|
import { getModelProvider } from '@fastgpt/global/core/ai/provider';
|
||||||
|
import MultipleRowSelect from '@fastgpt/web/components/common/MySelect/MultipleRowSelect';
|
||||||
|
|
||||||
const TTSSelect = ({
|
const TTSSelect = ({
|
||||||
value = defaultTTSConfig,
|
value = defaultTTSConfig,
|
||||||
@ -30,28 +32,57 @@ const TTSSelect = ({
|
|||||||
|
|
||||||
const appId = useContextSelector(AppContext, (v) => v.appId);
|
const appId = useContextSelector(AppContext, (v) => v.appId);
|
||||||
|
|
||||||
const list = useMemo(
|
const selectorList = useMemo(
|
||||||
() => [
|
() => [
|
||||||
{ label: t('common:core.app.tts.Close'), value: TTSTypeEnum.none },
|
{ label: t('app:tts_close'), value: TTSTypeEnum.none, children: [] },
|
||||||
{ label: t('common:core.app.tts.Web'), value: TTSTypeEnum.web },
|
{ label: t('app:tts_browser'), value: TTSTypeEnum.web, children: [] },
|
||||||
...ttsModelList.map((item) => item?.voices || []).flat()
|
...ttsModelList.map((model) => {
|
||||||
|
const providerData = getModelProvider(model.provider);
|
||||||
|
return {
|
||||||
|
label: (
|
||||||
|
<HStack>
|
||||||
|
<Avatar borderRadius={'0'} w={'1.25rem'} src={providerData.avatar} />
|
||||||
|
<Box>{t(providerData.name)}</Box>
|
||||||
|
</HStack>
|
||||||
|
),
|
||||||
|
value: model.model,
|
||||||
|
children: model.voices.map((voice) => ({
|
||||||
|
label: voice.label,
|
||||||
|
value: voice.value
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
})
|
||||||
],
|
],
|
||||||
[ttsModelList, t]
|
[ttsModelList, t]
|
||||||
);
|
);
|
||||||
|
|
||||||
const formatValue = useMemo(() => {
|
const formatValue = useMemo(() => {
|
||||||
if (!value || !value.type) {
|
if (!value || !value.type) {
|
||||||
return TTSTypeEnum.none;
|
return [TTSTypeEnum.none, undefined];
|
||||||
}
|
}
|
||||||
if (value.type === TTSTypeEnum.none || value.type === TTSTypeEnum.web) {
|
if (value.type === TTSTypeEnum.none || value.type === TTSTypeEnum.web) {
|
||||||
return value.type;
|
return [value.type, undefined];
|
||||||
}
|
}
|
||||||
return value.voice;
|
|
||||||
|
return [value.model, value.voice];
|
||||||
}, [value]);
|
}, [value]);
|
||||||
const formLabel = useMemo(
|
const formLabel = useMemo(() => {
|
||||||
() => list.find((item) => item.value === formatValue)?.label || t('common:common.UnKnow'),
|
const provider = selectorList.find((item) => item.value === formatValue[0]) || selectorList[0];
|
||||||
[formatValue, list, t]
|
const voice = provider.children.find((item) => item.value === formatValue[1]);
|
||||||
);
|
return (
|
||||||
|
<Box minW={'150px'} maxW={'220px'} className="textEllipsis">
|
||||||
|
{voice ? (
|
||||||
|
<Flex alignItems={'center'}>
|
||||||
|
<Box>{provider.label}</Box>
|
||||||
|
<Box>-</Box>
|
||||||
|
<Box>{voice.label}</Box>
|
||||||
|
</Flex>
|
||||||
|
) : (
|
||||||
|
provider.label
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}, [formatValue, selectorList, t]);
|
||||||
|
|
||||||
const { playAudioByText, cancelAudio, audioLoading, audioPlaying } = useAudioPlay({
|
const { playAudioByText, cancelAudio, audioLoading, audioPlaying } = useAudioPlay({
|
||||||
appId,
|
appId,
|
||||||
@ -59,21 +90,16 @@ const TTSSelect = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onclickChange = useCallback(
|
const onclickChange = useCallback(
|
||||||
(e: string) => {
|
(e: string[]) => {
|
||||||
if (e === TTSTypeEnum.none || e === TTSTypeEnum.web) {
|
console.log(e, '-=');
|
||||||
onChange({ type: e as `${TTSTypeEnum}` });
|
if (e[0] === TTSTypeEnum.none || e[0] === TTSTypeEnum.web) {
|
||||||
|
onChange({ type: e[0] });
|
||||||
} else {
|
} else {
|
||||||
const audioModel = ttsModelList.find((item) =>
|
|
||||||
item.voices?.find((voice) => voice.value === e)
|
|
||||||
);
|
|
||||||
if (!audioModel) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
onChange({
|
onChange({
|
||||||
...value,
|
...value,
|
||||||
type: TTSTypeEnum.model,
|
type: TTSTypeEnum.model,
|
||||||
model: audioModel.model,
|
model: e[0],
|
||||||
voice: e
|
voice: e[1]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -113,7 +139,13 @@ const TTSSelect = ({
|
|||||||
<ModalBody px={[5, 16]} py={[4, 8]}>
|
<ModalBody px={[5, 16]} py={[4, 8]}>
|
||||||
<Flex justifyContent={'space-between'} alignItems={'center'}>
|
<Flex justifyContent={'space-between'} alignItems={'center'}>
|
||||||
<FormLabel>{t('common:core.app.tts.Speech model')}</FormLabel>
|
<FormLabel>{t('common:core.app.tts.Speech model')}</FormLabel>
|
||||||
<MySelect w={'220px'} value={formatValue} list={list} onchange={onclickChange} />
|
<MultipleRowSelect
|
||||||
|
rowMinWidth="160px"
|
||||||
|
label={formLabel}
|
||||||
|
value={formatValue}
|
||||||
|
list={selectorList}
|
||||||
|
onSelect={onclickChange}
|
||||||
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex mt={8} justifyContent={'space-between'}>
|
<Flex mt={8} justifyContent={'space-between'}>
|
||||||
<FormLabel>{t('common:core.app.tts.Speech speed')}</FormLabel>
|
<FormLabel>{t('common:core.app.tts.Speech speed')}</FormLabel>
|
||||||
@ -135,7 +167,7 @@ const TTSSelect = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
{formatValue !== TTSTypeEnum.none && (
|
{formatValue[0] !== TTSTypeEnum.none && (
|
||||||
<Flex mt={10} justifyContent={'end'}>
|
<Flex mt={10} justifyContent={'end'}>
|
||||||
{audioPlaying ? (
|
{audioPlaying ? (
|
||||||
<Flex>
|
<Flex>
|
||||||
|
|||||||
@ -25,7 +25,7 @@ const WelcomeTextConfig = (props: TextareaProps) => {
|
|||||||
mt={1.5}
|
mt={1.5}
|
||||||
rows={6}
|
rows={6}
|
||||||
fontSize={'sm'}
|
fontSize={'sm'}
|
||||||
bg={'white'}
|
bg={'myGray.50'}
|
||||||
minW={'384px'}
|
minW={'384px'}
|
||||||
placeholder={t('common:core.app.tip.welcomeTextTip')}
|
placeholder={t('common:core.app.tip.welcomeTextTip')}
|
||||||
autoHeight
|
autoHeight
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
import MyModal from '@fastgpt/web/components/common/MyModal';
|
import MyModal from '@fastgpt/web/components/common/MyModal';
|
||||||
import React, { useCallback, useEffect, useRef } from 'react';
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import { Box, ModalBody } from '@chakra-ui/react';
|
import { Box, ModalBody } from '@chakra-ui/react';
|
||||||
import { checkBalancePayResult } from '@/web/support/wallet/bill/api';
|
import { checkBalancePayResult } from '@/web/support/wallet/bill/api';
|
||||||
import { useToast } from '@fastgpt/web/hooks/useToast';
|
import { useToast } from '@fastgpt/web/hooks/useToast';
|
||||||
import { useRouter } from 'next/router';
|
|
||||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||||
import LightTip from '@fastgpt/web/components/common/LightTip';
|
import LightTip from '@fastgpt/web/components/common/LightTip';
|
||||||
import Script from 'next/script';
|
import QRCode from 'qrcode';
|
||||||
import { getWebReqUrl } from '@fastgpt/web/common/system/utils';
|
|
||||||
|
|
||||||
export type QRPayProps = {
|
export type QRPayProps = {
|
||||||
readPrice: number;
|
readPrice: number;
|
||||||
@ -27,21 +25,35 @@ const QRCodePayModal = ({
|
|||||||
}: QRPayProps & { tip?: string; onSuccess?: () => any }) => {
|
}: QRPayProps & { tip?: string; onSuccess?: () => any }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const dom = useRef<HTMLDivElement>(null);
|
const canvasRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
const drawCode = useCallback(() => {
|
const drawCode = useCallback(() => {
|
||||||
if (dom.current && window.QRCode && !dom.current.innerHTML) {
|
const canvas = document.createElement('canvas');
|
||||||
new window.QRCode(dom.current, {
|
QRCode.toCanvas(canvas, codeUrl, {
|
||||||
text: codeUrl,
|
width: qrCodeSize,
|
||||||
width: qrCodeSize,
|
margin: 0,
|
||||||
height: qrCodeSize,
|
color: {
|
||||||
colorDark: '#000000',
|
dark: '#000000',
|
||||||
colorLight: '#ffffff',
|
light: '#ffffff'
|
||||||
correctLevel: window.QRCode.CorrectLevel.H
|
}
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
if (canvasRef.current) {
|
||||||
|
canvasRef.current.innerHTML = '';
|
||||||
|
canvasRef.current.appendChild(canvas);
|
||||||
|
} else {
|
||||||
|
drawCode();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error('QRCode generation error:', err);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}, [codeUrl]);
|
}, [codeUrl]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
drawCode();
|
||||||
|
}, [drawCode]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let timer: NodeJS.Timeout;
|
let timer: NodeJS.Timeout;
|
||||||
const check = async () => {
|
const check = async () => {
|
||||||
@ -54,7 +66,7 @@ const QRCodePayModal = ({
|
|||||||
title: res,
|
title: res,
|
||||||
status: 'success'
|
status: 'success'
|
||||||
});
|
});
|
||||||
return;
|
return clearTimeout(timer);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast({
|
toast({
|
||||||
title: getErrText(error),
|
title: getErrText(error),
|
||||||
@ -63,9 +75,7 @@ const QRCodePayModal = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
|
clearTimeout(timer);
|
||||||
drawCode();
|
|
||||||
|
|
||||||
timer = setTimeout(check, 2000);
|
timer = setTimeout(check, 2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -75,23 +85,15 @@ const QRCodePayModal = ({
|
|||||||
}, [billId, drawCode, onSuccess, toast]);
|
}, [billId, drawCode, onSuccess, toast]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<MyModal isOpen title={t('common:user.Pay')} iconSrc="/imgs/modal/pay.svg">
|
||||||
<Script
|
<ModalBody textAlign={'center'} pb={10} whiteSpace={'pre-wrap'}>
|
||||||
src={getWebReqUrl('/js/qrcode.min.js')}
|
{tip && <LightTip text={tip} mb={8} textAlign={'left'} />}
|
||||||
strategy="lazyOnload"
|
<Box ref={canvasRef} display={'inline-block'} h={`${qrCodeSize}px`}></Box>
|
||||||
onLoad={drawCode}
|
<Box mt={5} textAlign={'center'}>
|
||||||
></Script>
|
{t('common:pay.wechat', { price: readPrice })}
|
||||||
|
</Box>
|
||||||
<MyModal isOpen title={t('common:user.Pay')} iconSrc="/imgs/modal/pay.svg">
|
</ModalBody>
|
||||||
<ModalBody textAlign={'center'} pb={10} whiteSpace={'pre-wrap'}>
|
</MyModal>
|
||||||
{tip && <LightTip text={tip} mb={8} textAlign={'left'} />}
|
|
||||||
<Box ref={dom} id={'payQRCode'} display={'inline-block'} h={`${qrCodeSize}px`}></Box>
|
|
||||||
<Box mt={5} textAlign={'center'}>
|
|
||||||
{t('common:pay.wechat', { price: readPrice })}
|
|
||||||
</Box>
|
|
||||||
</ModalBody>
|
|
||||||
</MyModal>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@ import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
|
|||||||
import {
|
import {
|
||||||
deleteSystemModel,
|
deleteSystemModel,
|
||||||
getModelConfigJson,
|
getModelConfigJson,
|
||||||
|
getSystemModelDefaultConfig,
|
||||||
getSystemModelDetail,
|
getSystemModelDetail,
|
||||||
getSystemModelList,
|
getSystemModelList,
|
||||||
getTestModel,
|
getTestModel,
|
||||||
@ -56,6 +57,7 @@ import { putUpdateWithJson } from '@/web/core/ai/config';
|
|||||||
import CopyBox from '@fastgpt/web/components/common/String/CopyBox';
|
import CopyBox from '@fastgpt/web/components/common/String/CopyBox';
|
||||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||||
import AIModelSelector from '@/components/Select/AIModelSelector';
|
import AIModelSelector from '@/components/Select/AIModelSelector';
|
||||||
|
import { useRefresh } from '../../../../../../packages/web/hooks/useRefresh';
|
||||||
|
|
||||||
const MyModal = dynamic(() => import('@fastgpt/web/components/common/MyModal'));
|
const MyModal = dynamic(() => import('@fastgpt/web/components/common/MyModal'));
|
||||||
|
|
||||||
@ -173,7 +175,7 @@ const ModelTable = ({ Tab }: { Tab: React.ReactNode }) => {
|
|||||||
priceLabel: (
|
priceLabel: (
|
||||||
<Flex color={'myGray.700'}>
|
<Flex color={'myGray.700'}>
|
||||||
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
|
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
|
||||||
{item.charsPointsPrice}
|
{item.charsPointsPrice || 0}
|
||||||
</Box>
|
</Box>
|
||||||
{` ${t('common:support.wallet.subscription.point')} / 60${t('common:unit.seconds')}`}
|
{` ${t('common:support.wallet.subscription.point')} / 60${t('common:unit.seconds')}`}
|
||||||
</Flex>
|
</Flex>
|
||||||
@ -526,9 +528,10 @@ const ModelEditModal = ({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { feConfigs } = useSystemStore();
|
const { feConfigs } = useSystemStore();
|
||||||
|
|
||||||
const { register, getValues, setValue, handleSubmit, watch } = useForm<SystemModelItemType>({
|
const { register, getValues, setValue, handleSubmit, watch, reset } =
|
||||||
defaultValues: modelData
|
useForm<SystemModelItemType>({
|
||||||
});
|
defaultValues: modelData
|
||||||
|
});
|
||||||
|
|
||||||
const isCustom = !!modelData.isCustom;
|
const isCustom = !!modelData.isCustom;
|
||||||
const isLLMModel = modelData?.type === ModelTypeEnum.llm;
|
const isLLMModel = modelData?.type === ModelTypeEnum.llm;
|
||||||
@ -575,6 +578,22 @@ const ModelEditModal = ({
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [key, setKey] = useState(0);
|
||||||
|
const { runAsync: loadDefaultConfig, loading: loadingDefaultConfig } = useRequest2(
|
||||||
|
getSystemModelDefaultConfig,
|
||||||
|
{
|
||||||
|
onSuccess(res) {
|
||||||
|
reset({
|
||||||
|
...getValues(),
|
||||||
|
...res
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
setKey((prev) => prev + 1);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MyModal
|
<MyModal
|
||||||
iconSrc={'modal/edit'}
|
iconSrc={'modal/edit'}
|
||||||
@ -586,7 +605,7 @@ const ModelEditModal = ({
|
|||||||
h={'100%'}
|
h={'100%'}
|
||||||
>
|
>
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
<Flex gap={4}>
|
<Flex gap={4} key={key}>
|
||||||
<TableContainer flex={'1'}>
|
<TableContainer flex={'1'}>
|
||||||
<Table>
|
<Table>
|
||||||
<Thead>
|
<Thead>
|
||||||
@ -1007,6 +1026,16 @@ const ModelEditModal = ({
|
|||||||
</Flex>
|
</Flex>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
<ModalFooter>
|
<ModalFooter>
|
||||||
|
{!modelData.isCustom && (
|
||||||
|
<Button
|
||||||
|
isLoading={loadingDefaultConfig}
|
||||||
|
variant={'whiteBase'}
|
||||||
|
mr={4}
|
||||||
|
onClick={() => loadDefaultConfig(modelData.model)}
|
||||||
|
>
|
||||||
|
{t('account:reset_default')}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
<Button variant={'whiteBase'} mr={4} onClick={onClose}>
|
<Button variant={'whiteBase'} mr={4} onClick={onClose}>
|
||||||
{t('common:common.Cancel')}
|
{t('common:common.Cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@ -44,33 +44,10 @@ const UsageTableList = ({
|
|||||||
const { dateRange, selectTmbIds, isSelectAllTmb, usageSources, isSelectAllSource, projectName } =
|
const { dateRange, selectTmbIds, isSelectAllTmb, usageSources, isSelectAllSource, projectName } =
|
||||||
filterParams;
|
filterParams;
|
||||||
const requestParams = useMemo(() => {
|
const requestParams = useMemo(() => {
|
||||||
const appNameMap = {
|
|
||||||
['core.app.Question Guide']: t('common:core.app.Question Guide'),
|
|
||||||
['common:support.wallet.usage.Audio Speech']: t('common:support.wallet.usage.Audio Speech'),
|
|
||||||
['support.wallet.usage.Whisper']: t('common:support.wallet.usage.Whisper'),
|
|
||||||
['support.wallet.moduleName.index']: t('common:support.wallet.moduleName.index'),
|
|
||||||
['support.wallet.moduleName.qa']: t('common:support.wallet.moduleName.qa'),
|
|
||||||
['core.dataset.training.Auto mode']: t('common:core.dataset.training.Auto mode'),
|
|
||||||
['common:core.module.template.ai_chat']: t('common:core.module.template.ai_chat')
|
|
||||||
};
|
|
||||||
|
|
||||||
const sourcesMap = Object.fromEntries(
|
|
||||||
Object.entries(UsageSourceMap).map(([key, config]) => [
|
|
||||||
key,
|
|
||||||
{
|
|
||||||
label: t(config.label as any)
|
|
||||||
}
|
|
||||||
])
|
|
||||||
);
|
|
||||||
const title = t('account_usage:export_title');
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
dateStart: dateRange.from || new Date(),
|
dateStart: dateRange.from || new Date(),
|
||||||
dateEnd: addDays(dateRange.to || new Date(), 1),
|
dateEnd: addDays(dateRange.to || new Date(), 1),
|
||||||
sources: isSelectAllSource ? undefined : usageSources,
|
sources: isSelectAllSource ? undefined : usageSources,
|
||||||
sourcesMap,
|
|
||||||
appNameMap,
|
|
||||||
title,
|
|
||||||
teamMemberIds: isSelectAllTmb ? undefined : selectTmbIds,
|
teamMemberIds: isSelectAllTmb ? undefined : selectTmbIds,
|
||||||
projectName
|
projectName
|
||||||
};
|
};
|
||||||
@ -81,8 +58,7 @@ const UsageTableList = ({
|
|||||||
isSelectAllTmb,
|
isSelectAllTmb,
|
||||||
projectName,
|
projectName,
|
||||||
selectTmbIds,
|
selectTmbIds,
|
||||||
usageSources,
|
usageSources
|
||||||
t
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@ -103,7 +79,29 @@ const UsageTableList = ({
|
|||||||
await downloadFetch({
|
await downloadFetch({
|
||||||
url: `/api/proApi/support/wallet/usage/exportUsage`,
|
url: `/api/proApi/support/wallet/usage/exportUsage`,
|
||||||
filename: `usage.csv`,
|
filename: `usage.csv`,
|
||||||
body: requestParams
|
body: {
|
||||||
|
...requestParams,
|
||||||
|
appNameMap: {
|
||||||
|
['core.app.Question Guide']: t('common:core.app.Question Guide'),
|
||||||
|
['common:support.wallet.usage.Audio Speech']: t(
|
||||||
|
'common:support.wallet.usage.Audio Speech'
|
||||||
|
),
|
||||||
|
['support.wallet.usage.Whisper']: t('common:support.wallet.usage.Whisper'),
|
||||||
|
['support.wallet.moduleName.index']: t('common:support.wallet.moduleName.index'),
|
||||||
|
['support.wallet.moduleName.qa']: t('common:support.wallet.moduleName.qa'),
|
||||||
|
['core.dataset.training.Auto mode']: t('common:core.dataset.training.Auto mode'),
|
||||||
|
['common:core.module.template.ai_chat']: t('common:core.module.template.ai_chat')
|
||||||
|
},
|
||||||
|
sourcesMap: Object.fromEntries(
|
||||||
|
Object.entries(UsageSourceMap).map(([key, config]) => [
|
||||||
|
key,
|
||||||
|
{
|
||||||
|
label: t(config.label as any)
|
||||||
|
}
|
||||||
|
])
|
||||||
|
),
|
||||||
|
title: t('account_usage:export_title')
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { llmModelTypeFilterMap } from '@fastgpt/global/core/ai/constants';
|
|||||||
import AIModelSelector from '@/components/Select/AIModelSelector';
|
import AIModelSelector from '@/components/Select/AIModelSelector';
|
||||||
import { useContextSelector } from 'use-context-selector';
|
import { useContextSelector } from 'use-context-selector';
|
||||||
import { WorkflowContext } from '@/pageComponents/app/detail/WorkflowComponents/context';
|
import { WorkflowContext } from '@/pageComponents/app/detail/WorkflowComponents/context';
|
||||||
|
import { getWebDefaultModel } from '@/web/common/system/utils';
|
||||||
|
|
||||||
const SelectAiModelRender = ({ item, nodeId }: RenderInputProps) => {
|
const SelectAiModelRender = ({ item, nodeId }: RenderInputProps) => {
|
||||||
const { llmModelList } = useSystemStore();
|
const { llmModelList } = useSystemStore();
|
||||||
@ -21,6 +22,9 @@ const SelectAiModelRender = ({ item, nodeId }: RenderInputProps) => {
|
|||||||
}),
|
}),
|
||||||
[llmModelList, item.llmModelType]
|
[llmModelList, item.llmModelType]
|
||||||
);
|
);
|
||||||
|
const defaultModel = useMemo(() => {
|
||||||
|
return getWebDefaultModel(modelList).model;
|
||||||
|
}, [modelList]);
|
||||||
|
|
||||||
const onChangeModel = useCallback(
|
const onChangeModel = useCallback(
|
||||||
(e: string) => {
|
(e: string) => {
|
||||||
@ -38,10 +42,10 @@ const SelectAiModelRender = ({ item, nodeId }: RenderInputProps) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!item.value && modelList.length > 0) {
|
if (!modelList.find((model) => model.model === item.value) && !!defaultModel) {
|
||||||
onChangeModel(modelList[0].model);
|
onChangeModel(defaultModel);
|
||||||
}
|
}
|
||||||
}, []);
|
}, [defaultModel, item.value, modelList, onChangeModel]);
|
||||||
|
|
||||||
const Render = useMemo(() => {
|
const Render = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -69,7 +69,7 @@ const Test = ({ datasetId }: { datasetId: string }) => {
|
|||||||
usingReRank: false,
|
usingReRank: false,
|
||||||
limit: 5000,
|
limit: 5000,
|
||||||
similarity: 0,
|
similarity: 0,
|
||||||
datasetSearchUsingExtensionQuery: true,
|
datasetSearchUsingExtensionQuery: false,
|
||||||
datasetSearchExtensionModel: defaultModels.llm?.model,
|
datasetSearchExtensionModel: defaultModels.llm?.model,
|
||||||
datasetSearchExtensionBg: ''
|
datasetSearchExtensionBg: ''
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import MyIcon from '@fastgpt/web/components/common/Icon';
|
|||||||
import { getDocPath } from '@/web/common/system/doc';
|
import { getDocPath } from '@/web/common/system/doc';
|
||||||
import { datasetTypeCourseMap } from '@/web/core/dataset/constants';
|
import { datasetTypeCourseMap } from '@/web/core/dataset/constants';
|
||||||
import ApiDatasetForm from '../ApiDatasetForm';
|
import ApiDatasetForm from '../ApiDatasetForm';
|
||||||
|
import { getWebDefaultModel } from '@/web/common/system/utils';
|
||||||
|
|
||||||
export type CreateDatasetType =
|
export type CreateDatasetType =
|
||||||
| DatasetTypeEnum.dataset
|
| DatasetTypeEnum.dataset
|
||||||
@ -79,7 +80,7 @@ const CreateModal = ({
|
|||||||
name: '',
|
name: '',
|
||||||
intro: '',
|
intro: '',
|
||||||
vectorModel: defaultModels.embedding?.model,
|
vectorModel: defaultModels.embedding?.model,
|
||||||
agentModel: defaultModels.llm?.model
|
agentModel: getWebDefaultModel(datasetModelList)?.model
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const { register, setValue, handleSubmit, watch } = form;
|
const { register, setValue, handleSubmit, watch } = form;
|
||||||
|
|||||||
@ -38,7 +38,7 @@ async function handler(
|
|||||||
return TrackModel.create(data);
|
return TrackModel.create(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NextAPI(useIPFrequencyLimit(1, 5), handler);
|
export default NextAPI(useIPFrequencyLimit({ id: 'push-tracks', seconds: 1, limit: 5 }), handler);
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
api: {
|
api: {
|
||||||
|
|||||||
22
projects/app/src/pages/api/core/ai/model/getDefaultConfig.ts
Normal file
22
projects/app/src/pages/api/core/ai/model/getDefaultConfig.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import type { ApiRequestProps, ApiResponseType } from '@fastgpt/service/type/next';
|
||||||
|
import { NextAPI } from '@/service/middleware/entry';
|
||||||
|
import { authSystemAdmin } from '@fastgpt/service/support/permission/user/auth';
|
||||||
|
import { getSystemModelConfig } from '@fastgpt/service/core/ai/config/utils';
|
||||||
|
import { SystemModelItemType } from '@fastgpt/service/core/ai/type';
|
||||||
|
|
||||||
|
export type getDefaultQuery = { model: string };
|
||||||
|
|
||||||
|
export type getDefaultBody = {};
|
||||||
|
|
||||||
|
async function handler(
|
||||||
|
req: ApiRequestProps<getDefaultBody, getDefaultQuery>,
|
||||||
|
res: ApiResponseType<any>
|
||||||
|
): Promise<SystemModelItemType> {
|
||||||
|
await authSystemAdmin({ req });
|
||||||
|
|
||||||
|
const model = req.query.model;
|
||||||
|
|
||||||
|
return getSystemModelConfig(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default NextAPI(handler);
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import type { ApiRequestProps, ApiResponseType } from '@fastgpt/service/type/next';
|
import type { ApiRequestProps, ApiResponseType } from '@fastgpt/service/type/next';
|
||||||
import { NextAPI } from '@/service/middleware/entry';
|
import { NextAPI } from '@/service/middleware/entry';
|
||||||
import { authSystemAdmin } from '@fastgpt/service/support/permission/user/auth';
|
import { authSystemAdmin } from '@fastgpt/service/support/permission/user/auth';
|
||||||
import { findModelFromAlldata } from '@fastgpt/service/core/ai/model';
|
import { findModelFromAlldata, getReRankModel } from '@fastgpt/service/core/ai/model';
|
||||||
import {
|
import {
|
||||||
EmbeddingModelItemType,
|
EmbeddingModelItemType,
|
||||||
LLMModelItemType,
|
LLMModelItemType,
|
||||||
@ -120,6 +120,7 @@ const testSTTModel = async (model: STTModelType) => {
|
|||||||
|
|
||||||
const testReRankModel = async (model: ReRankModelItemType) => {
|
const testReRankModel = async (model: ReRankModelItemType) => {
|
||||||
await reRankRecall({
|
await reRankRecall({
|
||||||
|
model,
|
||||||
query: 'Hi',
|
query: 'Hi',
|
||||||
documents: [{ id: '1', text: 'Hi' }]
|
documents: [{ id: '1', text: 'Hi' }]
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { MongoSystemModel } from '@fastgpt/service/core/ai/config/schema';
|
|||||||
import { loadSystemModels } from '@fastgpt/service/core/ai/config/utils';
|
import { loadSystemModels } from '@fastgpt/service/core/ai/config/utils';
|
||||||
import { updateFastGPTConfigBuffer } from '@fastgpt/service/common/system/config/controller';
|
import { updateFastGPTConfigBuffer } from '@fastgpt/service/common/system/config/controller';
|
||||||
import { ModelTypeEnum } from '@fastgpt/global/core/ai/model';
|
import { ModelTypeEnum } from '@fastgpt/global/core/ai/model';
|
||||||
|
import { authSystemAdmin } from '@fastgpt/service/support/permission/user/auth';
|
||||||
|
|
||||||
export type updateDefaultQuery = {};
|
export type updateDefaultQuery = {};
|
||||||
|
|
||||||
@ -22,10 +23,12 @@ async function handler(
|
|||||||
req: ApiRequestProps<updateDefaultBody, updateDefaultQuery>,
|
req: ApiRequestProps<updateDefaultBody, updateDefaultQuery>,
|
||||||
res: ApiResponseType<any>
|
res: ApiResponseType<any>
|
||||||
): Promise<updateDefaultResponse> {
|
): Promise<updateDefaultResponse> {
|
||||||
|
await authSystemAdmin({ req });
|
||||||
|
|
||||||
const { llm, embedding, tts, stt, rerank } = req.body;
|
const { llm, embedding, tts, stt, rerank } = req.body;
|
||||||
|
|
||||||
await mongoSessionRun(async (session) => {
|
await mongoSessionRun(async (session) => {
|
||||||
await MongoSystemModel.updateMany({}, { $set: { 'metadata.isDefault': false } }, { session });
|
await MongoSystemModel.updateMany({}, { $unset: { 'metadata.isDefault': 1 } }, { session });
|
||||||
|
|
||||||
if (llm) {
|
if (llm) {
|
||||||
await MongoSystemModel.updateOne(
|
await MongoSystemModel.updateOne(
|
||||||
|
|||||||
@ -100,4 +100,4 @@ async function handler(req: NextApiRequest) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NextAPI(useIPFrequencyLimit(1, 15), handler);
|
export default NextAPI(useIPFrequencyLimit({ id: 'search-test', seconds: 1, limit: 15 }), handler);
|
||||||
|
|||||||
@ -70,4 +70,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NextAPI(useIPFrequencyLimit(120, 10, true), handler);
|
export default NextAPI(
|
||||||
|
useIPFrequencyLimit({ id: 'login-by-password', seconds: 120, limit: 10, force: true }),
|
||||||
|
handler
|
||||||
|
);
|
||||||
|
|||||||
@ -90,7 +90,10 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
|||||||
removeFilesByPaths(filePaths);
|
removeFilesByPaths(filePaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NextAPI(useIPFrequencyLimit(1, 1), handler);
|
export default NextAPI(
|
||||||
|
useIPFrequencyLimit({ id: 'transcriptions', seconds: 1, limit: 1 }),
|
||||||
|
handler
|
||||||
|
);
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
api: {
|
api: {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { LLMModelItemType } from '@fastgpt/global/core/ai/model.d';
|
||||||
import { useSystemStore } from './useSystemStore';
|
import { useSystemStore } from './useSystemStore';
|
||||||
|
|
||||||
export const downloadFetch = async ({
|
export const downloadFetch = async ({
|
||||||
@ -43,5 +44,15 @@ export const downloadFetch = async ({
|
|||||||
|
|
||||||
export const getWebLLMModel = (model?: string) => {
|
export const getWebLLMModel = (model?: string) => {
|
||||||
const list = useSystemStore.getState().llmModelList;
|
const list = useSystemStore.getState().llmModelList;
|
||||||
return list.find((item) => item.model === model || item.name === model) ?? list[0];
|
const defaultModels = useSystemStore.getState().defaultModels;
|
||||||
|
|
||||||
|
return list.find((item) => item.model === model || item.name === model) ?? defaultModels.llm!;
|
||||||
|
};
|
||||||
|
export const getWebDefaultModel = (llmList: LLMModelItemType[] = []) => {
|
||||||
|
const list = llmList.length > 0 ? llmList : useSystemStore.getState().llmModelList;
|
||||||
|
const defaultModels = useSystemStore.getState().defaultModels;
|
||||||
|
|
||||||
|
return defaultModels.llm && list.find((item) => item.model === defaultModels.llm?.model)
|
||||||
|
? defaultModels.llm
|
||||||
|
: list[0];
|
||||||
};
|
};
|
||||||
|
|||||||
@ -69,10 +69,6 @@ export const useAudioPlay = (
|
|||||||
|
|
||||||
if (!response.body || !response.ok) {
|
if (!response.body || !response.ok) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
toast({
|
|
||||||
status: 'error',
|
|
||||||
title: getErrText(data, t('common:core.chat.Audio Speech Error'))
|
|
||||||
});
|
|
||||||
return Promise.reject(data);
|
return Promise.reject(data);
|
||||||
}
|
}
|
||||||
return response.body;
|
return response.body;
|
||||||
|
|||||||
@ -10,6 +10,9 @@ export const getSystemModelList = () => GET<listResponse>('/core/ai/model/list')
|
|||||||
export const getSystemModelDetail = (model: string) =>
|
export const getSystemModelDetail = (model: string) =>
|
||||||
GET<SystemModelItemType>('/core/ai/model/detail', { model });
|
GET<SystemModelItemType>('/core/ai/model/detail', { model });
|
||||||
|
|
||||||
|
export const getSystemModelDefaultConfig = (model: string) =>
|
||||||
|
GET<SystemModelItemType>('/core/ai/model/getDefaultConfig', { model });
|
||||||
|
|
||||||
export const putSystemModel = (data: updateBody) => PUT('/core/ai/model/update', data);
|
export const putSystemModel = (data: updateBody) => PUT('/core/ai/model/update', data);
|
||||||
|
|
||||||
export const deleteSystemModel = (data: deleteQuery) => DELETE('/core/ai/model/delete', data);
|
export const deleteSystemModel = (data: deleteQuery) => DELETE('/core/ai/model/delete', data);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user