feat: hide run detail in webapps and installed apps (#4289)
This commit is contained in:
@@ -146,7 +146,7 @@ const ConfigPrompt: FC<Props> = ({
|
||||
<ReactSortable className="space-y-1"
|
||||
list={payloadWithIds}
|
||||
setList={(list) => {
|
||||
if ((payload as PromptItem[])?.[0].role === PromptRole.system && list[0].p.role !== PromptRole.system)
|
||||
if ((payload as PromptItem[])?.[0].role === PromptRole.system && list[0].p?.role !== PromptRole.system)
|
||||
return
|
||||
|
||||
onChange(list.map(item => item.p))
|
||||
|
@@ -44,7 +44,14 @@ const nodeDefault: NodeDefault<LLMNodeType> = {
|
||||
|
||||
if (!errorMessages && !payload.memory) {
|
||||
const isChatModel = payload.model.mode === 'chat'
|
||||
const isPromptyEmpty = isChatModel ? !(payload.prompt_template as PromptItem[]).some(t => t.text !== '') : (payload.prompt_template as PromptItem).text === ''
|
||||
const isPromptyEmpty = isChatModel
|
||||
? !(payload.prompt_template as PromptItem[]).some((t) => {
|
||||
if (t.edition_type === EditionType.jinja2)
|
||||
return t.jinja2_text !== ''
|
||||
|
||||
return t.text !== ''
|
||||
})
|
||||
: ((payload.prompt_template as PromptItem).edition_type === EditionType.jinja2 ? (payload.prompt_template as PromptItem).jinja2_text === '' : (payload.prompt_template as PromptItem).text === '')
|
||||
if (isPromptyEmpty)
|
||||
errorMessages = t(`${i18nPrefix}.fieldRequired`, { field: t('workflow.nodes.llm.prompt') })
|
||||
}
|
||||
|
Reference in New Issue
Block a user