refactor: type improvements that doesn't modify functionality (#17970)
This commit is contained in:
parent
53efb2bad5
commit
4c99e9dc73
39 changed files with 69 additions and 63 deletions
|
|
@ -106,7 +106,7 @@ const Panel: FC<NodePanelProps<DocExtractorNodeType>> = ({
|
|||
required: true,
|
||||
}],
|
||||
values: { files },
|
||||
onChange: keyValue => setFiles((keyValue as any).files),
|
||||
onChange: keyValue => setFiles(keyValue.files),
|
||||
},
|
||||
]}
|
||||
runningStatus={runningStatus}
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ const Panel: FC<NodePanelProps<IterationNodeType>> = ({
|
|||
required: false,
|
||||
}],
|
||||
values: { [iteratorInputKey]: iterator },
|
||||
onChange: keyValue => setIterator((keyValue as any)[iteratorInputKey]),
|
||||
onChange: keyValue => setIterator(keyValue[iteratorInputKey]),
|
||||
},
|
||||
]}
|
||||
runningStatus={runningStatus}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ const RetrievalConfig: FC<Props> = ({
|
|||
model: configs.reranking_model?.reranking_model_name,
|
||||
}),
|
||||
reranking_mode: configs.reranking_mode,
|
||||
weights: configs.weights as any,
|
||||
weights: configs.weights,
|
||||
reranking_enable: configs.reranking_enable,
|
||||
})
|
||||
}, [onMultipleRetrievalConfigChange, payload.retrieval_mode, validRerankDefaultProvider, validRerankDefaultModel, onRetrievalModeChange])
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ const Panel: FC<NodePanelProps<KnowledgeRetrievalNodeType>> = ({
|
|||
required: true,
|
||||
}],
|
||||
values: { query },
|
||||
onChange: keyValue => setQuery((keyValue as any).query),
|
||||
onChange: keyValue => setQuery(keyValue.query),
|
||||
},
|
||||
]}
|
||||
runningStatus={runningStatus}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
|
|||
required: false,
|
||||
}],
|
||||
values: { '#context#': contexts },
|
||||
onChange: keyValue => setContexts((keyValue as any)['#context#']),
|
||||
onChange: keyValue => setContexts(keyValue['#context#']),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ const ImportFromTool: FC<Props> = ({
|
|||
})()
|
||||
const currCollection = currentTools.find(item => canFindTool(item.id, provider_id))
|
||||
const currTool = currCollection?.tools.find(tool => tool.name === tool_name)
|
||||
const toExactParams = (currTool?.parameters || []).filter((item: any) => item.form === 'llm')
|
||||
const toExactParams = (currTool?.parameters || []).filter(item => item.form === 'llm')
|
||||
const formattedParams = toParmExactParams(toExactParams, language)
|
||||
onImport(formattedParams)
|
||||
}, [buildInTools, customTools, language, onImport, workflowTools])
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ const Panel: FC<NodePanelProps<QuestionClassifierNodeType>> = ({
|
|||
required: false,
|
||||
}],
|
||||
values: { '#files#': visionFiles },
|
||||
onChange: keyValue => setVisionFiles((keyValue as any)['#files#']),
|
||||
onChange: keyValue => setVisionFiles(keyValue['#files#']),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue