OpenAI: Function Based Testing (#5752)

* distinguish error forwarding

* more coverage

* rm comment
This commit is contained in:
royjhan 2024-07-19 11:37:12 -07:00 committed by GitHub
parent 51b2fd299c
commit c57317cbf0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 279 additions and 183 deletions

View file

@ -877,6 +877,7 @@ func ChatMiddleware() gin.HandlerFunc {
chatReq, err := fromChatRequest(req)
if err != nil {
c.AbortWithStatusJSON(http.StatusBadRequest, NewError(http.StatusBadRequest, err.Error()))
return
}
if err := json.NewEncoder(&b).Encode(chatReq); err != nil {