fix: agent show

This commit is contained in:
archer 2025-11-11 15:56:26 +08:00
parent 0729813588
commit a838a5862b
No known key found for this signature in database
GPG Key ID: 4446499B846D4A9E
5 changed files with 20 additions and 4 deletions

View File

@ -2,6 +2,14 @@ import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
import { i18nT } from '@fastgpt/web/i18n/utils';
export const createAppTypeMap = {
[AppTypeEnum.agent]: {
type: AppTypeEnum.agent,
icon: 'core/app/type/workflowFill',
title: 'Agent',
intro: 'Agent',
description: 'Agent',
imgUrl: '/imgs/app/workflowPreview.svg'
},
[AppTypeEnum.workflow]: {
type: AppTypeEnum.workflow,
icon: 'core/app/type/workflowFill',

View File

@ -40,12 +40,11 @@ const AppTypeTag = ({ type }: { type: AppTypeEnum }) => {
},
[AppTypeEnum.tool]: undefined,
[AppTypeEnum.folder]: undefined,
[AppTypeEnum.hidden]: undefined,
[AppTypeEnum.agent]: undefined
[AppTypeEnum.hidden]: undefined
});
const data = map.current[type as keyof typeof map.current];
console.log(type, data);
return data ? (
<Flex
bg={'myGray.100'}

View File

@ -75,7 +75,7 @@ const AppListContextProvider = ({ children }: { children: ReactNode }) => {
const isAgent = router.pathname.includes('/agent');
const formatType = isAgent
? !type || type === 'all'
? [AppTypeEnum.folder, AppTypeEnum.simple, AppTypeEnum.workflow]
? [AppTypeEnum.folder, AppTypeEnum.simple, AppTypeEnum.workflow, AppTypeEnum.agent]
: [AppTypeEnum.folder, type]
: !type || type === 'all'
? [

View File

@ -57,6 +57,7 @@ type FormType = {
};
export type CreateAppType =
| AppTypeEnum.agent
| AppTypeEnum.simple
| AppTypeEnum.workflow
| AppTypeEnum.workflowTool

View File

@ -13,7 +13,15 @@ import {
} from '@fastgpt/global/core/workflow/type/io';
import { i18nT } from '@fastgpt/web/i18n/utils';
// TODO: 需要做一个类型强制约束
export const emptyTemplates = {
[AppTypeEnum.agent]: {
avatar: 'core/app/type/simpleFill',
name: 'Agent',
nodes: [],
edges: [],
chatConfig: {}
},
[AppTypeEnum.simple]: {
avatar: 'core/app/type/simpleFill',
name: i18nT('app:template.simple_robot'),