mirror of
https://github.com/langgenius/dify.git
synced 2026-01-06 06:26:00 +00:00
feat: memory example
This commit is contained in:
@@ -18,6 +18,8 @@ import { InputVarType, type NodePanelProps } from '@/app/components/workflow/typ
|
||||
import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form'
|
||||
import type { Props as FormProps } from '@/app/components/workflow/nodes/_base/components/before-run-form/form'
|
||||
import ResultPanel from '@/app/components/workflow/run/result-panel'
|
||||
import TooltipPlus from '@/app/components/base/tooltip-plus'
|
||||
import { HelpCircle } from '@/app/components/base/icons/src/vender/line/general'
|
||||
|
||||
const i18nPrefix = 'workflow.nodes.llm'
|
||||
|
||||
@@ -178,13 +180,28 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Memory put place examples. Wait for design */}
|
||||
{/* {isChatModel && (
|
||||
<div className='text-xs text-gray-300'>Memory examples(Designing)</div>
|
||||
)} */}
|
||||
{/* Memory put place examples. */}
|
||||
{isChatMode && isChatModel && !!inputs.memory && (
|
||||
<div className='mt-4'>
|
||||
<div className='flex justify-between items-center h-8 pl-3 pr-2 rounded-lg bg-gray-100'>
|
||||
<div className='flex items-center space-x-1'>
|
||||
<div className='text-xs font-semibold text-gray-700 uppercase'>{t('workflow.nodes.common.memories.title')}</div>
|
||||
<TooltipPlus
|
||||
popupContent={t('workflow.nodes.common.memories.tip')}
|
||||
>
|
||||
<HelpCircle className='w-3.5 h-3.5 text-gray-400' />
|
||||
</TooltipPlus>
|
||||
</div>
|
||||
<div className='h-[18px] leading-[18px] px-1 rounded-[5px] border border-black/8 text-xs font-semibold text-gray-500 uppercase'>{t('workflow.nodes.common.memories.builtIn')}</div>
|
||||
</div>
|
||||
{/* TODO: user query editor */}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Memory */}
|
||||
{isChatMode && (
|
||||
{isChatMode && isChatModel && (
|
||||
<>
|
||||
<Split />
|
||||
<MemoryConfig
|
||||
readonly={readOnly}
|
||||
config={{ data: inputs.memory }}
|
||||
|
||||
@@ -124,6 +124,11 @@ const translation = {
|
||||
user: 'User prefix',
|
||||
assistant: 'Assistant prefix',
|
||||
},
|
||||
memories: {
|
||||
title: 'Memories',
|
||||
tip: 'Chat memory',
|
||||
builtIn: 'Built-in',
|
||||
},
|
||||
},
|
||||
start: {
|
||||
required: 'required',
|
||||
|
||||
@@ -124,6 +124,11 @@ const translation = {
|
||||
user: '用户前缀',
|
||||
assistant: '助手前缀',
|
||||
},
|
||||
memories: {
|
||||
title: '记忆',
|
||||
tip: '聊天记忆',
|
||||
builtIn: '内置',
|
||||
},
|
||||
},
|
||||
start: {
|
||||
required: '必填',
|
||||
|
||||
Reference in New Issue
Block a user