mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Display the video field in the parser operator #9869 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -100,7 +100,7 @@ export function NodeCollapsible<T extends any[]>({
|
|||||||
>
|
>
|
||||||
{nextItems.slice(0, 3).map(children)}
|
{nextItems.slice(0, 3).map(children)}
|
||||||
<CollapsibleContent className={nextClassName}>
|
<CollapsibleContent className={nextClassName}>
|
||||||
{nextItems.slice(3).map(children)}
|
{nextItems.slice(3).map((x, idx) => children(x, idx + 3))}
|
||||||
</CollapsibleContent>
|
</CollapsibleContent>
|
||||||
{nextItems.length > 3 && (
|
{nextItems.length > 3 && (
|
||||||
<CollapsibleTrigger
|
<CollapsibleTrigger
|
||||||
|
|||||||
@ -1633,6 +1633,7 @@ This delimiter is used to split the input text into several text pieces echo of
|
|||||||
word: 'Word',
|
word: 'Word',
|
||||||
slides: 'PPT',
|
slides: 'PPT',
|
||||||
audio: 'Audio',
|
audio: 'Audio',
|
||||||
|
video: 'Video',
|
||||||
},
|
},
|
||||||
fields: 'Field',
|
fields: 'Field',
|
||||||
addParser: 'Add Parser',
|
addParser: 'Add Parser',
|
||||||
|
|||||||
@ -35,14 +35,14 @@ import { EmailFormFields } from './email-form-fields';
|
|||||||
import { ImageFormFields } from './image-form-fields';
|
import { ImageFormFields } from './image-form-fields';
|
||||||
import { PdfFormFields } from './pdf-form-fields';
|
import { PdfFormFields } from './pdf-form-fields';
|
||||||
import { buildFieldNameWithPrefix } from './utils';
|
import { buildFieldNameWithPrefix } from './utils';
|
||||||
import { VideoFormFields } from './video-form-fields';
|
import { AudioFormFields, VideoFormFields } from './video-form-fields';
|
||||||
|
|
||||||
const outputList = buildOutputList(initialParserValues.outputs);
|
const outputList = buildOutputList(initialParserValues.outputs);
|
||||||
|
|
||||||
const FileFormatWidgetMap = {
|
const FileFormatWidgetMap = {
|
||||||
[FileType.PDF]: PdfFormFields,
|
[FileType.PDF]: PdfFormFields,
|
||||||
[FileType.Video]: VideoFormFields,
|
[FileType.Video]: VideoFormFields,
|
||||||
[FileType.Audio]: VideoFormFields,
|
[FileType.Audio]: AudioFormFields,
|
||||||
[FileType.Email]: EmailFormFields,
|
[FileType.Email]: EmailFormFields,
|
||||||
[FileType.Image]: ImageFormFields,
|
[FileType.Image]: ImageFormFields,
|
||||||
};
|
};
|
||||||
@ -162,13 +162,7 @@ const ParserForm = ({ node }: INextOperatorForm) => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const defaultValues = useFormValues(initialParserValues, node);
|
const defaultValues = useFormValues(initialParserValues, node);
|
||||||
|
|
||||||
const FileFormatOptions = buildOptions(
|
const FileFormatOptions = buildOptions(FileType, t, 'flow.fileFormatOptions');
|
||||||
FileType,
|
|
||||||
t,
|
|
||||||
'flow.fileFormatOptions',
|
|
||||||
).filter(
|
|
||||||
(x) => x.value !== FileType.Video, // Temporarily hide the video option
|
|
||||||
);
|
|
||||||
|
|
||||||
const form = useForm<z.infer<typeof FormSchema>>({
|
const form = useForm<z.infer<typeof FormSchema>>({
|
||||||
defaultValues,
|
defaultValues,
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import {
|
|||||||
OutputFormatFormFieldProps,
|
OutputFormatFormFieldProps,
|
||||||
} from './common-form-fields';
|
} from './common-form-fields';
|
||||||
|
|
||||||
export function VideoFormFields({ prefix }: OutputFormatFormFieldProps) {
|
export function AudioFormFields({ prefix }: OutputFormatFormFieldProps) {
|
||||||
const modelOptions = useComposeLlmOptionsByModelTypes([
|
const modelOptions = useComposeLlmOptionsByModelTypes([
|
||||||
LlmModelType.Speech2text,
|
LlmModelType.Speech2text,
|
||||||
]);
|
]);
|
||||||
@ -20,3 +20,19 @@ export function VideoFormFields({ prefix }: OutputFormatFormFieldProps) {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function VideoFormFields({ prefix }: OutputFormatFormFieldProps) {
|
||||||
|
const modelOptions = useComposeLlmOptionsByModelTypes([
|
||||||
|
LlmModelType.Image2text,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{/* Multimodal Model */}
|
||||||
|
<LargeModelFormField
|
||||||
|
prefix={prefix}
|
||||||
|
options={modelOptions}
|
||||||
|
></LargeModelFormField>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@ -65,7 +65,7 @@ const Chunk = () => {
|
|||||||
navigateToDatasetOverview,
|
navigateToDatasetOverview,
|
||||||
navigateToDatasetList,
|
navigateToDatasetList,
|
||||||
navigateToAgents,
|
navigateToAgents,
|
||||||
navigateToDataflow,
|
navigateToAgent,
|
||||||
} = useNavigatePage();
|
} = useNavigatePage();
|
||||||
let fileUrl = useGetDocumentUrl(isAgent);
|
let fileUrl = useGetDocumentUrl(isAgent);
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ const Chunk = () => {
|
|||||||
navigateToDatasetOverview(knowledgeId)();
|
navigateToDatasetOverview(knowledgeId)();
|
||||||
}
|
}
|
||||||
if (agentId) {
|
if (agentId) {
|
||||||
navigateToDataflow(agentId)();
|
navigateToAgent(agentId)();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user