Feat: Enables the message operator form to reference the data defined by the begin operator #3221 (#8108)

### What problem does this PR solve?

Feat: Enables the message operator form to reference the data defined by
the begin operator #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-06-06 17:54:59 +08:00
committed by GitHub
parent 1885a4a4b8
commit 0bc1f45634
30 changed files with 800 additions and 62 deletions

View File

@ -2,7 +2,6 @@ import { FormContainer } from '@/components/form-container';
import { LargeModelFormField } from '@/components/large-model-form-field';
import { LlmSettingSchema } from '@/components/llm-setting-items/next';
import { MessageHistoryWindowSizeFormField } from '@/components/message-history-window-size-item';
import { PromptEditor } from '@/components/prompt-editor';
import {
Form,
FormControl,
@ -12,6 +11,7 @@ import {
} from '@/components/ui/form';
import { useFetchModelId } from '@/hooks/logic-hooks';
import { zodResolver } from '@hookform/resolvers/zod';
import { useMemo } from 'react';
import { useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import { z } from 'zod';
@ -19,6 +19,8 @@ import { initialAgentValues } from '../../constant';
import { useFormValues } from '../../hooks/use-form-values';
import { useWatchFormChange } from '../../hooks/use-watch-form-change';
import { INextOperatorForm } from '../../interface';
import { Output } from '../components/output';
import { PromptEditor } from '../components/prompt-editor';
import DynamicPrompt from './dynamic-prompt';
const FormSchema = z.object({
@ -50,6 +52,12 @@ const AgentForm = ({ node }: INextOperatorForm) => {
node,
);
const outputList = useMemo(() => {
return [
{ title: 'content', type: initialAgentValues.outputs.content.type },
];
}, []);
const form = useForm({
defaultValues: defaultValues,
resolver: zodResolver(FormSchema),
@ -88,6 +96,7 @@ const AgentForm = ({ node }: INextOperatorForm) => {
<FormContainer>
<DynamicPrompt></DynamicPrompt>
</FormContainer>
<Output list={outputList}></Output>
</form>
</Form>
);