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.

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

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

let searchRagPipelineNodes: SearchRagPipelineNodes | undefined

export function registerRagPipelineNodeSearch(search: SearchRagPipelineNodes) {
  searchRagPipelineNodes = search

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

export function findRagPipelineNodes(query: string) {
  return searchRagPipelineNodes?.(query) ?? []
}