feat: default model (#3662)

* move model config

* feat: default model
This commit is contained in:
Archer
2025-01-24 18:44:43 +08:00
committed by GitHub
parent 5ce889942a
commit 38efa3e050
167 changed files with 2999 additions and 2899 deletions

View File

@@ -9,7 +9,7 @@ import { OutLinkChatAuthProps } from '@fastgpt/global/support/permission/chat';
import { NextAPI } from '@/service/middleware/entry';
import { aiTranscriptions } from '@fastgpt/service/core/ai/audio/transcriptions';
import { useIPFrequencyLimit } from '@fastgpt/service/common/middle/reqFrequencyLimit';
import { getFirstSTTModel } from '@fastgpt/service/core/ai/model';
import { getDefaultSTTModel } from '@fastgpt/service/core/ai/model';
const upload = getUploadModel({
maxSize: 5
@@ -37,7 +37,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
filePaths = [file.path];
if (!getFirstSTTModel()) {
if (!getDefaultSTTModel()) {
throw new Error('whisper model not found');
}
@@ -66,7 +66,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
// }
const result = await aiTranscriptions({
model: getFirstSTTModel().model,
model: getDefaultSTTModel().model,
fileStream: fs.createReadStream(file.path)
});