mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Move the pipeline translation field to flow #9869 ### Type of change - [X] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -36,7 +36,7 @@ function InnerFileNode({ data, id, selected }: NodeProps<IBeginNode>) {
|
||||
<section className="flex items-center gap-2">
|
||||
<OperatorIcon name={data.label as Operator}></OperatorIcon>
|
||||
<div className="truncate text-center font-semibold text-sm">
|
||||
{t(`dataflow.begin`)}
|
||||
{t(`flow.begin`)}
|
||||
</div>
|
||||
</section>
|
||||
<section className={cn(styles.generateParameters, 'flex gap-2 flex-col')}>
|
||||
|
||||
@ -46,7 +46,7 @@ function ParserNode({
|
||||
className="flex flex-col text-text-primary gap-1"
|
||||
>
|
||||
<span className="text-text-secondary">Parser {idx + 1}</span>
|
||||
{t(`dataflow.fileFormatOptions.${x.fileFormat}`)}
|
||||
{t(`flow.fileFormatOptions.${x.fileFormat}`)}
|
||||
</LabelCard>
|
||||
)}
|
||||
</NodeCollapsible>
|
||||
|
||||
@ -38,12 +38,10 @@ function TokenizerNode({
|
||||
></CommonHandle>
|
||||
<NodeHeader id={id} name={data.name} label={data.label}></NodeHeader>
|
||||
<LabelCard className="text-text-primary flex justify-between flex-col gap-1">
|
||||
<span className="text-text-secondary">
|
||||
{t('dataflow.searchMethod')}
|
||||
</span>
|
||||
<span className="text-text-secondary">{t('flow.searchMethod')}</span>
|
||||
<ul className="space-y-1">
|
||||
{data.form?.search_method.map((x) => (
|
||||
<li key={x}>{t(`dataflow.tokenizerSearchMethodOptions.${x}`)}</li>
|
||||
<li key={x}>{t(`flow.tokenizerSearchMethodOptions.${x}`)}</li>
|
||||
))}
|
||||
</ul>
|
||||
</LabelCard>
|
||||
|
||||
@ -47,7 +47,7 @@ const ExtractorForm = ({ node }: INextOperatorForm) => {
|
||||
|
||||
const promptOptions = useBuildNodeOutputOptions(node?.id);
|
||||
|
||||
const options = buildOptions(ContextGeneratorFieldName, t, 'dataflow');
|
||||
const options = buildOptions(ContextGeneratorFieldName, t, 'flow');
|
||||
|
||||
const {
|
||||
handleFieldNameChange,
|
||||
@ -63,7 +63,7 @@ const ExtractorForm = ({ node }: INextOperatorForm) => {
|
||||
<Form {...form}>
|
||||
<FormWrapper>
|
||||
<LargeModelFormField></LargeModelFormField>
|
||||
<RAGFlowFormItem label={t('dataflow.fieldName')} name="field_name">
|
||||
<RAGFlowFormItem label={t('flow.fieldName')} name="field_name">
|
||||
{(field) => (
|
||||
<SelectWithSearch
|
||||
onChange={(value) => {
|
||||
@ -93,7 +93,7 @@ const ExtractorForm = ({ node }: INextOperatorForm) => {
|
||||
</FormWrapper>
|
||||
{visible && (
|
||||
<ConfirmDeleteDialog
|
||||
title={t('dataflow.switchPromptMessage')}
|
||||
title={t('flow.switchPromptMessage')}
|
||||
open
|
||||
onOpenChange={hideModal}
|
||||
onOk={confirmSwitch}
|
||||
|
||||
@ -21,7 +21,7 @@ export function useSwitchPrompt(form: UseFormReturn<ExtractorFormSchemaType>) {
|
||||
|
||||
const setPromptValue = useCallback(
|
||||
(field: keyof ExtractorFormSchemaType, key: string, value: string) => {
|
||||
form.setValue(field, t(`dataflow.prompts.${key}.${value}`), {
|
||||
form.setValue(field, t(`flow.prompts.${key}.${value}`), {
|
||||
shouldDirty: true,
|
||||
shouldValidate: true,
|
||||
});
|
||||
|
||||
@ -98,7 +98,7 @@ export function RegularExpressions({
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<FormLabel required className="mb-2 text-text-secondary">
|
||||
{t('dataflow.regularExpressions')}
|
||||
{t('flow.regularExpressions')}
|
||||
</FormLabel>
|
||||
<section className="space-y-4">
|
||||
{fields.map((field, index) => (
|
||||
@ -158,7 +158,7 @@ const HierarchicalMergerForm = ({ node }: INextOperatorForm) => {
|
||||
return (
|
||||
<Form {...form}>
|
||||
<FormWrapper>
|
||||
<RAGFlowFormItem name={'hierarchy'} label={t('dataflow.hierarchy')}>
|
||||
<RAGFlowFormItem name={'hierarchy'} label={t('flow.hierarchy')}>
|
||||
<SelectWithSearch options={HierarchyOptions}></SelectWithSearch>
|
||||
</RAGFlowFormItem>
|
||||
{fields.map((field, index) => (
|
||||
|
||||
@ -50,7 +50,7 @@ export function OutputFormatFormField({
|
||||
return (
|
||||
<RAGFlowFormItem
|
||||
name={buildFieldNameWithPrefix(`output_format`, prefix)}
|
||||
label={t('dataflow.outputFormat')}
|
||||
label={t('flow.outputFormat')}
|
||||
>
|
||||
<SelectWithSearch
|
||||
options={buildOutputOptionsFormatMap()[fileType]}
|
||||
@ -69,7 +69,7 @@ export function ParserMethodFormField({
|
||||
name={buildFieldNameWithPrefix(`parse_method`, prefix)}
|
||||
horizontal={false}
|
||||
optionsWithoutLLM={optionsWithoutLLM}
|
||||
label={t('dataflow.parserMethod')}
|
||||
label={t('flow.parserMethod')}
|
||||
></LayoutRecognizeFormField>
|
||||
);
|
||||
}
|
||||
@ -92,7 +92,7 @@ export function LanguageFormField({ prefix }: CommonProps) {
|
||||
return (
|
||||
<RAGFlowFormItem
|
||||
name={buildFieldNameWithPrefix(`lang`, prefix)}
|
||||
label={t('dataflow.lang')}
|
||||
label={t('flow.lang')}
|
||||
>
|
||||
{(field) => (
|
||||
<SelectWithSearch
|
||||
|
||||
@ -14,7 +14,7 @@ export function EmailFormFields({ prefix }: CommonProps) {
|
||||
<>
|
||||
<RAGFlowFormItem
|
||||
name={buildFieldNameWithPrefix(`fields`, prefix)}
|
||||
label={t('dataflow.fields')}
|
||||
label={t('flow.fields')}
|
||||
>
|
||||
{(field) => (
|
||||
<MultiSelect
|
||||
|
||||
@ -17,7 +17,7 @@ export function ImageFormFields({ prefix }: CommonProps) {
|
||||
const options = buildOptions(
|
||||
ImageParseMethod,
|
||||
t,
|
||||
'dataflow.imageParseMethodOptions',
|
||||
'flow.imageParseMethodOptions',
|
||||
);
|
||||
const parseMethodName = buildFieldNameWithPrefix('parse_method', prefix);
|
||||
|
||||
@ -50,9 +50,9 @@ export function ImageFormFields({ prefix }: CommonProps) {
|
||||
{languageShown && (
|
||||
<RAGFlowFormItem
|
||||
name={buildFieldNameWithPrefix('system_prompt', prefix)}
|
||||
label={t('dataflow.systemPrompt')}
|
||||
label={t('flow.systemPrompt')}
|
||||
>
|
||||
<Textarea placeholder={t('dataflow.systemPromptPlaceholder')} />
|
||||
<Textarea placeholder={t('flow.systemPromptPlaceholder')} />
|
||||
</RAGFlowFormItem>
|
||||
)}
|
||||
</>
|
||||
|
||||
@ -133,7 +133,7 @@ function ParserItem({
|
||||
</div>
|
||||
<RAGFlowFormItem
|
||||
name={buildFieldNameWithPrefix(`fileFormat`, prefix)}
|
||||
label={t('dataflow.fileFormats')}
|
||||
label={t('flow.fileFormats')}
|
||||
>
|
||||
{(field) => (
|
||||
<SelectWithSearch
|
||||
@ -165,7 +165,7 @@ const ParserForm = ({ node }: INextOperatorForm) => {
|
||||
const FileFormatOptions = buildOptions(
|
||||
FileType,
|
||||
t,
|
||||
'dataflow.fileFormatOptions',
|
||||
'flow.fileFormatOptions',
|
||||
).filter(
|
||||
(x) => x.value !== FileType.Video, // Temporarily hide the video option
|
||||
);
|
||||
@ -212,7 +212,7 @@ const ParserForm = ({ node }: INextOperatorForm) => {
|
||||
})}
|
||||
{fields.length < FileFormatOptions.length && (
|
||||
<BlockButton onClick={add} type="button" className="mt-2.5">
|
||||
{t('dataflow.addParser')}
|
||||
{t('flow.addParser')}
|
||||
</BlockButton>
|
||||
)}
|
||||
</form>
|
||||
|
||||
@ -60,7 +60,7 @@ const SplitterForm = ({ node }: INextOperatorForm) => {
|
||||
name="overlapped_percent"
|
||||
max={30}
|
||||
min={0}
|
||||
label={t('dataflow.overlappedPercent')}
|
||||
label={t('flow.overlappedPercent')}
|
||||
></SliderInputFormField>
|
||||
<section>
|
||||
<span className="mb-2 inline-block">{t('flow.delimiters')}</span>
|
||||
|
||||
@ -38,12 +38,12 @@ const TokenizerForm = ({ node }: INextOperatorForm) => {
|
||||
const SearchMethodOptions = buildOptions(
|
||||
TokenizerSearchMethod,
|
||||
t,
|
||||
`dataflow.tokenizerSearchMethodOptions`,
|
||||
`flow.tokenizerSearchMethodOptions`,
|
||||
);
|
||||
const FieldsOptions = buildOptions(
|
||||
TokenizerFields,
|
||||
t,
|
||||
'dataflow.tokenizerFieldsOptions',
|
||||
'flow.tokenizerFieldsOptions',
|
||||
);
|
||||
|
||||
const form = useForm<TokenizerFormSchemaType>({
|
||||
@ -59,8 +59,8 @@ const TokenizerForm = ({ node }: INextOperatorForm) => {
|
||||
<FormWrapper>
|
||||
<RAGFlowFormItem
|
||||
name="search_method"
|
||||
label={t('dataflow.searchMethod')}
|
||||
tooltip={t('dataflow.searchMethodTip')}
|
||||
label={t('flow.searchMethod')}
|
||||
tooltip={t('flow.searchMethodTip')}
|
||||
>
|
||||
{(field) => (
|
||||
<MultiSelect
|
||||
@ -73,11 +73,11 @@ const TokenizerForm = ({ node }: INextOperatorForm) => {
|
||||
</RAGFlowFormItem>
|
||||
<SliderInputFormField
|
||||
name="filename_embd_weight"
|
||||
label={t('dataflow.filenameEmbeddingWeight')}
|
||||
label={t('flow.filenameEmbeddingWeight')}
|
||||
max={0.5}
|
||||
step={0.01}
|
||||
></SliderInputFormField>
|
||||
<RAGFlowFormItem name="fields" label={t('dataflow.fields')}>
|
||||
<RAGFlowFormItem name="fields" label={t('flow.fields')}>
|
||||
{(field) => <SelectWithSearch options={FieldsOptions} {...field} />}
|
||||
</RAGFlowFormItem>
|
||||
</FormWrapper>
|
||||
|
||||
@ -128,8 +128,8 @@ export const useInitializeOperatorParams = () => {
|
||||
[Operator.Extractor]: {
|
||||
...initialExtractorValues,
|
||||
llm_id: llmId,
|
||||
sys_prompt: t('dataflow.prompts.system.summary'),
|
||||
prompts: t('dataflow.prompts.user.summary'),
|
||||
sys_prompt: t('flow.prompts.system.summary'),
|
||||
prompts: t('flow.prompts.user.summary'),
|
||||
},
|
||||
};
|
||||
}, [llmId]);
|
||||
|
||||
@ -61,7 +61,7 @@ export const useShowSingleDebugDrawer = () => {
|
||||
};
|
||||
};
|
||||
|
||||
const ExcludedNodes = [Operator.Note, Operator.Placeholder];
|
||||
const ExcludedNodes = [Operator.Note, Operator.Placeholder, Operator.File];
|
||||
|
||||
export function useShowDrawer({
|
||||
drawerVisible,
|
||||
|
||||
@ -137,7 +137,7 @@ export default function Agent() {
|
||||
|
||||
const handleRunPipeline = useCallback(() => {
|
||||
if (!findNodeByName(Operator.Tokenizer)) {
|
||||
message.warning(t('dataflow.tokenizerRequired'));
|
||||
message.warning(t('flow.tokenizerRequired'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ export function PipelineLogSheet({
|
||||
uploadedFileData?.extension,
|
||||
})}
|
||||
>
|
||||
{t('dataflow.viewResult')} <ArrowUpRight />
|
||||
{t('flow.viewResult')} <ArrowUpRight />
|
||||
</Button>
|
||||
)}
|
||||
</SheetTitle>
|
||||
@ -95,7 +95,7 @@ export function PipelineLogSheet({
|
||||
className="w-full mt-8 bg-state-error/10 text-state-error hover:bg-state-error hover:text-bg-base"
|
||||
onClick={handleCancel}
|
||||
>
|
||||
<CirclePause /> {t('dataflow.cancel')}
|
||||
<CirclePause /> {t('flow.cancel')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
@ -104,7 +104,7 @@ export function PipelineLogSheet({
|
||||
className="w-full mt-8 bg-accent-primary-5 text-text-secondary hover:bg-accent-primary-5 hover:text-accent-primary hover:border-accent-primary hover:border"
|
||||
>
|
||||
<SquareArrowOutUpRight />
|
||||
{t('dataflow.exportJson')}
|
||||
{t('flow.exportJson')}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user