fix: chat model select

This commit is contained in:
archer
2025-01-25 15:06:19 +08:00
parent 383fe66cd7
commit c3d55d5c8f

View File

@@ -6,9 +6,10 @@ export const getChatModelNameListByModules = (nodes: StoreNodeItemType[]): strin
const modelList = nodes
.map((item) => {
const model = item.inputs.find((input) => input.key === NodeInputKeyEnum.aiModel)?.value;
return getLLMModel(model)?.name || '';
return model ? getLLMModel(model)?.name : '';
})
.filter(Boolean);
console.log(JSON.stringify(nodes, null, 2), '---=');
console.log(modelList, '---=');
return Array.from(new Set(modelList));
};