fix: always use modelMapping in channel test

This commit is contained in:
zjjxwhh
2025-02-10 22:39:56 +08:00
parent 8418dbe7c4
commit 882c5970d9

View File

@@ -58,7 +58,8 @@ func testChannel(channel *model.Channel, testModel string) (err error, openAIErr
testModel = "gpt-3.5-turbo" testModel = "gpt-3.5-turbo"
} }
} }
} else { }
modelMapping := *channel.ModelMapping modelMapping := *channel.ModelMapping
if modelMapping != "" && modelMapping != "{}" { if modelMapping != "" && modelMapping != "{}" {
modelMap := make(map[string]string) modelMap := make(map[string]string)
@@ -70,7 +71,6 @@ func testChannel(channel *model.Channel, testModel string) (err error, openAIErr
testModel = modelMap[testModel] testModel = modelMap[testModel]
} }
} }
}
c.Request.Header.Set("Authorization", "Bearer "+channel.Key) c.Request.Header.Set("Authorization", "Bearer "+channel.Key)
c.Request.Header.Set("Content-Type", "application/json") c.Request.Header.Set("Content-Type", "application/json")