fix: agent strategy selector show workflow

This commit is contained in:
AkaraChen 2025-01-02 14:48:40 +08:00
parent add6dff789
commit 0ed4ec5cd0
5 changed files with 10 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import classNames from '@/utils/classnames'
export const CUSTOM_GROUP_NAME = '@@@custom@@@'
export const WORKFLOW_GROUP_NAME = '@@@workflow@@@'
export const AGENT_GROUP_NAME = '@@@agent@@@'
/*
{
A: {
@ -46,8 +47,10 @@ export const groupItems = (items: ToolWithProvider[], getFirstChar: (item: ToolW
groupName = item.author
else if (item.type === CollectionType.custom)
groupName = CUSTOM_GROUP_NAME
else
else if (item.type === CollectionType.workflow)
groupName = WORKFLOW_GROUP_NAME
else
groupName = AGENT_GROUP_NAME
if (!acc[letter][groupName])
acc[letter][groupName] = []

View File

@ -6,7 +6,7 @@ import type { BlockEnum } from '../../../types'
import type { ToolDefaultValue } from '../../types'
import Item from './item'
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 = {
payload: Record<string, ToolWithProvider[]>
@ -27,6 +27,9 @@ const ToolListTreeView: FC<Props> = ({
if (name === WORKFLOW_GROUP_NAME)
return t('workflow.tabs.workflowTool')
if (name === AGENT_GROUP_NAME)
return t('workflow.tabs.agent')
return name
}, [t])

View File

@ -60,7 +60,6 @@ const Blocks = ({
Object.keys(withLetterAndGroupViewToolsData[letter]).forEach((groupName) => {
if (!result[groupName])
result[groupName] = []
result[groupName].push(...withLetterAndGroupViewToolsData[letter][groupName])
})
})

View File

@ -218,6 +218,7 @@ const translation = {
'transform': 'Transform',
'utilities': 'Utilities',
'noResult': 'No match found',
'agent': 'Agent Strategy',
},
blocks: {
'start': 'Start',

View File

@ -218,6 +218,7 @@ const translation = {
'transform': '转换',
'utilities': '工具',
'noResult': '未找到匹配项',
'agent': 'Agent 策略',
},
blocks: {
'start': '开始',