server: omit model system prompt if empty (#5717)

This commit is contained in:
Jeffrey Morgan 2024-07-16 11:09:00 -07:00 committed by GitHub
parent 8eac50dd4f
commit 4cb5d7decc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1310,7 +1310,7 @@ func (s *Server) ChatHandler(c *gin.Context) {
return return
} }
if req.Messages[0].Role != "system" { if req.Messages[0].Role != "system" && m.System != "" {
req.Messages = append([]api.Message{{Role: "system", Content: m.System}}, req.Messages...) req.Messages = append([]api.Message{{Role: "system", Content: m.System}}, req.Messages...)
} }