实现 SFX V2 T1 契约与提示词基础
统一前后端 SFX Prompt Unicode canonicalization、字符计数和 2048 边界 固化 52 个音效预设、追加规则及跨语言测试向量 演进共享音频请求响应、duration、Loop 和 V2 metadata 契约 增加 External model 输入矩阵纯函数并保持正式接线归属 T5 补齐前端提交、读取、深拷贝与请求边界回归测试 更新共享计划并标记 T1 完成且当前不可发布
This commit is contained in:
@@ -6,3 +6,38 @@ export type BackgroundMusicPromptAssistResponse = {
|
||||
prompt: string;
|
||||
charCount: number;
|
||||
};
|
||||
|
||||
export type SoundEffectPromptOptimizeRequest = {
|
||||
currentPrompt: string;
|
||||
};
|
||||
|
||||
export type SoundEffectPromptOptimizeResponse = {
|
||||
prompt: string;
|
||||
charCount: number;
|
||||
};
|
||||
|
||||
export const EDITOR_SOUND_EFFECT_MODEL = 'eleven_text_to_sound_v2' as const;
|
||||
export const SOUND_EFFECT_DURATION_MIN_SECONDS = 0.5;
|
||||
export const SOUND_EFFECT_DURATION_MAX_SECONDS = 30;
|
||||
|
||||
export type EditorSoundEffectModel = typeof EDITOR_SOUND_EFFECT_MODEL;
|
||||
|
||||
export type EditorSoundEffectDurationMode = 'auto' | 'manual';
|
||||
|
||||
export type EditorSoundEffectGenerationRequest = {
|
||||
prompt: string;
|
||||
model: EditorSoundEffectModel;
|
||||
duration?: number | null;
|
||||
loop?: boolean;
|
||||
};
|
||||
|
||||
export type EditorSoundEffectGenerationMetadataV2 = {
|
||||
schemaVersion: 2;
|
||||
userPrompt: string;
|
||||
actualPrompt: string;
|
||||
model: EditorSoundEffectModel;
|
||||
durationMode: EditorSoundEffectDurationMode;
|
||||
requestedDurationSeconds: number | null;
|
||||
actualDurationSeconds: number;
|
||||
loop: boolean;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
[
|
||||
{
|
||||
"name": "plain-ascii-boundary-space",
|
||||
"input": " thunder crack ",
|
||||
"prompt": "thunder crack",
|
||||
"charCount": 13
|
||||
},
|
||||
{
|
||||
"name": "unicode-white-space-boundary",
|
||||
"input": "\u0085\u2003金币叮当\u00a0\r\n",
|
||||
"prompt": "金币叮当",
|
||||
"charCount": 4
|
||||
},
|
||||
{
|
||||
"name": "internal-white-space-preserved",
|
||||
"input": "\u2003A \n B\u0085",
|
||||
"prompt": "A \n B",
|
||||
"charCount": 5
|
||||
},
|
||||
{
|
||||
"name": "zero-width-and-bom-preserved",
|
||||
"input": "\u0085\u200b\ufeff\u0085",
|
||||
"prompt": "\u200b\ufeff",
|
||||
"charCount": 2
|
||||
},
|
||||
{
|
||||
"name": "combining-mark-preserved",
|
||||
"input": "\u2003e\u0301\u00a0",
|
||||
"prompt": "e\u0301",
|
||||
"charCount": 2
|
||||
},
|
||||
{
|
||||
"name": "zwj-emoji-counts-code-points",
|
||||
"input": "\n👩💻\r",
|
||||
"prompt": "👩💻",
|
||||
"charCount": 3
|
||||
},
|
||||
{
|
||||
"name": "unicode-white-space-only",
|
||||
"input": "\u0085\u2003\u00a0\r\n",
|
||||
"prompt": "",
|
||||
"charCount": 0
|
||||
},
|
||||
{
|
||||
"name": "empty",
|
||||
"input": "",
|
||||
"prompt": "",
|
||||
"charCount": 0
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user