diff --git a/web/app/components/workflow/hooks/use-workflow-run-event/use-workflow-reasoning.ts b/web/app/components/workflow/hooks/use-workflow-run-event/use-workflow-reasoning.ts deleted file mode 100644 index 9abfeca0383..00000000000 --- a/web/app/components/workflow/hooks/use-workflow-run-event/use-workflow-reasoning.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { ReasoningChunkResponse } from '@/types/workflow' -import { produce } from 'immer' -import { useCallback } from 'react' -import { useWorkflowStore } from '@/app/components/workflow/store' - -export const useWorkflowReasoning = () => { - const workflowStore = useWorkflowStore() - - const handleWorkflowReasoning = useCallback((params: ReasoningChunkResponse) => { - const { data: { reasoning, node_id, is_final } } = params - const { - workflowRunningData, - setWorkflowRunningData, - } = workflowStore.getState() - - setWorkflowRunningData(produce(workflowRunningData!, (draft) => { - const reasoningContent = (draft.reasoningContent ||= {}) - // key by LLM node so multiple nodes' reasoning stays separated - const key = node_id || '_' - if (reasoning) - reasoningContent[key] = (reasoningContent[key] || '') + reasoning - if (is_final) - draft.reasoningFinished = true - })) - }, [workflowStore]) - - return { - handleWorkflowReasoning, - } -}