Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: knowledge base's embedded model form layout and dependency imports in the main branch. #9869 (#10160)

chanxa0ccbec8bd72
diff --git a/web/src/components/max-token-number-from-field.tsx b/web/src/components/max-token-number-from-field.tsx
index b01598d934..c4e07da4f6 100644
--- a/web/src/components/max-token-number-from-field.tsx
+++ b/web/src/components/max-token-number-from-field.tsx
@@ -17,7 +17,7 @@ export function MaxTokenNumberFormField({ max = 2048, initialValue }: IProps) {
tooltip={t('chunkTokenNumberTip')}
max={max}
defaultValue={initialValue ?? 0}
- layout={FormLayout.Horizontal}
+ layout={FormLayout.Vertical}
></SliderInputFormField>
);
}
diff --git a/web/src/components/slider-input-form-field.tsx b/web/src/components/slider-input-form-field.tsx
index c314081921..c91007f221 100644
--- a/web/src/components/slider-input-form-field.tsx
+++ b/web/src/components/slider-input-form-field.tsx
@@ -1,6 +1,6 @@
import { FormLayout } from '@/constants/form';
import { cn } from '@/lib/utils';
-import { ReactNode } from 'react';
+import { ReactNode, useMemo } from 'react';
import { useFormContext } from 'react-hook-form';
import { SingleFormSlider } from './ui/dual-range-slider';
import {
@@ -40,7 +40,7 @@ export function SliderInputFormField({
}: SliderInputFormFieldProps) {
const form = useFormContext();
- const isHorizontal = layout === FormLayout.Horizontal;
+ const isHorizontal = useMemo(() => layout === FormLayout.Vertical, [layout]);
return (
<FormField
diff --git a/web/src/pages/dataset/setting/configuration/common-item.tsx b/web/src/pages/dataset/setting/configuration/common-item.tsx
index 12496183d8..1ee6a8ad6c 100644
--- a/web/src/pages/dataset/setting/configuration/common-item.tsx
+++ b/web/src/pages/dataset/setting/configuration/common-item.tsx
@@ -70,16 +70,15 @@ export function EmbeddingModelItem() {
name={'embd_id'}
render={({ field }) => (
<FormItem className=" items-center space-y-0 ">
- <div className="">
+ <div className="flex items-center">
<FormLabel
required
tooltip={t('embeddingModelTip')}
- className="text-sm whitespace-wrap "
+ className="text-sm whitespace-wrap w-1/4"
>
- <span className="text-destructive mr-1"> *</span>
{t('embeddingModel')}
</FormLabel>
- <div className="text-muted-foreground">
+ <div className="text-muted-foreground w-3/4">
<FormControl>
<RAGFlowSelect
{...field}