This commit is contained in:
c菌
2023-09-15 23:09:43 +08:00
parent 7df0b2817c
commit de31741d06
2 changed files with 111 additions and 42 deletions

View File

@@ -511,6 +511,16 @@ func HandleProy(c *gin.Context) {
onekey := store.FromKeyCacheRandomItemKey()
// 创建 API 请求
switch onekey.ApiType {
case "claude":
payload, _ := claude.TransReq(&chatreq)
buildurl := "https://api.anthropic.com/v1/complete"
req, err = http.NewRequest("POST", buildurl, payload)
req.Header.Add("accept", "application/json")
req.Header.Add("anthropic-version", "2023-06-01")
req.Header.Add("x-api-key", onekey.Key)
req.Header.Add("content-type", "application/json")
case "azure":
fallthrough
case "azure_openai":
var buildurl string
var apiVersion = "2023-05-15"