feat: add custom edge (#1061)

### What problem does this PR solve?
feat: add custom edge
feat: add flow card
feat: add store for canvas
#918 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-05 10:46:06 +08:00
committed by GitHub
parent b8eedbdd86
commit 39ac3b1e60
42 changed files with 1559 additions and 387 deletions

View File

@@ -1,12 +1,7 @@
import {
MergeCellsOutlined,
RocketOutlined,
SendOutlined,
} from '@ant-design/icons';
import { MergeCellsOutlined, RocketOutlined } from '@ant-design/icons';
import { Position } from 'reactflow';
export const componentList = [
{ name: 'Begin', icon: <SendOutlined />, description: '' },
{ name: 'Retrieval', icon: <RocketOutlined />, description: '' },
{ name: 'Generate', icon: <MergeCellsOutlined />, description: '' },
];
@@ -159,7 +154,14 @@ export const dsl = {
'Retrieval:China': {
obj: {
component_name: 'Retrieval',
params: {},
params: {
similarity_threshold: 0.2,
keywords_similarity_weight: 0.3,
top_n: 6,
top_k: 1024,
rerank_id: 'BAAI/bge-reranker-v2-m3',
kb_ids: ['568aa82603b611efa9d9fa163e197198'],
},
},
downstream: ['Generate:China'],
upstream: ['Answer:China'],
@@ -167,7 +169,12 @@ export const dsl = {
'Generate:China': {
obj: {
component_name: 'Generate',
params: {},
params: {
llm_id: 'deepseek-chat',
prompt:
'You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, your answer must include the sentence "The answer you are looking for is not found in the knowledge base!" Answers need to consider chat history.\n Here is the knowledge base:\n {input}\n The above is the knowledge base.',
temperature: 0.2,
},
},
downstream: ['Answer:China'],
upstream: ['Retrieval:China'],