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.

464 B
Raw Blame
import type { RagPipelineDatasourceProviderResponse } from '@dify/contracts/api/console/rag/types.gen'
import { basePath } from '@/utils/var'

export function resolveDatasourceIcon(
  icon: RagPipelineDatasourceProviderResponse['declaration']['identity']['icon'],
) {
  if (
    basePath &&
    icon.startsWith('/') &&
    !icon.startsWith('//') &&
    icon !== basePath &&
    !icon.startsWith(`${basePath}/`)
  )
    return `${basePath}${icon}`

  return icon
}