Unverified Commit b97eb2b8 authored by Patrick Devine's avatar Patrick Devine Committed by GitHub
Browse files

cloud: set the proxy content-type to the same as local models (#12759)

parent ad6f6a1d
...@@ -289,6 +289,12 @@ func (s *Server) GenerateHandler(c *gin.Context) { ...@@ -289,6 +289,12 @@ func (s *Server) GenerateHandler(c *gin.Context) {
return return
} }
contentType := "application/json; charset=utf-8"
if req.Stream != nil && *req.Stream {
contentType = "application/x-ndjson"
}
c.Header("Content-Type", contentType)
return return
} }
...@@ -1932,6 +1938,12 @@ func (s *Server) ChatHandler(c *gin.Context) { ...@@ -1932,6 +1938,12 @@ func (s *Server) ChatHandler(c *gin.Context) {
return return
} }
contentType := "application/json; charset=utf-8"
if req.Stream != nil && *req.Stream {
contentType = "application/x-ndjson"
}
c.Header("Content-Type", contentType)
return return
} }
......
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 to comment