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.

643 B
Raw Blame
import type { fileUpload } from './utils'
import type { uploadPublicRemoteFileInfo } from '@/service/common'
import { createContext, use } from 'react'

/** The surface owns upload authorization; local failures use the supplied callbacks. */
export type FileUploadStrategy = {
  uploadLocal: (params: Parameters<typeof fileUpload>[0]) => void
  uploadRemote: (url: string) => ReturnType<typeof uploadPublicRemoteFileInfo>
}

export const FileUploadContext = createContext<{
  localUploadUrl?: string
  trialAppId?: string
  uploadStrategy?: FileUploadStrategy
}>({})

export function useFileUploadContext() {
  return use(FileUploadContext)
}