mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-25 16:21:41 +08:00
Feat: add image table context to pipeline splitter (#12167)
### What problem does this PR solve? Add image table context to pipeline splitter. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -206,6 +206,7 @@ export const initialSplitterValues = {
|
||||
chunk_token_size: 512,
|
||||
overlapped_percent: 0,
|
||||
delimiters: [{ value: '\n' }],
|
||||
image_table_context_window: 0,
|
||||
};
|
||||
|
||||
export enum Hierarchy {
|
||||
|
||||
@ -22,6 +22,7 @@ const outputList = buildOutputList(initialSplitterValues.outputs);
|
||||
|
||||
export const FormSchema = z.object({
|
||||
chunk_token_size: z.number(),
|
||||
image_table_context_window: z.number(),
|
||||
delimiters: z.array(
|
||||
z.object({
|
||||
value: z.string().optional(),
|
||||
@ -74,6 +75,13 @@ const SplitterForm = ({ node }: INextOperatorForm) => {
|
||||
min={0}
|
||||
label={t('flow.overlappedPercent')}
|
||||
></SliderInputFormField>
|
||||
<SliderInputFormField
|
||||
name="image_table_context_window"
|
||||
max={256}
|
||||
min={0}
|
||||
label={t('knowledgeConfiguration.imageTableContextWindow')}
|
||||
tooltip={t('knowledgeConfiguration.imageTableContextWindowTip')}
|
||||
></SliderInputFormField>
|
||||
<section>
|
||||
<span className="mb-2 inline-block">{t('flow.delimiters')}</span>
|
||||
<div className="space-y-4">
|
||||
|
||||
@ -289,10 +289,14 @@ function transformParserParams(params: ParserFormSchemaType) {
|
||||
}
|
||||
|
||||
function transformSplitterParams(params: SplitterFormSchemaType) {
|
||||
const { image_table_context_window, ...rest } = params;
|
||||
const imageTableContextWindow = Number(image_table_context_window || 0);
|
||||
return {
|
||||
...params,
|
||||
...rest,
|
||||
overlapped_percent: Number(params.overlapped_percent) / 100,
|
||||
delimiters: transformObjectArrayToPureArray(params.delimiters, 'value'),
|
||||
table_context_size: imageTableContextWindow,
|
||||
image_context_size: imageTableContextWindow,
|
||||
|
||||
// Unset children delimiters if this option is not enabled
|
||||
children_delimiters: params.enable_children
|
||||
|
||||
Reference in New Issue
Block a user