chore: tts, stt meta

This commit is contained in:
jialin
2026-02-05 20:35:07 +08:00
parent a1a7979fb3
commit 2765d5edeb
11 changed files with 422 additions and 13 deletions
+11
View File
@@ -1,6 +1,7 @@
import CheckboxField from '@/components/seal-form/checkbox-field';
import SealInput from '@/components/seal-form/seal-input';
import UploadAudio from '@/components/upload-audio';
import useAppUtils from '@/hooks/use-app-utils';
import { convertFileToBase64 } from '@/utils/load-audio-file';
import { CloseCircleFilled } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
@@ -36,10 +37,12 @@ const Container = styled.div`
`;
export const RefAudioFormItem: React.FC = () => {
const { getRuleMessage } = useAppUtils();
const { meta, onValuesChange } = useFormContext();
const form = Form.useFormInstance();
const intl = useIntl();
const [fileName, setFileName] = React.useState<string>('');
const taskType = Form.useWatch('task_type', form);
// handle upload audio file, transfer to a base64 url
const handleUploadChange = async (data: { file: any; fileList: any }) => {
@@ -73,10 +76,18 @@ export const RefAudioFormItem: React.FC = () => {
<Form.Item
name="ref_audio"
getValueProps={(value) => ({ value: fileName ? fileName : value })}
rules={[
{
required: taskType === 'Base',
message: getRuleMessage('input', 'playground.params.refAudio')
}
]}
dependencies={['task_type']}
>
<SealInput.Input
allowClear
readOnly={!!fileName}
required={taskType === 'Base'}
suffix={
<SuffixWrapper>
{fileName ? (
@@ -51,6 +51,10 @@ export const TTSAdvancedParamsConfig: ParamsSchema[] = [
text: 'playground.params.instructions',
isLocalized: true
},
description: {
text: 'playground.params.instructions.tips',
isLocalized: true
},
attrs: {
allowClear: true
},