mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-12 15:21:09 +00:00
feat(task): replace built-in task adaptors with a sandboxed JS plugin system (#7076)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package constant
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -36,10 +35,6 @@ const (
|
||||
RelayModeAudioTranscription // whisper
|
||||
RelayModeAudioTranslation // whisper
|
||||
|
||||
RelayModeSunoFetch
|
||||
RelayModeSunoFetchByID
|
||||
RelayModeSunoSubmit
|
||||
|
||||
RelayModeVideoFetchByID
|
||||
RelayModeVideoSubmit
|
||||
|
||||
@@ -140,15 +135,3 @@ func Path2RelayModeMidjourney(path string) int {
|
||||
}
|
||||
return relayMode
|
||||
}
|
||||
|
||||
func Path2RelaySuno(method, path string) int {
|
||||
relayMode := RelayModeUnknown
|
||||
if method == http.MethodPost && strings.HasSuffix(path, "/fetch") {
|
||||
relayMode = RelayModeSunoFetch
|
||||
} else if method == http.MethodGet && strings.Contains(path, "/fetch/") {
|
||||
relayMode = RelayModeSunoFetchByID
|
||||
} else if strings.Contains(path, "/submit/") {
|
||||
relayMode = RelayModeSunoSubmit
|
||||
}
|
||||
return relayMode
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user