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.

538 B
Raw Blame
import { TONE_LIST } from '@/config'

export const getSupportedPresetConfig = (toneId: number, supportedParameterNames?: string[]) => {
  const tone = TONE_LIST.find((tone) => tone.id === toneId)
  if (!tone?.config) return {}

  if (!supportedParameterNames) return { ...tone.config }

  const supportedParameterNameSet = new Set(supportedParameterNames)

  return Object.entries(tone.config).reduce<Record<string, number>>((acc, [key, value]) => {
    if (supportedParameterNameSet.has(key)) acc[key] = value

    return acc
  }, {})
}