fix: using the first available model if default model is not found (close #1021)
This commit is contained in:
parent
c6ace985c2
commit
95cfb8e8c9
@ -19,6 +19,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -61,6 +62,12 @@ func testChannel(channel *model.Channel) (err error, openaiErr *relaymodel.Error
|
|||||||
}
|
}
|
||||||
adaptor.Init(meta)
|
adaptor.Init(meta)
|
||||||
modelName := adaptor.GetModelList()[0]
|
modelName := adaptor.GetModelList()[0]
|
||||||
|
if !strings.Contains(channel.Models, modelName) {
|
||||||
|
modelNames := strings.Split(channel.Models, ",")
|
||||||
|
if len(modelNames) > 0 {
|
||||||
|
modelName = modelNames[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
request := buildTestRequest()
|
request := buildTestRequest()
|
||||||
request.Model = modelName
|
request.Model = modelName
|
||||||
meta.OriginModelName, meta.ActualModelName = modelName, modelName
|
meta.OriginModelName, meta.ActualModelName = modelName, modelName
|
||||||
|
Loading…
Reference in New Issue
Block a user