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.

798 B
Raw Blame
import { useQuery } from '@tanstack/react-query'
import { consoleQuery } from '@/service/console'
import { fetchTryAppDatasets, fetchTryAppParams } from './try-app'

export const useGetTryAppParams = (appId: string) => {
  return useQuery({
    queryKey: consoleQuery.trialApps.byAppId.parameters.get.queryKey({
      input: { params: { app_id: appId } },
    }),
    queryFn: () => {
      return fetchTryAppParams(appId)
    },
    enabled: !!appId,
  })
}

export const useGetTryAppDataSets = (appId: string, ids: string[]) => {
  return useQuery({
    queryKey: consoleQuery.trialApps.byAppId.datasets.get.queryKey({
      input: { params: { app_id: appId }, query: { ids } },
    }),
    queryFn: () => {
      return fetchTryAppDatasets(appId, ids)
    },
    enabled: ids.length > 0,
  })
}