mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
fix: agent show
This commit is contained in:
parent
0729813588
commit
a838a5862b
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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'}
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
? [
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ type FormType = {
|
|||
};
|
||||
|
||||
export type CreateAppType =
|
||||
| AppTypeEnum.agent
|
||||
| AppTypeEnum.simple
|
||||
| AppTypeEnum.workflow
|
||||
| AppTypeEnum.workflowTool
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue