合并请求

This commit is contained in:
CaIon
2023-09-09 03:19:55 +08:00
parent 9c08d78349
commit 443e2bd168
3 changed files with 21 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package controller
import (
"fmt"
"log"
"net/http"
"one-api/common"
"strconv"
@@ -171,6 +172,23 @@ type CompletionsStreamResponse struct {
} `json:"choices"`
}
type MidjourneyRequest struct {
Prompt string `json:"prompt"`
NotifyHook string `json:"notifyHook"`
Action string `json:"action"`
Index int `json:"index"`
State string `json:"state"`
TaskId string `json:"taskId"`
Base64Array []string `json:"base64Array"`
}
type MidjourneyResponse struct {
Code int `json:"code"`
Description string `json:"description"`
Properties interface{} `json:"properties"`
Result string `json:"result"`
}
func Relay(c *gin.Context) {
relayMode := RelayModeUnknown
if strings.HasPrefix(c.Request.URL.Path, "/v1/chat/completions") {