mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-01 08:05:07 +08:00
feat: add image context window in dataset config (#12094)
### What problem does this PR solve? Add image context window configuration in **Dataset** > **Configduration** and **Dataset** > **Files** > **Parse** > **Ingestion Pipeline** (**Chunk Method** modal) ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -310,6 +310,36 @@ export function EnableTocToggle() {
|
||||
);
|
||||
}
|
||||
|
||||
export function ImageContextWindow() {
|
||||
const { t } = useTranslate('knowledgeConfiguration');
|
||||
const form = useFormContext();
|
||||
|
||||
return (
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="parser_config.image_context_window"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormControl>
|
||||
<SliderInputFormField
|
||||
{...field}
|
||||
label={t('imageContextWindow')}
|
||||
tooltip={t('imageContextWindowTip')}
|
||||
defaultValue={0}
|
||||
min={0}
|
||||
max={256}
|
||||
/>
|
||||
</FormControl>
|
||||
<div className="flex pt-1">
|
||||
<div className="w-1/4"></div>
|
||||
<FormMessage />
|
||||
</div>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function OverlappedPercent() {
|
||||
return (
|
||||
<SliderInputFormField
|
||||
|
||||
@ -14,6 +14,7 @@ import {
|
||||
import {
|
||||
AutoMetadata,
|
||||
EnableTocToggle,
|
||||
ImageContextWindow,
|
||||
OverlappedPercent,
|
||||
} from './common-item';
|
||||
|
||||
@ -26,6 +27,7 @@ export function NaiveConfiguration() {
|
||||
<DelimiterFormField></DelimiterFormField>
|
||||
<ChildrenDelimiterForm />
|
||||
<EnableTocToggle />
|
||||
<ImageContextWindow />
|
||||
<AutoMetadata />
|
||||
<OverlappedPercent />
|
||||
</ConfigurationFormContainer>
|
||||
|
||||
@ -32,6 +32,7 @@ export const formSchema = z
|
||||
tag_kb_ids: z.array(z.string()).nullish(),
|
||||
topn_tags: z.number().optional(),
|
||||
toc_extraction: z.boolean().optional(),
|
||||
image_context_window: z.number().optional(),
|
||||
overlapped_percent: z.number().optional(),
|
||||
// MinerU-specific options
|
||||
mineru_parse_method: z.enum(['auto', 'txt', 'ocr']).optional(),
|
||||
|
||||
@ -70,6 +70,7 @@ export default function DatasetSettings() {
|
||||
html4excel: false,
|
||||
topn_tags: 3,
|
||||
toc_extraction: false,
|
||||
image_context_window: 0,
|
||||
overlapped_percent: 0,
|
||||
// MinerU-specific defaults
|
||||
mineru_parse_method: 'auto',
|
||||
|
||||
Reference in New Issue
Block a user