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:
Yongteng Lei
2025-12-24 16:58:14 +08:00
committed by GitHub
parent 44671ea413
commit 9b52ba8061
6 changed files with 31 additions and 44 deletions

View File

@ -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 {

View File

@ -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">

View File

@ -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