support gpt-4-1106-vision-preview

This commit is contained in:
CaIon
2023-11-17 18:24:37 +08:00
parent fc494416fc
commit 7e0d2606c3
13 changed files with 81 additions and 34 deletions

View File

@@ -86,9 +86,10 @@ func buildTestRequest() *ChatRequest {
Model: "", // this will be set later
MaxTokens: 1,
}
content, _ := json.Marshal("hi")
testMessage := Message{
Role: "user",
Content: "hi",
Content: content,
}
testRequest.Messages = append(testRequest.Messages, testMessage)
return testRequest
@@ -186,6 +187,10 @@ func testAllChannels(notify bool) error {
err = errors.New(fmt.Sprintf("响应时间 %.2fs 超过阈值 %.2fs", float64(milliseconds)/1000.0, float64(disableThreshold)/1000.0))
ban = true
}
if openaiErr != nil {
err = errors.New(fmt.Sprintf("type %s, code %v, message %s", openaiErr.Type, openaiErr.Code, openaiErr.Message))
ban = true
}
// parse *int to bool
if channel.AutoBan != nil && *channel.AutoBan == 0 {
ban = false