mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-28 19:58:11 +08:00
fix: improve pipeline compilation, template updates, and document resets (#16815)
### What problem does this PR solve? - Clear stale pipeline IDs and generated data when updating documents without `pipeline_id`. - Support tree compilation results in pipeline workflows. - Update compilation templates in place while preserving existing template IDs. - Improve duplicate-template validation messages. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) Co-authored-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -47,6 +47,7 @@ export interface ICreateCompilationTemplateGroupRequestBody {
|
||||
description?: string;
|
||||
avatar?: string;
|
||||
templates: Array<{
|
||||
id?: string;
|
||||
name?: string;
|
||||
description?: string;
|
||||
kind: string;
|
||||
|
||||
@@ -18,6 +18,7 @@ export const buildRaptorConfigSchema = (t: (key: string) => string) =>
|
||||
|
||||
export const buildTemplateSchema = (t: (key: string) => string) =>
|
||||
z.object({
|
||||
id: z.string().optional(),
|
||||
name: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
llm_id: z.string().min(1, t('setting.llmForExtractionRequired')),
|
||||
|
||||
@@ -30,6 +30,7 @@ export const getFieldKeyOrder = (keys: string[]): string[] => {
|
||||
};
|
||||
|
||||
export const DefaultTemplateValues: TemplateSchemaType = {
|
||||
id: undefined,
|
||||
name: '',
|
||||
description: '',
|
||||
llm_id: '',
|
||||
@@ -137,6 +138,7 @@ export const transformDetailToForm = (
|
||||
if (detail.kind === CompilationTemplateKind.Tree) {
|
||||
const raptor: ICompilationTemplateRaptorConfig = config.raptor ?? {};
|
||||
return {
|
||||
id: detail.id,
|
||||
name: detail.name ?? '',
|
||||
description: detail.description ?? '',
|
||||
llm_id: config.llm_id ?? '',
|
||||
@@ -161,6 +163,7 @@ export const transformDetailToForm = (
|
||||
});
|
||||
|
||||
return {
|
||||
id: detail.id,
|
||||
name: detail.name ?? '',
|
||||
description: detail.description ?? '',
|
||||
llm_id: config.llm_id ?? '',
|
||||
@@ -207,6 +210,7 @@ export const transformTemplateToPayload = (template: TemplateSchemaType) => {
|
||||
}
|
||||
|
||||
return {
|
||||
id: template.id,
|
||||
name: template.name,
|
||||
description: template.description,
|
||||
kind: template.kind,
|
||||
|
||||
Reference in New Issue
Block a user