This commit is contained in:
Archer
2024-05-28 16:55:06 +08:00
committed by GitHub
parent 9639139b52
commit 8ba8488086
13 changed files with 152 additions and 86 deletions

View File

@@ -1,11 +1,10 @@
import { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
import { NodeInputKeyEnum } from '@fastgpt/global/core/workflow/constants';
import type { StoreNodeItemType } from '@fastgpt/global/core/workflow/type/index.d';
export const getChatModelNameListByModules = (modules: StoreNodeItemType[]): string[] => {
const chatModules = modules.filter((item) => item.flowNodeType === FlowNodeTypeEnum.chatNode);
return chatModules
export const getChatModelNameListByModules = (nodes: StoreNodeItemType[]): string[] => {
return nodes
.map((item) => {
const model = item.inputs.find((input) => input.key === 'model')?.value;
const model = item.inputs.find((input) => input.key === NodeInputKeyEnum.aiModel)?.value;
return global.llmModels.find((item) => item.model === model)?.name || '';
})
.filter(Boolean);