diff --git a/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx b/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx index f4e23b566b..abad9479ee 100644 --- a/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx +++ b/web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx @@ -77,6 +77,7 @@ const Form: FC = ({ provider: model.provider, model: model.modelId, mode: model.mode, + type: FormTypeEnum.modelSelector, } onChange({ ...value, [key]: newValue }) }, [onChange, value]) @@ -286,7 +287,6 @@ const Form: FC = ({ label, required, } = formSchema as (CredentialFormSchemaTextInput | CredentialFormSchemaSecretInput) - return (
@@ -303,7 +303,7 @@ const Form: FC = ({ isAdvancedMode isInWorkflow provider={value[variable]?.provider} - modelId={value[variable]?.name} + modelId={value[variable]?.model} mode={value[variable]?.mode} completionParams={value[variable]?.completion_params} setModel={model => handleModelChanged(variable, model)} @@ -368,7 +368,7 @@ const Form: FC = ({ handleFormChange(variable, item as any)} + onSelect={item => handleFormChange(variable, { ...item, type: FormTypeEnum.appSelector } as any)} /> {fieldMoreInfo?.(formSchema)} {validating && changeKey === variable && } diff --git a/web/app/components/workflow/nodes/tool/node.tsx b/web/app/components/workflow/nodes/tool/node.tsx index 4de03394c3..d7ed993aab 100644 --- a/web/app/components/workflow/nodes/tool/node.tsx +++ b/web/app/components/workflow/nodes/tool/node.tsx @@ -2,6 +2,7 @@ import type { FC } from 'react' import React from 'react' import type { ToolNodeType } from './types' import type { NodeProps } from '@/app/components/workflow/types' +import { FormTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations' const Node: FC> = ({ data, @@ -20,9 +21,21 @@ const Node: FC> = ({
{key}
-
- {tool_configurations[key]} -
+ {typeof tool_configurations[key] === 'string' && ( +
+ {tool_configurations[key]} +
+ )} + {typeof tool_configurations[key] !== 'string' && tool_configurations[key]?.type === FormTypeEnum.modelSelector && ( +
+ {tool_configurations[key].model} +
+ )} + {/* {typeof tool_configurations[key] !== 'string' && tool_configurations[key]?.type === FormTypeEnum.appSelector && ( +
+ {tool_configurations[key].app_id} +
+ )} */}
))}