From 87c9a054d3086179b04cfe0b5e1fda0aec8be5be Mon Sep 17 00:00:00 2001 From: balibabu Date: Wed, 5 Nov 2025 20:04:23 +0800 Subject: [PATCH] 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) --- web/src/pages/agent/constant/index.tsx | 5 +---- web/src/pages/agent/form/components/query-variable.tsx | 6 ++++-- .../pages/agent/form/data-operations-form/filter-values.tsx | 3 ++- .../pages/agent/form/data-operations-form/select-keys.tsx | 4 ++-- web/src/pages/agent/form/data-operations-form/updates.tsx | 3 ++- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/web/src/pages/agent/constant/index.tsx b/web/src/pages/agent/constant/index.tsx index 5470bb7c7..3abe3ca2c 100644 --- a/web/src/pages/agent/constant/index.tsx +++ b/web/src/pages/agent/constant/index.tsx @@ -594,10 +594,7 @@ export const initialAgentValues = { type: 'string', value: '', }, - [AgentStructuredOutputField]: { - type: 'Object Array String Number Boolean', - value: '', - }, + [AgentStructuredOutputField]: {}, }, }; diff --git a/web/src/pages/agent/form/components/query-variable.tsx b/web/src/pages/agent/form/components/query-variable.tsx index d315283c0..08efb94ca 100644 --- a/web/src/pages/agent/form/components/query-variable.tsx +++ b/web/src/pages/agent/form/components/query-variable.tsx @@ -38,8 +38,10 @@ export function QueryVariable({ ? nextOptions.map((x) => { return { ...x, - options: x.options.filter((y) => - types?.some((x) => toLower(y.type).includes(x)), + options: x.options.filter( + (y) => + types?.some((x) => toLower(y.type).includes(x)) || + y.type === undefined, // agent structured output ), }; }) diff --git a/web/src/pages/agent/form/data-operations-form/filter-values.tsx b/web/src/pages/agent/form/data-operations-form/filter-values.tsx index fca49f5ef..72a80cb09 100644 --- a/web/src/pages/agent/form/data-operations-form/filter-values.tsx +++ b/web/src/pages/agent/form/data-operations-form/filter-values.tsx @@ -9,6 +9,7 @@ import { ReactNode } from 'react'; import { useFieldArray, useFormContext } from 'react-hook-form'; import { DataOperationsOperatorOptions } from '../../constant'; import { DynamicFormHeader } from '../components/dynamic-fom-header'; +import { PromptEditor } from '../components/prompt-editor'; type SelectKeysProps = { name: string; @@ -67,7 +68,7 @@ export function FilterValues({ - +