mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 19:27:23 +08:00
feat: retrial node
This commit is contained in:
parent
db6074e035
commit
0759b29ca2
@ -0,0 +1,19 @@
|
|||||||
|
import type { KnowledgeRetrievalNodeType } from './types'
|
||||||
|
import { RETRIEVE_TYPE } from '@/types/app'
|
||||||
|
|
||||||
|
export const mockData: KnowledgeRetrievalNodeType = {
|
||||||
|
type: 'KnowledgeRetrieval',
|
||||||
|
desc: 'xxx',
|
||||||
|
title: 'KnowledgeRetrieval',
|
||||||
|
query_variable_selector: ['aaa', 'name'],
|
||||||
|
dataset_ids: ['1'],
|
||||||
|
retrieval_mode: RETRIEVE_TYPE.oneWay,
|
||||||
|
multiple_retrieval_config: {
|
||||||
|
top_k: 10,
|
||||||
|
score_threshold: 0.5,
|
||||||
|
reranking_model: {
|
||||||
|
provider: '',
|
||||||
|
model: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@ -1,8 +1,22 @@
|
|||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
|
import { Folder } from '@/app/components/base/icons/src/vender/solid/files'
|
||||||
|
|
||||||
const Node: FC = () => {
|
const Node: FC = () => {
|
||||||
return (
|
return (
|
||||||
<div>knowledge-retrieval</div>
|
<div className='px-3'>
|
||||||
|
<div className='space-y-0.5'>
|
||||||
|
{['product Doc', 'Text completion'].map(name => (
|
||||||
|
<div key={name} className='flex items-center h-[26px] bg-gray-100 rounded-md px-1 text-xs font-normal text-gray-700'>
|
||||||
|
<div className='mr-1 shrink-0 p-1 bg-[#F5F8FF] rounded-md border-[0.5px] border-[#E0EAFF]'>
|
||||||
|
<Folder className='w-3 h-3 text-[#444CE7]' />
|
||||||
|
</div>
|
||||||
|
<div className='text-xs font-normal text-gray-700'>
|
||||||
|
{name}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,16 @@
|
|||||||
|
import type { CommonNodeType, ValueSelector } from '@/app/components/workflow/types'
|
||||||
|
import type { RETRIEVE_TYPE } from '@/types/app'
|
||||||
|
|
||||||
|
export type KnowledgeRetrievalNodeType = CommonNodeType & {
|
||||||
|
query_variable_selector: ValueSelector
|
||||||
|
dataset_ids: string[]
|
||||||
|
retrieval_mode: RETRIEVE_TYPE
|
||||||
|
multiple_retrieval_config?: {
|
||||||
|
top_k: number
|
||||||
|
score_threshold: number
|
||||||
|
reranking_model: {
|
||||||
|
provider: string
|
||||||
|
model: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user