mirror of https://github.com/langgenius/dify.git
Merge branch 'feat/rag-pipeline' into deploy/rag-dev
This commit is contained in:
commit
f17f256b2b
|
|
@ -125,7 +125,7 @@ const DatasetDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
|
|||
return true
|
||||
if (datasetRes.provider === 'external')
|
||||
return false
|
||||
if (!datasetRes.pipeline_id)
|
||||
if (datasetRes.runtime_mode === 'general')
|
||||
return false
|
||||
return !datasetRes.is_published
|
||||
}, [datasetRes])
|
||||
|
|
@ -149,7 +149,7 @@ const DatasetDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
|
|||
]
|
||||
|
||||
if (datasetRes?.provider !== 'external') {
|
||||
if (datasetRes?.pipeline_id) {
|
||||
if (datasetRes?.runtime_mode === 'rag_pipeline') {
|
||||
baseNavigation.unshift({
|
||||
name: t('common.datasetMenus.pipeline'),
|
||||
href: `/datasets/${datasetId}/pipeline`,
|
||||
|
|
@ -168,7 +168,7 @@ const DatasetDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
|
|||
}
|
||||
|
||||
return baseNavigation
|
||||
}, [t, datasetId, isButtonDisabledWithPipeline, datasetRes?.provider, datasetRes?.pipeline_id])
|
||||
}, [t, datasetId, isButtonDisabledWithPipeline, datasetRes?.provider, datasetRes?.runtime_mode])
|
||||
|
||||
useDocumentTitle(datasetRes?.name || t('common.menus.datasets'))
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,10 @@ const Settings = ({
|
|||
datasetId,
|
||||
documentId,
|
||||
}: SettingsProps) => {
|
||||
const pipelineId = useDatasetDetailContextWithSelector(s => s.dataset?.pipeline_id)
|
||||
const runtimeMode = useDatasetDetailContextWithSelector(s => s.dataset?.runtime_mode)
|
||||
const isGeneralDataset = runtimeMode === 'general'
|
||||
|
||||
if (!pipelineId) {
|
||||
if (isGeneralDataset) {
|
||||
return (
|
||||
<DocumentSettings
|
||||
datasetId={datasetId}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ const Documents: FC<IDocumentsProps> = ({ datasetId }) => {
|
|||
|
||||
const routeToDocCreate = () => {
|
||||
// if dataset is create from pipeline, redirect to create from pipeline page
|
||||
if (dataset?.pipeline_id) {
|
||||
if (dataset?.runtime_mode === 'rag_pipeline') {
|
||||
router.push(`/datasets/${datasetId}/documents/create-from-pipeline`)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ const DatasetCard = ({
|
|||
return dataset.provider === EXTERNAL_PROVIDER
|
||||
}, [dataset.provider])
|
||||
const isPipelineUnpublished = useMemo(() => {
|
||||
return !!dataset.pipeline_id && !dataset.is_published
|
||||
}, [dataset.pipeline_id, dataset.is_published])
|
||||
return dataset.runtime_mode === 'rag_pipeline' && !dataset.is_published
|
||||
}, [dataset.runtime_mode, dataset.is_published])
|
||||
const chunkingModeIcon = dataset.doc_form ? DOC_FORM_ICON_WITH_BG[dataset.doc_form] : React.Fragment
|
||||
const Icon = isExternalProvider ? DOC_FORM_ICON_WITH_BG.external : chunkingModeIcon
|
||||
const iconInfo = dataset.icon_info || {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ const Card = ({
|
|||
const { t } = useMixedTranslation(localeFromProps)
|
||||
const { categoriesMap } = useSingleCategories(t)
|
||||
const { category, type, name, org, label, brief, icon, verified, badges = [] } = payload
|
||||
const isBundle = !['plugin', 'model', 'tool', 'extension', 'agent-strategy'].includes(type)
|
||||
const isBundle = !['plugin', 'model', 'tool', 'datasource', 'extension', 'agent-strategy'].includes(type)
|
||||
const cornerMark = isBundle ? categoriesMap.bundle?.label : categoriesMap[category]?.label
|
||||
const getLocalizedText = (obj: Record<string, string> | undefined) =>
|
||||
obj ? renderI18nObject(obj, locale) : ''
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
import {
|
||||
RiArchive2Line,
|
||||
RiBrain2Line,
|
||||
RiDatabase2Line,
|
||||
RiHammerLine,
|
||||
RiPuzzle2Line,
|
||||
RiSpeakAiLine,
|
||||
|
|
@ -60,7 +61,7 @@ const PluginTypeSwitch = ({
|
|||
{
|
||||
value: PLUGIN_TYPE_SEARCH_MAP.datasource,
|
||||
text: t('plugin.category.datasources'),
|
||||
icon: <RiHammerLine className='mr-1.5 h-4 w-4' />,
|
||||
icon: <RiDatabase2Line className='mr-1.5 h-4 w-4' />,
|
||||
},
|
||||
{
|
||||
value: PLUGIN_TYPE_SEARCH_MAP.agent,
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ const OnlineDocumentSelector = ({
|
|||
datasource_type: DatasourceType.onlineDocument,
|
||||
}, {
|
||||
onSuccess(documentsData) {
|
||||
setDocumentsData(documentsData as DataSourceNotionWorkspace[])
|
||||
setDocumentsData(documentsData.result as DataSourceNotionWorkspace[])
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ export type DataSet = {
|
|||
keyword_number?: number
|
||||
pipeline_id?: string
|
||||
is_published?: boolean // Indicates if the pipeline is published
|
||||
runtime_mode: 'rag_pipeline' | 'general'
|
||||
}
|
||||
|
||||
export type ExternalAPIItem = {
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ export type PipelineDatasourceNodeRunRequest = {
|
|||
export type PipelineDatasourceNodeRunResponse = {
|
||||
job_id?: string
|
||||
status: 'processing' | 'completed'
|
||||
result: Record<string, any>
|
||||
result: any
|
||||
provider_type: DatasourceType
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue