Feat: Add memory multi-select dropdown to recall and message operator forms. #4213 (#12106)

### What problem does this PR solve?

Feat: Add memory multi-select dropdown to recall and message operator
forms. #4213

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-12-23 11:54:32 +08:00
committed by GitHub
parent 712d537d66
commit 9e31631d8f
10 changed files with 95 additions and 13 deletions

View File

@ -0,0 +1,33 @@
import { useFetchAllMemoryList } from '@/hooks/use-memory-request';
import { useTranslation } from 'react-i18next';
import { RAGFlowFormItem } from './ragflow-form';
import { MultiSelect } from './ui/multi-select';
type MemoriesFormFieldProps = {
label: string;
};
export function MemoriesFormField({ label }: MemoriesFormFieldProps) {
const { t } = useTranslation();
const memoryList = useFetchAllMemoryList();
const options = memoryList.data?.map((memory) => ({
label: memory.name,
value: memory.id,
}));
return (
<RAGFlowFormItem name="memory_ids" label={label}>
{(field) => (
<MultiSelect
options={options || []}
placeholder={t('common.pleaseSelect')}
maxCount={100}
onValueChange={field.onChange}
defaultValue={field.value}
modalPopover
/>
)}
</RAGFlowFormItem>
);
}