ソースを参照

fix: in pipeline not show the node config right

tags/2.0.0-beta.1
Joel 2ヶ月前
コミット
c8d60f372d
1個のファイルの変更11行の追加2行の削除
  1. 11
    2
      web/app/components/rag-pipeline/hooks/use-pipeline-config.ts

+ 11
- 2
web/app/components/rag-pipeline/hooks/use-pipeline-config.ts ファイルの表示

@@ -24,10 +24,19 @@ export const usePipelineConfig = () => {
handleUpdateWorkflowConfig,
)

const handleUpdateNodesDefaultConfigs = useCallback((nodesDefaultConfigs: Record<string, any>) => {
const handleUpdateNodesDefaultConfigs = useCallback((nodesDefaultConfigs: Record<string, any> | Record<string, any>[]) => {
const { setNodesDefaultConfigs } = workflowStore.getState()
let res: Record<string, any> = {}
if (Array.isArray(nodesDefaultConfigs)) {
nodesDefaultConfigs.forEach((item) => {
res[item.type] = item.config
})
}
else {
res = nodesDefaultConfigs as Record<string, any>
}

setNodesDefaultConfigs!(nodesDefaultConfigs)
setNodesDefaultConfigs!(res)
}, [workflowStore])
useWorkflowConfig(
pipelineId ? `/rag/pipelines/${pipelineId}/workflows/default-workflow-block-configs` : '',

読み込み中…
キャンセル
保存