mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-02 05:47:31 +08:00
refactor(knowledge_compiler): derive variant from template kind via single template id (#17630)
## Summary Refactor the Go `KnowledgeCompilerComponent` so its parameter is a **single string template id** instead of a DSL-level `variant` (or plural group id list). The `variant` is no longer in the DSL — it is now **derived at runtime from the resolved compilation template's `kind` field**. This aligns the Go ingestion port with the frontend Compiler operator, which emits a singular `compilation_template_group_id` and does not write `variant` into the generated `compiler.json`.
This commit is contained in:
@@ -10,7 +10,7 @@ export function CompilationNode({ ...props }: NodeProps<IRagNode>) {
|
||||
const { data } = props;
|
||||
const { t } = useTranslation();
|
||||
const options = useCompilationTemplateGroupOptions();
|
||||
const groupId = get(data, 'form.compilation_template_group_ids');
|
||||
const groupId = get(data, 'form.compilation_template_group_id');
|
||||
const groupName =
|
||||
options.find((option) => option.value === groupId)?.label ?? groupId;
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ export const initialExtractorValues = {
|
||||
};
|
||||
|
||||
export const initialCompilationValues = {
|
||||
compilation_template_group_ids: [],
|
||||
compilation_template_group_id: '',
|
||||
outputs: {
|
||||
chunks: { type: 'Array<Object>', value: [] },
|
||||
},
|
||||
|
||||
@@ -13,7 +13,7 @@ import { FormWrapper } from '../components/form-wrapper';
|
||||
import { Output } from '../components/output';
|
||||
|
||||
export const FormSchema = z.object({
|
||||
compilation_template_group_ids: z.string().optional(),
|
||||
compilation_template_group_id: z.string().optional(),
|
||||
});
|
||||
|
||||
export type CompilationFormSchemaType = z.infer<typeof FormSchema>;
|
||||
@@ -33,7 +33,7 @@ const CompilationForm = ({ node }: INextOperatorForm) => {
|
||||
return (
|
||||
<Form {...form}>
|
||||
<FormWrapper>
|
||||
<CompilationTemplateFormField name="compilation_template_group_ids"></CompilationTemplateFormField>
|
||||
<CompilationTemplateFormField name="compilation_template_group_id"></CompilationTemplateFormField>
|
||||
<Output list={outputList}></Output>
|
||||
</FormWrapper>
|
||||
</Form>
|
||||
|
||||
Reference in New Issue
Block a user