add model test log (#4272)

* sync collection

* remove lock

* add model test log

* update ui

* update log

* fix: channel test

* preview chunk ui

* test model ux

* test model log

* perf: dataset selector

* fix: system plugin auth

* update nextjs
This commit is contained in:
Archer
2025-03-24 13:49:43 +08:00
committed by archer
parent a680b565ea
commit 2fcf421672
24 changed files with 210 additions and 153 deletions

View File

@@ -3,21 +3,25 @@ import { getAxiosConfig } from '../config';
import axios from 'axios';
import FormData from 'form-data';
import { getSTTModel } from '../model';
import { STTModelType } from '@fastgpt/global/core/ai/model.d';
export const aiTranscriptions = async ({
model,
model: modelData,
fileStream,
headers
}: {
model: string;
model: STTModelType;
fileStream: fs.ReadStream;
headers?: Record<string, string>;
}) => {
if (!modelData) {
return Promise.reject('no model');
}
const data = new FormData();
data.append('model', model);
data.append('model', modelData.model);
data.append('file', fileStream);
const modelData = getSTTModel(model);
const aiAxiosConfig = getAxiosConfig();
const { data: result } = await axios<{ text: string }>({