Merge branch 'feat/rag-pipeline' of https://github.com/langgenius/dify into feat/rag-pipeline

pull/21398/head
twwu 12 months ago
commit 898495b5c4

@ -6,6 +6,7 @@ on:
- "main" - "main"
- "deploy/dev" - "deploy/dev"
- "deploy/enterprise" - "deploy/enterprise"
- "feat/rag-pipeline"
tags: tags:
- "*" - "*"

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

@ -1,13 +1,10 @@
import { import {
useCallback, useCallback,
useEffect,
} from 'react' } from 'react'
import { produce } from 'immer' import { produce } from 'immer'
import { useStoreApi } from 'reactflow' import { useStoreApi } from 'reactflow'
import { useNodeDataUpdate } from '@/app/components/workflow/hooks' import { useNodeDataUpdate } from '@/app/components/workflow/hooks'
import type { ValueSelector } from '@/app/components/workflow/types' 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 { import {
ChunkStructureEnum, ChunkStructureEnum,
IndexMethodEnum, IndexMethodEnum,
@ -174,31 +171,6 @@ export const useConfig = (id: string) => {
}) })
}, [handleNodeDataUpdate]) }, [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 { return {
handleChunkStructureChange, handleChunkStructureChange,
handleIndexMethodChange, handleIndexMethodChange,

Loading…
Cancel
Save