feat: llm node add context

This commit is contained in:
zhaoying
2026-01-04 12:06:24 +08:00
parent 02c8fd0e3f
commit 351be8aaf3
10 changed files with 233 additions and 150 deletions

View File

@@ -117,6 +117,9 @@ export const nodeLibrary: NodeLibrary[] = [
step: 1,
defaultValue: 2000
},
context: {
type: 'variableList',
},
messages: {
type: 'define',
defaultValue: [
@@ -142,27 +145,27 @@ export const nodeLibrary: NodeLibrary[] = [
}
},
// { type: "classification", icon: classificationIcon },
// { type: "parameter-extractor", icon: parameterExtractionIcon,
// config: {
// model_id: {
// type: 'customSelect',
// url: getModelListUrl,
// params: { type: 'llm,chat' }, // llm/chat
// valueKey: 'id',
// labelKey: 'name',
// },
// text: {
// type: 'variableList',
// },
// params: {
// type: 'paramList',
// },
// prompt: {
// type: 'messageEditor',
// isArray: false,
// },
// }
// }
{ type: "parameter-extractor", icon: parameterExtractionIcon,
config: {
model_id: {
type: 'customSelect',
url: getModelListUrl,
params: { type: 'llm,chat' }, // llm/chat
valueKey: 'id',
labelKey: 'name',
},
text: {
type: 'variableList',
},
params: {
type: 'paramList',
},
prompt: {
type: 'messageEditor',
isArray: false,
},
}
}
]
},
// {
@@ -182,115 +185,115 @@ export const nodeLibrary: NodeLibrary[] = [
// { type: "agent_arbitration", icon: agentArbitrationIcon }
// ]
// },
// {
// category: "flowControl",
// nodes: [
// { type: "if-else", icon: conditionIcon,
// config: {
// cases: {
// type: 'caseList',
// defaultValue: [
// {
// logical_operator: 'and',
// expressions: []
// }
// ]
// }
// }
// },
// // { type: "iteration", icon: iterationIcon },
// { type: "loop", icon: loopIcon },
// // { type: "parallel", icon: parallelIcon },
// { type: "var-aggregator", icon: aggregatorIcon,
// config: {
// group: {
// type: 'switch',
// defaultValue: false
// },
// group_names: {
// type: 'groupVariableList',
// defaultValue: [{ key: 'Group1', value: []}]
// }
// }
// }
// ]
// },
// {
// category: "externalInteraction",
// nodes: [
// { type: "http-request", icon: httpRequestIcon,
// config: {
// method: {
// type: 'select',
// options: [
// { label: 'GET', value: 'GET' },
// { label: 'POST', value: 'POST' },
// { label: 'HEAD', value: 'HEAD' },
// { label: 'PATCH', value: 'PATCH' },
// { label: 'PUT', value: 'PUT' },
// { label: 'DELETE', value: 'DELETE' },
// ],
// defaultValue: 'GET'
// },
// url: {
// type: 'messageEditor',
// isArray: false,
// },
// auth: {
// type: 'define',
// defaultValue: {
// auth_type: 'none'
// }
// },
// headers: {
// type: 'define',
// defaultValue: {}
// },
// params: {
// type: 'define',
// defaultValue: {}
// },
// body: {
// type: 'define',
// defaultValue: {
// 'content_type': 'none'
// }
// },
// verify_ssl: {
// type: 'switch',
// defaultValue: false
// },
// timeouts: {
// type: 'define',
// defaultValue: {}
// },
// retry: {
// type: 'define',
// },
// error_handle: {
// type: 'define',
// defaultValue: {
// method: 'default'
// }
// }
// }
// },
// // { type: "tools", icon: toolsIcon },
// // { type: "code_execution", icon: codeExecutionIcon },
// { type: "jinja-render", icon: templateRenderingIcon,
// config: {
// mapping: {
// type: 'mappingList',
// defaultValue: []
// },
// template: {
// type: 'messageEditor',
// isArray: false,
// },
// }
// }
// ]
// },
{
category: "flowControl",
nodes: [
{ type: "if-else", icon: conditionIcon,
config: {
cases: {
type: 'caseList',
defaultValue: [
{
logical_operator: 'and',
expressions: []
}
]
}
}
},
// { type: "iteration", icon: iterationIcon },
// { type: "loop", icon: loopIcon },
// { type: "parallel", icon: parallelIcon },
{ type: "var-aggregator", icon: aggregatorIcon,
config: {
group: {
type: 'switch',
defaultValue: false
},
group_names: {
type: 'groupVariableList',
defaultValue: [{ key: 'Group1', value: []}]
}
}
}
]
},
{
category: "externalInteraction",
nodes: [
{ type: "http-request", icon: httpRequestIcon,
config: {
method: {
type: 'select',
options: [
{ label: 'GET', value: 'GET' },
{ label: 'POST', value: 'POST' },
{ label: 'HEAD', value: 'HEAD' },
{ label: 'PATCH', value: 'PATCH' },
{ label: 'PUT', value: 'PUT' },
{ label: 'DELETE', value: 'DELETE' },
],
defaultValue: 'GET'
},
url: {
type: 'messageEditor',
isArray: false,
},
auth: {
type: 'define',
defaultValue: {
auth_type: 'none'
}
},
headers: {
type: 'define',
defaultValue: {}
},
params: {
type: 'define',
defaultValue: {}
},
body: {
type: 'define',
defaultValue: {
'content_type': 'none'
}
},
verify_ssl: {
type: 'switch',
defaultValue: false
},
timeouts: {
type: 'define',
defaultValue: {}
},
retry: {
type: 'define',
},
error_handle: {
type: 'define',
defaultValue: {
method: 'default'
}
}
}
},
// { type: "tools", icon: toolsIcon },
// { type: "code_execution", icon: codeExecutionIcon },
{ type: "jinja-render", icon: templateRenderingIcon,
config: {
mapping: {
type: 'mappingList',
defaultValue: []
},
template: {
type: 'messageEditor',
isArray: false,
},
}
}
]
},
// {
// category: "safetyAndCompliance",
// nodes: [