mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-01 19:41:57 +00:00
43 lines
1.4 KiB
Go
43 lines
1.4 KiB
Go
package constant
|
|
|
|
type TaskPlatform string
|
|
|
|
const (
|
|
TaskPlatformSuno TaskPlatform = "suno"
|
|
TaskPlatformMidjourney = "mj"
|
|
)
|
|
|
|
const (
|
|
TaskActionImageToVideo = "image_to_video"
|
|
TaskActionTextToVideo = "text_to_video"
|
|
TaskActionFirstTailToVideo = "first_tail_to_video"
|
|
TaskActionReferenceToVideo = "reference_to_video"
|
|
TaskActionRemix = "remix"
|
|
)
|
|
|
|
var legacyTaskActionAliases = map[string]string{
|
|
"generate": TaskActionImageToVideo,
|
|
"textGenerate": TaskActionTextToVideo,
|
|
"firstTailGenerate": TaskActionFirstTailToVideo,
|
|
"referenceGenerate": TaskActionReferenceToVideo,
|
|
"remixGenerate": TaskActionRemix,
|
|
}
|
|
|
|
// TaskPluginEnabled is the master switch for the whole task-plugin system.
|
|
// When disabled, factory and override plugins both stop serving.
|
|
var TaskPluginEnabled = true
|
|
|
|
// TaskPluginOverrideEnabled controls whether the database override layer is
|
|
// active. When disabled, uploaded plugins are ignored and factory plugins are
|
|
// used instead; the factory layer is unaffected.
|
|
var TaskPluginOverrideEnabled = true
|
|
|
|
// NormalizeTaskAction maps persisted legacy action names to the canonical task
|
|
// action vocabulary. Unknown platform-specific actions pass through unchanged.
|
|
func NormalizeTaskAction(action string) string {
|
|
if canonical, ok := legacyTaskActionAliases[action]; ok {
|
|
return canonical
|
|
}
|
|
return action
|
|
}
|