diff --git a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx index d7fa0215bd..2f97f6f19b 100644 --- a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx +++ b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx @@ -56,7 +56,7 @@ const Editor: FC = ({ return (
-
+
{title}
diff --git a/web/app/components/workflow/nodes/_base/components/selector.tsx b/web/app/components/workflow/nodes/_base/components/selector.tsx index 12ba7d31db..2cf7a5720b 100644 --- a/web/app/components/workflow/nodes/_base/components/selector.tsx +++ b/web/app/components/workflow/nodes/_base/components/selector.tsx @@ -16,6 +16,7 @@ type Props = { onChange: (value: any) => void uppercase?: boolean popupClassName?: string + triggerClassName?: string itemClassName?: string readonly?: boolean showChecked?: boolean @@ -27,6 +28,7 @@ const TypeSelector: FC = ({ value, onChange, uppercase, + triggerClassName, popupClassName, itemClassName, readonly, @@ -52,7 +54,7 @@ const TypeSelector: FC = ({
-
{item?.label}
+
{item?.label}
)} diff --git a/web/app/components/workflow/nodes/llm/components/config-prompt.tsx b/web/app/components/workflow/nodes/llm/components/config-prompt.tsx index 19371d6116..7593a38a3e 100644 --- a/web/app/components/workflow/nodes/llm/components/config-prompt.tsx +++ b/web/app/components/workflow/nodes/llm/components/config-prompt.tsx @@ -8,6 +8,8 @@ import { PromptRole } from '../../../types' import Editor from '@/app/components/workflow/nodes/_base/components/prompt/editor' import AddButton from '@/app/components/workflow/nodes/_base/components/add-button' import TypeSelector from '@/app/components/workflow/nodes/_base/components/selector' +import TooltipPlus from '@/app/components/base/tooltip-plus' +import { HelpCircle } from '@/app/components/base/icons/src/vender/line/general' const i18nPrefix = 'workflow.nodes.llm' @@ -38,13 +40,17 @@ const ConfigPrompt: FC = ({ }, [onChange, payload]) const roleOptions = [ + { + label: 'system', + value: PromptRole.system, + }, { label: 'user', value: PromptRole.user, }, { - label: 'system', - value: PromptRole.system, + label: 'assistant', + value: PromptRole.assistant, }, ] @@ -60,7 +66,7 @@ const ConfigPrompt: FC = ({ const handleAddPrompt = useCallback(() => { const newPrompt = produce(payload as PromptItem[], (draft) => { const isLastItemUser = draft[draft.length - 1].role === PromptRole.user - draft.push({ role: isLastItemUser ? PromptRole.system : PromptRole.user, text: '' }) + draft.push({ role: isLastItemUser ? PromptRole.assistant : PromptRole.user, text: '' }) }) onChange(newPrompt) }, [onChange, payload]) @@ -93,12 +99,21 @@ const ConfigPrompt: FC = ({ +
+ {t(`${i18nPrefix}.roleDescription`)}
+ } + > + +
} value={item.text} diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts index 27bf73e4ef..961dd4a0c8 100644 --- a/web/i18n/en-US/workflow.ts +++ b/web/i18n/en-US/workflow.ts @@ -97,6 +97,7 @@ const translation = { context: 'context', contextTooltip: 'You can import Knowledge as context', prompt: 'prompt', + roleDescription: 'TODO: Role Description', addMessage: 'Add Message', vision: 'vision', resolution: { diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts index 9c405dc538..93ec1562a8 100644 --- a/web/i18n/zh-Hans/workflow.ts +++ b/web/i18n/zh-Hans/workflow.ts @@ -98,6 +98,7 @@ const translation = { contextTooltip: '您可以导入知识库作为上下文', prompt: '提示词', addMessage: '添加消息', + roleDescription: 'TODO: Role Description', vision: '视觉', resolution: { name: '分辨率',