mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-29 20:19:24 +08:00
Feat: Add a "None" option for reasoning intensity in the chat message box. (#17006)
### Summary Feat: Add a "None" option for reasoning intensity in the chat message box.
This commit is contained in:
@@ -78,10 +78,27 @@ export function NextMessageInput({
|
||||
|
||||
const thinkingOptions = useMemo(
|
||||
() => [
|
||||
{ label: t('chat.thinkingLevelUltra'), value: '3' },
|
||||
{ label: t('chat.thinkingLevelHigh'), value: '2' },
|
||||
{ label: t('chat.thinkingLevelMedium'), value: '1' },
|
||||
{ label: t('chat.thinkingLevelLow'), value: '0' },
|
||||
{
|
||||
label: t('chat.thinkingLevelUltra'),
|
||||
value: '4',
|
||||
description: t('chat.thinkingLevelUltraDescription'),
|
||||
},
|
||||
{
|
||||
label: t('chat.thinkingLevelHigh'),
|
||||
value: '3',
|
||||
description: t('chat.thinkingLevelHighDescription'),
|
||||
},
|
||||
{
|
||||
label: t('chat.thinkingLevelMedium'),
|
||||
value: '2',
|
||||
description: t('chat.thinkingLevelMediumDescription'),
|
||||
},
|
||||
{
|
||||
label: t('chat.thinkingLevelLow'),
|
||||
value: '1',
|
||||
description: t('chat.thinkingLevelLowDescription'),
|
||||
},
|
||||
{ label: t('chat.thinkingLevelNone'), value: '0' },
|
||||
],
|
||||
[t],
|
||||
);
|
||||
|
||||
@@ -31,12 +31,17 @@ import { t } from 'i18next';
|
||||
import { RAGFlowSelectOptionType } from '../ui/select';
|
||||
import { Separator } from '../ui/separator';
|
||||
|
||||
export type SelectWithSearchOptionType = RAGFlowSelectOptionType & {
|
||||
description?: ReactNode;
|
||||
};
|
||||
|
||||
export type SelectWithSearchFlagOptionType = {
|
||||
label: ReactNode;
|
||||
value?: string;
|
||||
disabled?: boolean;
|
||||
options?: RAGFlowSelectOptionType[];
|
||||
options?: SelectWithSearchOptionType[];
|
||||
keywords?: string[];
|
||||
description?: ReactNode;
|
||||
};
|
||||
|
||||
export type SelectWithSearchFlagProps = {
|
||||
@@ -272,12 +277,25 @@ export const SelectWithSearch = forwardRef<
|
||||
? `${optionTestIdPrefix}${option.value}`
|
||||
: 'combobox-option'
|
||||
}
|
||||
className={value === option.value ? 'bg-bg-card' : ''}
|
||||
className={cn(
|
||||
'relative flex flex-col min-h-10',
|
||||
option.description
|
||||
? 'items-start gap-1'
|
||||
: 'justify-center items-start',
|
||||
value === option.value ? 'bg-bg-card' : '',
|
||||
)}
|
||||
>
|
||||
<span className="leading-none">{option.label}</span>
|
||||
|
||||
{option.description && (
|
||||
<span className="text-text-secondary text-xs leading-none">
|
||||
{option.description}
|
||||
</span>
|
||||
)}
|
||||
{value === option.value && (
|
||||
<CheckIcon size={16} className="ml-auto" />
|
||||
<CheckIcon
|
||||
size={16}
|
||||
className="absolute top-1/2 -translate-y-1/2 right-2"
|
||||
/>
|
||||
)}
|
||||
</CommandItem>
|
||||
))}
|
||||
@@ -299,14 +317,27 @@ export const SelectWithSearch = forwardRef<
|
||||
? `${optionTestIdPrefix}${group.value}`
|
||||
: 'combobox-option'
|
||||
}
|
||||
className={cn('mb-1 min-h-10 ', {
|
||||
'bg-bg-card ': value === group.value,
|
||||
})}
|
||||
className={cn(
|
||||
'relative flex flex-col min-h-10 mb-1',
|
||||
group.description
|
||||
? 'items-start gap-1'
|
||||
: 'justify-center items-start',
|
||||
{
|
||||
'bg-bg-card ': value === group.value,
|
||||
},
|
||||
)}
|
||||
>
|
||||
<span className="leading-none">{group.label}</span>
|
||||
|
||||
{group.description && (
|
||||
<span className="text-text-secondary text-xs leading-none">
|
||||
{group.description}
|
||||
</span>
|
||||
)}
|
||||
{value === group.value && (
|
||||
<CheckIcon size={16} className="ml-auto" />
|
||||
<CheckIcon
|
||||
size={16}
|
||||
className="absolute top-1/2 -translate-y-1/2 right-2"
|
||||
/>
|
||||
)}
|
||||
</CommandItem>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user