mirror of
https://github.com/zebrajr/ollama.git
synced 2025-12-06 00:19:51 +01:00
cloud: set the proxy content-type to the same as local models (#12759)
This commit is contained in:
parent
ad6f6a1d29
commit
b97eb2b858
|
|
@ -289,6 +289,12 @@ func (s *Server) GenerateHandler(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
contentType := "application/json; charset=utf-8"
|
||||
if req.Stream != nil && *req.Stream {
|
||||
contentType = "application/x-ndjson"
|
||||
}
|
||||
c.Header("Content-Type", contentType)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -1932,6 +1938,12 @@ func (s *Server) ChatHandler(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
contentType := "application/json; charset=utf-8"
|
||||
if req.Stream != nil && *req.Stream {
|
||||
contentType = "application/x-ndjson"
|
||||
}
|
||||
c.Header("Content-Type", contentType)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user