feat: Introduce RAG tool recommendations and refactor related components for improved plugin management (#27259)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -75,6 +75,7 @@ import { DataSourceClassification } from '@/app/components/workflow/nodes/data-s
|
||||
import { useModalContext } from '@/context/modal-context'
|
||||
import DataSourceBeforeRunForm from '@/app/components/workflow/nodes/data-source/before-run-form'
|
||||
import useInspectVarsCrud from '@/app/components/workflow/hooks/use-inspect-vars-crud'
|
||||
import { useAllBuiltInTools } from '@/service/use-tools'
|
||||
|
||||
const getCustomRunForm = (params: CustomRunFormProps): React.JSX.Element => {
|
||||
const nodeType = params.payload.type
|
||||
@@ -259,9 +260,9 @@ const BasePanel: FC<BasePanelProps> = ({
|
||||
return {}
|
||||
})()
|
||||
|
||||
const buildInTools = useStore(s => s.buildInTools)
|
||||
const { data: buildInTools } = useAllBuiltInTools()
|
||||
const currCollection = useMemo(() => {
|
||||
return buildInTools.find(item => canFindTool(item.id, data.provider_id))
|
||||
return buildInTools?.find(item => canFindTool(item.id, data.provider_id))
|
||||
}, [buildInTools, data.provider_id])
|
||||
const showPluginAuth = useMemo(() => {
|
||||
return data.type === BlockEnum.Tool && currCollection?.allow_delete
|
||||
@@ -450,6 +451,7 @@ const BasePanel: FC<BasePanelProps> = ({
|
||||
className='px-4 pb-2'
|
||||
pluginPayload={{
|
||||
provider: currCollection?.name || '',
|
||||
providerType: currCollection?.type || '',
|
||||
category: AuthCategory.tool,
|
||||
}}
|
||||
>
|
||||
@@ -461,6 +463,7 @@ const BasePanel: FC<BasePanelProps> = ({
|
||||
<AuthorizedInNode
|
||||
pluginPayload={{
|
||||
provider: currCollection?.name || '',
|
||||
providerType: currCollection?.type || '',
|
||||
category: AuthCategory.tool,
|
||||
}}
|
||||
onAuthorizationItemClick={handleAuthorizationItemClick}
|
||||
|
||||
Reference in New Issue
Block a user