Commit 14399d61 by Calcium-Ion Committed by GitHub

Merge pull request #746 from zjjxwhh/main

fix: always use modelMapping in channel test
parents d4855da0 5bebd376
...@@ -58,17 +58,17 @@ func testChannel(channel *model.Channel, testModel string) (err error, openAIErr ...@@ -58,17 +58,17 @@ func testChannel(channel *model.Channel, testModel string) (err error, openAIErr
testModel = "gpt-3.5-turbo" testModel = "gpt-3.5-turbo"
} }
} }
} else { }
modelMapping := *channel.ModelMapping
if modelMapping != "" && modelMapping != "{}" { modelMapping := *channel.ModelMapping
modelMap := make(map[string]string) if modelMapping != "" && modelMapping != "{}" {
err := json.Unmarshal([]byte(modelMapping), &modelMap) modelMap := make(map[string]string)
if err != nil { err := json.Unmarshal([]byte(modelMapping), &modelMap)
return err, service.OpenAIErrorWrapperLocal(err, "unmarshal_model_mapping_failed", http.StatusInternalServerError) if err != nil {
} return err, service.OpenAIErrorWrapperLocal(err, "unmarshal_model_mapping_failed", http.StatusInternalServerError)
if modelMap[testModel] != "" { }
testModel = modelMap[testModel] if modelMap[testModel] != "" {
} testModel = modelMap[testModel]
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment