Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

501 B
Raw Blame
import type { SearchResult } from '@/app/components/goto-anything/actions/types'

type SearchWorkflowNodes = (query: string) => SearchResult[]

let searchWorkflowNodes: SearchWorkflowNodes | undefined

export function registerWorkflowNodeSearch(search: SearchWorkflowNodes) {
  searchWorkflowNodes = search

  return () => {
    if (searchWorkflowNodes === search) searchWorkflowNodes = undefined
  }
}

export function findWorkflowNodes(query: string) {
  return searchWorkflowNodes?.(query) ?? []
}