mirror of
https://github.com/langgenius/dify.git
synced 2026-06-26 14:51:13 +08:00
fix: remove unused use-workflow-reasoning.ts to satisfy knip dead code check
The PR removed all imports and usages of useWorkflowReasoning from use-workflow-run-event.ts but left the source file behind. knip's production dead code check flags this as an unused file. Delete it.
This commit is contained in:
parent
8a5a53c4af
commit
4a9f945ffa
@ -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,
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user