mirror of
https://github.com/langgenius/dify.git
synced 2026-04-26 10:16:40 +08:00
fix: agent strategy selector show workflow
This commit is contained in:
parent
add6dff789
commit
0ed4ec5cd0
@ -6,6 +6,7 @@ import classNames from '@/utils/classnames'
|
|||||||
|
|
||||||
export const CUSTOM_GROUP_NAME = '@@@custom@@@'
|
export const CUSTOM_GROUP_NAME = '@@@custom@@@'
|
||||||
export const WORKFLOW_GROUP_NAME = '@@@workflow@@@'
|
export const WORKFLOW_GROUP_NAME = '@@@workflow@@@'
|
||||||
|
export const AGENT_GROUP_NAME = '@@@agent@@@'
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
A: {
|
A: {
|
||||||
@ -46,8 +47,10 @@ export const groupItems = (items: ToolWithProvider[], getFirstChar: (item: ToolW
|
|||||||
groupName = item.author
|
groupName = item.author
|
||||||
else if (item.type === CollectionType.custom)
|
else if (item.type === CollectionType.custom)
|
||||||
groupName = CUSTOM_GROUP_NAME
|
groupName = CUSTOM_GROUP_NAME
|
||||||
else
|
else if (item.type === CollectionType.workflow)
|
||||||
groupName = WORKFLOW_GROUP_NAME
|
groupName = WORKFLOW_GROUP_NAME
|
||||||
|
else
|
||||||
|
groupName = AGENT_GROUP_NAME
|
||||||
|
|
||||||
if (!acc[letter][groupName])
|
if (!acc[letter][groupName])
|
||||||
acc[letter][groupName] = []
|
acc[letter][groupName] = []
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import type { BlockEnum } from '../../../types'
|
|||||||
import type { ToolDefaultValue } from '../../types'
|
import type { ToolDefaultValue } from '../../types'
|
||||||
import Item from './item'
|
import Item from './item'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { CUSTOM_GROUP_NAME, WORKFLOW_GROUP_NAME } from '../../index-bar'
|
import { AGENT_GROUP_NAME, CUSTOM_GROUP_NAME, WORKFLOW_GROUP_NAME } from '../../index-bar'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
payload: Record<string, ToolWithProvider[]>
|
payload: Record<string, ToolWithProvider[]>
|
||||||
@ -27,6 +27,9 @@ const ToolListTreeView: FC<Props> = ({
|
|||||||
if (name === WORKFLOW_GROUP_NAME)
|
if (name === WORKFLOW_GROUP_NAME)
|
||||||
return t('workflow.tabs.workflowTool')
|
return t('workflow.tabs.workflowTool')
|
||||||
|
|
||||||
|
if (name === AGENT_GROUP_NAME)
|
||||||
|
return t('workflow.tabs.agent')
|
||||||
|
|
||||||
return name
|
return name
|
||||||
}, [t])
|
}, [t])
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,6 @@ const Blocks = ({
|
|||||||
Object.keys(withLetterAndGroupViewToolsData[letter]).forEach((groupName) => {
|
Object.keys(withLetterAndGroupViewToolsData[letter]).forEach((groupName) => {
|
||||||
if (!result[groupName])
|
if (!result[groupName])
|
||||||
result[groupName] = []
|
result[groupName] = []
|
||||||
|
|
||||||
result[groupName].push(...withLetterAndGroupViewToolsData[letter][groupName])
|
result[groupName].push(...withLetterAndGroupViewToolsData[letter][groupName])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -218,6 +218,7 @@ const translation = {
|
|||||||
'transform': 'Transform',
|
'transform': 'Transform',
|
||||||
'utilities': 'Utilities',
|
'utilities': 'Utilities',
|
||||||
'noResult': 'No match found',
|
'noResult': 'No match found',
|
||||||
|
'agent': 'Agent Strategy',
|
||||||
},
|
},
|
||||||
blocks: {
|
blocks: {
|
||||||
'start': 'Start',
|
'start': 'Start',
|
||||||
|
|||||||
@ -218,6 +218,7 @@ const translation = {
|
|||||||
'transform': '转换',
|
'transform': '转换',
|
||||||
'utilities': '工具',
|
'utilities': '工具',
|
||||||
'noResult': '未找到匹配项',
|
'noResult': '未找到匹配项',
|
||||||
|
'agent': 'Agent 策略',
|
||||||
},
|
},
|
||||||
blocks: {
|
blocks: {
|
||||||
'start': '开始',
|
'start': '开始',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user