mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-28 04:13:42 +08:00
Compare commits
2 Commits
v0.5.2-alp
...
v0.5.2-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec88c0c240 | ||
|
|
065147b440 |
@@ -23,6 +23,8 @@ func testChannel(channel *model.Channel, request ChatRequest) (error, *OpenAIErr
|
|||||||
case common.ChannelTypeBaidu:
|
case common.ChannelTypeBaidu:
|
||||||
fallthrough
|
fallthrough
|
||||||
case common.ChannelTypeZhipu:
|
case common.ChannelTypeZhipu:
|
||||||
|
fallthrough
|
||||||
|
case common.ChannelTypeXunfei:
|
||||||
return errors.New("该渠道类型当前版本不支持测试,请手动测试"), nil
|
return errors.New("该渠道类型当前版本不支持测试,请手动测试"), nil
|
||||||
case common.ChannelTypeAzure:
|
case common.ChannelTypeAzure:
|
||||||
request.Model = "gpt-35-turbo"
|
request.Model = "gpt-35-turbo"
|
||||||
|
|||||||
@@ -205,6 +205,10 @@ func xunfeiStreamHandler(c *gin.Context, textRequest GeneralOpenAIRequest, appId
|
|||||||
}
|
}
|
||||||
dataChan <- response
|
dataChan <- response
|
||||||
if response.Payload.Choices.Status == 2 {
|
if response.Payload.Choices.Status == 2 {
|
||||||
|
err := conn.Close()
|
||||||
|
if err != nil {
|
||||||
|
common.SysError("error closing websocket connection: " + err.Error())
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user