Feat: The value of data operations operators can be either input or referenced from variables. #10427 (#11037)

### What problem does this PR solve?

Feat: The value of data operations operators can be either input or
referenced from variables. #10427

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-11-05 20:04:23 +08:00
committed by GitHub
parent cd6ed4b380
commit 87c9a054d3
5 changed files with 11 additions and 10 deletions

View File

@ -594,10 +594,7 @@ export const initialAgentValues = {
type: 'string', type: 'string',
value: '', value: '',
}, },
[AgentStructuredOutputField]: { [AgentStructuredOutputField]: {},
type: 'Object Array String Number Boolean',
value: '',
},
}, },
}; };

View File

@ -38,8 +38,10 @@ export function QueryVariable({
? nextOptions.map((x) => { ? nextOptions.map((x) => {
return { return {
...x, ...x,
options: x.options.filter((y) => options: x.options.filter(
types?.some((x) => toLower(y.type).includes(x)), (y) =>
types?.some((x) => toLower(y.type).includes(x)) ||
y.type === undefined, // agent structured output
), ),
}; };
}) })

View File

@ -9,6 +9,7 @@ import { ReactNode } from 'react';
import { useFieldArray, useFormContext } from 'react-hook-form'; import { useFieldArray, useFormContext } from 'react-hook-form';
import { DataOperationsOperatorOptions } from '../../constant'; import { DataOperationsOperatorOptions } from '../../constant';
import { DynamicFormHeader } from '../components/dynamic-fom-header'; import { DynamicFormHeader } from '../components/dynamic-fom-header';
import { PromptEditor } from '../components/prompt-editor';
type SelectKeysProps = { type SelectKeysProps = {
name: string; name: string;
@ -67,7 +68,7 @@ export function FilterValues({
<Separator className="w-2" /> <Separator className="w-2" />
<RAGFlowFormItem name={valueFieldAlias} className="flex-1"> <RAGFlowFormItem name={valueFieldAlias} className="flex-1">
<Input></Input> <PromptEditor showToolbar={false} multiLine={false} />
</RAGFlowFormItem> </RAGFlowFormItem>
<Button variant={'ghost'} onClick={() => remove(index)}> <Button variant={'ghost'} onClick={() => remove(index)}>
<X /> <X />

View File

@ -1,10 +1,10 @@
import { RAGFlowFormItem } from '@/components/ragflow-form'; import { RAGFlowFormItem } from '@/components/ragflow-form';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { X } from 'lucide-react'; import { X } from 'lucide-react';
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { useFieldArray, useFormContext } from 'react-hook-form'; import { useFieldArray, useFormContext } from 'react-hook-form';
import { DynamicFormHeader } from '../components/dynamic-fom-header'; import { DynamicFormHeader } from '../components/dynamic-fom-header';
import { PromptEditor } from '../components/prompt-editor';
type SelectKeysProps = { type SelectKeysProps = {
name: string; name: string;
@ -33,7 +33,7 @@ export function SelectKeys({ name, label, tooltip }: SelectKeysProps) {
return ( return (
<div key={field.id} className="flex items-center gap-2"> <div key={field.id} className="flex items-center gap-2">
<RAGFlowFormItem name={nameField} className="flex-1"> <RAGFlowFormItem name={nameField} className="flex-1">
<Input></Input> <PromptEditor showToolbar={false} multiLine={false} />
</RAGFlowFormItem> </RAGFlowFormItem>
<Button variant={'ghost'} onClick={() => remove(index)}> <Button variant={'ghost'} onClick={() => remove(index)}>
<X /> <X />

View File

@ -6,6 +6,7 @@ import { X } from 'lucide-react';
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { useFieldArray, useFormContext } from 'react-hook-form'; import { useFieldArray, useFormContext } from 'react-hook-form';
import { DynamicFormHeader } from '../components/dynamic-fom-header'; import { DynamicFormHeader } from '../components/dynamic-fom-header';
import { PromptEditor } from '../components/prompt-editor';
type SelectKeysProps = { type SelectKeysProps = {
name: string; name: string;
@ -47,7 +48,7 @@ export function Updates({
</RAGFlowFormItem> </RAGFlowFormItem>
<Separator className="w-2" /> <Separator className="w-2" />
<RAGFlowFormItem name={valueFieldAlias} className="flex-1"> <RAGFlowFormItem name={valueFieldAlias} className="flex-1">
<Input></Input> <PromptEditor showToolbar={false} multiLine={false} />
</RAGFlowFormItem> </RAGFlowFormItem>
<Button variant={'ghost'} onClick={() => remove(index)}> <Button variant={'ghost'} onClick={() => remove(index)}>
<X /> <X />