Feat: Add a user_id field to the message and retrieval operators. (#13508)

### What problem does this PR solve?

Feat: Add a user_id field to the message and retrieval operators.

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2026-03-10 22:18:27 +08:00
committed by GitHub
parent 3c80a0ae09
commit d36e3c97d1
5 changed files with 24 additions and 1 deletions

View File

@@ -1839,6 +1839,7 @@ Example: Virtual Hosted Style`,
dbType: 'Database type',
database: 'Database',
username: 'Username',
userId: 'User id',
host: 'Host',
port: 'Port',
password: 'Password',

View File

@@ -1599,6 +1599,7 @@ General实体和关系提取提示来自 GitHub - microsoft/graphrag基于
dbType: '数据库类型',
database: '数据库',
username: '用户名',
userId: '用户 ID',
host: '主机',
port: '端口',
password: '密码',

View File

@@ -0,0 +1,13 @@
import { RAGFlowFormItem } from '@/components/ragflow-form';
import { useTranslation } from 'react-i18next';
import { PromptEditor } from './prompt-editor';
export function UserIdFormField() {
const { t } = useTranslation();
return (
<RAGFlowFormItem name="user_id" label={t('flow.userId')}>
<PromptEditor multiLine={false} showToolbar={false}></PromptEditor>
</RAGFlowFormItem>
);
}

View File

@@ -21,6 +21,7 @@ import { ExportFileType } from '../../constant';
import { INextOperatorForm } from '../../interface';
import { FormWrapper } from '../components/form-wrapper';
import { PromptEditor } from '../components/prompt-editor';
import { UserIdFormField } from '../components/user-id-form-field';
import { useShowWebhookResponseStatus } from './use-show-response-status';
import { useValues } from './use-values';
import { useWatchFormChange } from './use-watch-change';
@@ -42,6 +43,7 @@ function MessageForm({ node }: INextOperatorForm) {
auto_play: z.boolean().optional(),
status: z.number().optional(),
memory_ids: z.array(z.string()).optional(),
user_id: z.string().optional(),
});
const form = useForm({
@@ -163,6 +165,7 @@ function MessageForm({ node }: INextOperatorForm) {
</>
)}
<MemoriesFormField label={t('flow.saveToMemory')}></MemoriesFormField>
<UserIdFormField></UserIdFormField>
</FormWrapper>
</Form>
);

View File

@@ -38,6 +38,7 @@ import { INextOperatorForm } from '../../interface';
import { FormWrapper } from '../components/form-wrapper';
import { Output } from '../components/output';
import { PromptEditor } from '../components/prompt-editor';
import { UserIdFormField } from '../components/user-id-form-field';
import { useValues } from './use-values';
export const RetrievalPartialSchema = {
@@ -54,6 +55,7 @@ export const RetrievalPartialSchema = {
...MetadataFilterSchema,
memory_ids: z.array(z.string()).optional(),
retrieval_from: z.string(),
user_id: z.string().optional(),
};
export const FormSchema = z.object({
@@ -82,7 +84,10 @@ export function MemoryDatasetForm() {
</Radio.Group>
</RAGFlowFormItem>
{retrievalFrom === RetrievalFrom.Memory ? (
<MemoriesFormField label={t('header.memories')}></MemoriesFormField>
<>
<MemoriesFormField label={t('header.memories')}></MemoriesFormField>
<UserIdFormField></UserIdFormField>
</>
) : (
<KnowledgeBaseFormField showVariable></KnowledgeBaseFormField>
)}