knowledge base node

This commit is contained in:
zxhlyh 2025-05-30 15:45:21 +08:00
parent e1d658b482
commit 6fe473f0fa
2 changed files with 1 additions and 29 deletions

View File

@ -16,7 +16,7 @@ import { useNodes } from 'reactflow'
import type { DataSourceNodeType } from '@/app/components/workflow/nodes/data-source/types'
import { useTranslation } from 'react-i18next'
import produce from 'immer'
import { useNodesSyncDraft } from '../../hooks'
import { useNodesSyncDraft } from '@/app/components/workflow/hooks'
import type { InputVar, RAGPipelineVariables } from '@/models/pipeline'
type InputFieldDialogProps = {

View File

@ -1,13 +1,10 @@
import {
useCallback,
useEffect,
} from 'react'
import { produce } from 'immer'
import { useStoreApi } from 'reactflow'
import { useNodeDataUpdate } from '@/app/components/workflow/hooks'
import type { ValueSelector } from '@/app/components/workflow/types'
import { useModelListAndDefaultModelAndCurrentProviderAndModel } from '@/app/components/header/account-setting/model-provider-page/hooks'
import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
import {
ChunkStructureEnum,
IndexMethodEnum,
@ -174,31 +171,6 @@ export const useConfig = (id: string) => {
})
}, [handleNodeDataUpdate])
const {
currentModel,
currentProvider,
} = useModelListAndDefaultModelAndCurrentProviderAndModel(ModelTypeEnum.textEmbedding)
const handleInitConfig = useCallback(() => {
const nodeData = getNodeData()
if (!nodeData?.data.embedding_model && !nodeData?.data.embedding_model_provider && currentModel && currentProvider) {
handleEmbeddingModelChange({
embeddingModel: currentModel.model,
embeddingModelProvider: currentProvider.provider,
})
}
}, [
getNodeData,
handleEmbeddingModelChange,
currentModel,
currentProvider,
])
useEffect(() => {
handleInitConfig()
}, [handleInitConfig])
return {
handleChunkStructureChange,
handleIndexMethodChange,