79 lines
3.1 KiB
TypeScript
79 lines
3.1 KiB
TypeScript
|
|
import { aiPrompts } from './aiPrompt'
|
|||
|
|
|
|||
|
|
export type AiInferenceModelModel = {
|
|||
|
|
value: string // AI选项值
|
|||
|
|
label: string // AI选项标签
|
|||
|
|
hasExample: boolean // 是否有示例
|
|||
|
|
mustCharacter: boolean // 是否必须包含角色
|
|||
|
|
systemContent: string // 系统内容
|
|||
|
|
userContent: string // 用户内容
|
|||
|
|
allAndExampleContent: string | null // 所有和示例内容
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* AI选项数据
|
|||
|
|
* @description 该数据用于选择AI选项,包含value、label、hasExample、systemContent、userContent和allAndExampleContent等属性
|
|||
|
|
*/
|
|||
|
|
export const aiOptionsData: AiInferenceModelModel[] = [
|
|||
|
|
{
|
|||
|
|
value: 'NanFengStoryboardMasterScenePrompt',
|
|||
|
|
label: '【NanFeng】场景提示大师(上下文-不包含人物)',
|
|||
|
|
hasExample: false,
|
|||
|
|
mustCharacter: false,
|
|||
|
|
systemContent: aiPrompts.NanFengStoryboardMasterScenePromptSystemContent,
|
|||
|
|
userContent: aiPrompts.NanFengStoryboardMasterScenePromptUserContent,
|
|||
|
|
allAndExampleContent: null
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
value: 'NanFengStoryboardMasterSpecialEffects',
|
|||
|
|
label: '【NanFeng】分镜大师-特效增强版(上下文-角色分析-人物固定)',
|
|||
|
|
hasExample: false,
|
|||
|
|
mustCharacter: true,
|
|||
|
|
systemContent: aiPrompts.NanFengStoryboardMasterSpecialEffectsSystemContent,
|
|||
|
|
userContent: aiPrompts.NanFengStoryboardMasterSpecialEffectsUserContent,
|
|||
|
|
allAndExampleContent: null
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
value: 'NanFengStoryboardMasterSDEnglish',
|
|||
|
|
label: '【NanFeng】分镜大师-SD英文版(上下文-SD-英文提示词)',
|
|||
|
|
hasExample: false,
|
|||
|
|
mustCharacter: false,
|
|||
|
|
systemContent: aiPrompts.NanFengStoryboardMasterSDEnglishSystemContent,
|
|||
|
|
userContent: aiPrompts.NanFengStoryboardMasterSDEnglishUserContent,
|
|||
|
|
allAndExampleContent: null
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
value: 'NanFengStoryboardMasterSingleFrame',
|
|||
|
|
label: '【NanFeng】分镜大师-单帧分镜提示词(上下文-单帧-人物推理)',
|
|||
|
|
hasExample: false,
|
|||
|
|
mustCharacter: false,
|
|||
|
|
systemContent: aiPrompts.NanFengStoryboardMasterSingleFrameSystemContent,
|
|||
|
|
userContent: aiPrompts.NanFengStoryboardMasterSingleFrameUserContent,
|
|||
|
|
allAndExampleContent: null
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
value: 'NanFengStoryboardMasterSingleFrameWithCharacter',
|
|||
|
|
label: '【NanFeng】分镜大师-单帧分镜提示词(上下文-单帧-角色分析-人物固定)',
|
|||
|
|
hasExample: false,
|
|||
|
|
mustCharacter: true,
|
|||
|
|
systemContent: aiPrompts.NanFengStoryboardMasterSingleFrameWithCharacterSystemContent,
|
|||
|
|
userContent: aiPrompts.NanFengStoryboardMasterSingleFrameWithCharacterUserContent,
|
|||
|
|
allAndExampleContent: null
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 获取AI选项数据
|
|||
|
|
* @description 该函数用于获取AI选项数据,包含value、label、hasExample、systemContent、userContent和allAndExampleContent等属性
|
|||
|
|
* @param id AI选项ID
|
|||
|
|
* @returns AI选项数据
|
|||
|
|
* @throws {Error} 如果没有找到对应的AI选项,则抛出错误
|
|||
|
|
*/
|
|||
|
|
export function GetAIPromptOptionByValue(value: string) {
|
|||
|
|
let aiOptionIndex = aiOptionsData.findIndex((item) => item.value == value)
|
|||
|
|
if (aiOptionIndex == -1) {
|
|||
|
|
throw new Error('没有找到对应的AI选项,请先检查配置')
|
|||
|
|
}
|
|||
|
|
return aiOptionsData[aiOptionIndex]
|
|||
|
|
}
|