feat: add OperateDropdown and send debug message #918 (#1095)

### What problem does this PR solve?
feat: add OperateDropdown
feat: send debug message #918 

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-07 19:27:27 +08:00
committed by GitHub
parent 59efba3d87
commit 706985c188
19 changed files with 335 additions and 362 deletions

View File

@@ -49,83 +49,83 @@ export const dsl = {
sourcePosition: 'left',
targetPosition: 'right',
},
{
id: 'Answer:China',
type: 'textUpdater',
position: {
x: 150,
y: 200,
},
data: {
label: 'Answer',
},
sourcePosition: 'left',
targetPosition: 'right',
},
{
id: 'Retrieval:China',
type: 'textUpdater',
position: {
x: 250,
y: 200,
},
data: {
label: 'Retrieval',
},
sourcePosition: 'left',
targetPosition: 'right',
},
{
id: 'Generate:China',
type: 'textUpdater',
position: {
x: 100,
y: 100,
},
data: {
label: 'Generate',
},
sourcePosition: 'left',
targetPosition: 'right',
},
// {
// id: 'Answer:China',
// type: 'textUpdater',
// position: {
// x: 150,
// y: 200,
// },
// data: {
// label: 'Answer',
// },
// sourcePosition: 'left',
// targetPosition: 'right',
// },
// {
// id: 'Retrieval:China',
// type: 'textUpdater',
// position: {
// x: 250,
// y: 200,
// },
// data: {
// label: 'Retrieval',
// },
// sourcePosition: 'left',
// targetPosition: 'right',
// },
// {
// id: 'Generate:China',
// type: 'textUpdater',
// position: {
// x: 100,
// y: 100,
// },
// data: {
// label: 'Generate',
// },
// sourcePosition: 'left',
// targetPosition: 'right',
// },
],
edges: [
{
id: '7facb53d-65c9-43b3-ac55-339c445d3891',
label: '',
source: 'begin',
target: 'Answer:China',
markerEnd: {
type: 'arrow',
},
},
{
id: '7ac83631-502d-410f-a6e7-bec6866a5e99',
label: '',
source: 'Generate:China',
target: 'Answer:China',
markerEnd: {
type: 'arrow',
},
},
{
id: '0aaab297-5779-43ed-9281-2c4d3741566f',
label: '',
source: 'Answer:China',
target: 'Retrieval:China',
markerEnd: {
type: 'arrow',
},
},
{
id: '3477f9f3-0a7d-400e-af96-a11ea7673183',
label: '',
source: 'Retrieval:China',
target: 'Generate:China',
markerEnd: {
type: 'arrow',
},
},
// {
// id: '7facb53d-65c9-43b3-ac55-339c445d3891',
// label: '',
// source: 'begin',
// target: 'Answer:China',
// markerEnd: {
// type: 'arrow',
// },
// },
// {
// id: '7ac83631-502d-410f-a6e7-bec6866a5e99',
// label: '',
// source: 'Generate:China',
// target: 'Answer:China',
// markerEnd: {
// type: 'arrow',
// },
// },
// {
// id: '0aaab297-5779-43ed-9281-2c4d3741566f',
// label: '',
// source: 'Answer:China',
// target: 'Retrieval:China',
// markerEnd: {
// type: 'arrow',
// },
// },
// {
// id: '3477f9f3-0a7d-400e-af96-a11ea7673183',
// label: '',
// source: 'Retrieval:China',
// target: 'Generate:China',
// markerEnd: {
// type: 'arrow',
// },
// },
],
},
components: {
@@ -137,43 +137,45 @@ export const dsl = {
downstream: ['Answer:China'], // other edge target is downstream, edge source is current node id
upstream: [], // edge source is upstream, edge target is current node id
},
'Answer:China': {
obj: {
component_name: 'Answer',
params: {},
},
downstream: ['Retrieval:China'],
upstream: ['begin', 'Generate:China'],
},
'Retrieval:China': {
obj: {
component_name: 'Retrieval',
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'],
},
'Generate:China': {
obj: {
component_name: 'Generate',
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'],
},
// 'Answer:China': {
// obj: {
// component_name: 'Answer',
// params: {},
// },
// downstream: ['Retrieval:China'],
// upstream: ['begin', 'Generate:China'],
// },
// 'Retrieval:China': {
// obj: {
// component_name: 'Retrieval',
// 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'],
// },
// 'Generate:China': {
// obj: {
// component_name: 'Generate',
// 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'],
// },
},
messages: [],
reference: [],
history: [],
path: [],
answer: [],