feat: support llm single run

This commit is contained in:
Joel 2024-04-01 12:55:10 +08:00
parent ffb698922a
commit c330f89c77
3 changed files with 5 additions and 3 deletions

View File

@ -211,14 +211,14 @@ const useOneStepRun = <T>({
const originalVar = getVar(item.value_selector)
if (!originalVar) {
return {
label: item.variable,
label: item.label || item.variable,
variable: item.variable,
type: InputVarType.textInput,
required: true,
}
}
return {
label: item.variable,
label: item.label || item.variable,
variable: item.variable,
type: varTypeToInputVarType(originalVar.type, {
isSelect: !!originalVar.isSelect,

View File

@ -286,7 +286,8 @@ const useConfig = (id: string, payload: LLMNodeType) => {
variable[0] = varInfo?.title || availableNodes[0]?.data.title // default start node title
return {
variable: `${variable[0]}/${variable[variable.length - 1]}`,
label: `${variable[0]}/${variable[variable.length - 1]}`,
variable: `#${item.join('.')}#`,
value_selector: item,
}
})

View File

@ -63,6 +63,7 @@ export type ValueSelector = string[] // [nodeId, key | obj key path]
export type Variable = {
variable: string
label?: string
value_selector: ValueSelector
variable_type?: VarKindType
value?: string