feat: 支持 MiniMax 音色克隆和 2.8 语音模型
This commit is contained in:
@@ -313,6 +313,9 @@ func requestAssetHydrationForField(path []string, asset store.RequestAsset, cand
|
||||
if providerFieldNeedsRawBase64(path) {
|
||||
return requestAssetHydrateRawBase64
|
||||
}
|
||||
if candidate.ModelType == "voice_clone" && voiceCloneAudioFieldNeedsHydration(path, asset) {
|
||||
return requestAssetHydrateDataURL
|
||||
}
|
||||
if requestAssetMediaKindForHydration(path, asset) == "image" {
|
||||
if style, ok := requestAssetCapabilityHydrationForMedia("image", candidate, asset.URL, asset.StorageProvider); ok {
|
||||
return style
|
||||
@@ -333,12 +336,27 @@ func requestAssetMediaKindForHydration(path []string, asset store.RequestAsset)
|
||||
if mediaURLFieldNeedsHydration(path) {
|
||||
return requestAssetMediaURLKind(path)
|
||||
}
|
||||
if voiceCloneAudioFieldNeedsHydration(path, asset) {
|
||||
return "audio"
|
||||
}
|
||||
if imageInputFieldNeedsHydration(path) {
|
||||
return "image"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func voiceCloneAudioFieldNeedsHydration(path []string, asset store.RequestAsset) bool {
|
||||
key, parent := requestAssetFieldPath(path)
|
||||
switch key {
|
||||
case "audio", "file", "source_audio", "sourceaudio", "prompt_audio", "promptaudio", "audio_url", "audiourl", "prompt_audio_url", "promptaudiourl":
|
||||
return true
|
||||
case "url":
|
||||
return parent == "audio_url" || parent == "audiourl" || parent == "prompt_audio_url" || parent == "promptaudiourl"
|
||||
}
|
||||
contentType := strings.ToLower(strings.TrimSpace(asset.ContentType))
|
||||
return strings.HasPrefix(contentType, "audio/")
|
||||
}
|
||||
|
||||
func requestAssetCapabilityHydrationForMedia(kind string, candidate store.RuntimeModelCandidate, urlValue string, storageProvider string) (requestAssetHydrationStyle, bool) {
|
||||
if kind != "image" {
|
||||
return "", false
|
||||
|
||||
Reference in New Issue
Block a user