Skip to content

🎬 火宝短剧 - 基于AI的一站式短剧生成平台 《一句话生成完整短剧,从剧本到成片全自动化》 Huobao Drama - An AI-Powered End-to-End Short Drama Generator "One Sentence to Complete Drama: Fully Automated from Script to Final Video"

TypeScript
538 B
Raw Blame
interface TextModelOption {
  key: string
  model: string
  configId: number
}

/** 默认项显示 options[0],请求也必须使用同一模型及其配置,避免后端再次选型。 */
export function resolveTextModelSelection(options: TextModelOption[], selectedKey: string) {
  const selected = options.find(option => option.key === selectedKey)
    ?? options.find(option => option.model === selectedKey) // 兼容旧版存储的裸模型名
    ?? options[0]
  return { model: selected?.model, configId: selected?.configId }
}