Feat: Let system variables appear in operator prompts #3221 (#8154)

### What problem does this PR solve?
Feat: Let system variables appear in operator prompts #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-06-10 17:06:30 +08:00
committed by GitHub
parent 3a34def55f
commit c5e4684b44
17 changed files with 105 additions and 82 deletions

View File

@ -1,4 +0,0 @@
export enum PromptRole {
User = 'user',
Assistant = 'assistant',
}

View File

@ -11,8 +11,8 @@ import { X } from 'lucide-react';
import { memo } from 'react';
import { useFieldArray, useFormContext } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import { PromptRole } from '../../constant';
import { PromptEditor } from '../components/prompt-editor';
import { PromptRole } from './constant';
const options = [
{ label: 'User', value: PromptRole.User },

View File

@ -1,7 +1,7 @@
import { useEffect } from 'react';
import { UseFormReturn, useWatch } from 'react-hook-form';
import { PromptRole } from '../../constant';
import useGraphStore from '../../store';
import { PromptRole } from './constant';
export function useWatchFormChange(id?: string, form?: UseFormReturn) {
let values = useWatch({ control: form?.control });