From 1c44fb77afc4e59a48fa90532922b11d89ae7b64 Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 10 Jun 2025 14:13:38 +0800 Subject: [PATCH] feat: can show schema tooltip --- .../model-provider-page/declarations.ts | 4 ++++ .../components/workflow/nodes/agent/panel.tsx | 1 - .../nodes/tool/components/tool-form/item.tsx | 22 ++++++++++++++----- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/web/app/components/header/account-setting/model-provider-page/declarations.ts b/web/app/components/header/account-setting/model-provider-page/declarations.ts index 4da734361b..eec40797bd 100644 --- a/web/app/components/header/account-setting/model-provider-page/declarations.ts +++ b/web/app/components/header/account-setting/model-provider-page/declarations.ts @@ -1,3 +1,5 @@ +import type { SchemaRoot } from '@/app/components/workflow/nodes/llm/types' + export type FormValue = Record export type TypeWithI18N = { @@ -109,6 +111,7 @@ export type FormShowOnObject = { } export type CredentialFormSchemaBase = { + name: string variable: string label: TypeWithI18N type: FormTypeEnum @@ -118,6 +121,7 @@ export type CredentialFormSchemaBase = { show_on: FormShowOnObject[] url?: string scope?: string + input_schema?: SchemaRoot } export type CredentialFormSchemaTextInput = CredentialFormSchemaBase & { diff --git a/web/app/components/workflow/nodes/agent/panel.tsx b/web/app/components/workflow/nodes/agent/panel.tsx index 4dc2d40a03..a2f5afb276 100644 --- a/web/app/components/workflow/nodes/agent/panel.tsx +++ b/web/app/components/workflow/nodes/agent/panel.tsx @@ -80,7 +80,6 @@ const AgentPanel: FC> = (props) => { })() const resetEditor = useStore(s => s.setControlPromptEditorRerenderKey) - console.log(canChooseMCPTool) return
= ({ onChange, }) => { const language = useLanguage() - const { label, type, required, tooltip } = schema + const { name, label, type, required, tooltip, input_schema } = schema const showSchemaButton = type === FormTypeEnum.object || type === FormTypeEnum.array const showDescription = type === FormTypeEnum.textInput || type === FormTypeEnum.secretInput - + const [isShowSchema, { + setTrue: showSchema, + setFalse: hideSchema, + }] = useBoolean(false) return (
@@ -54,9 +59,7 @@ const ToolFormItem: FC = ({
) }