fix keep alive

this reference to keep alive was missed in #12041 so chat has a
diffferent behaviour than generate
This commit is contained in:
Michael Yang
2025-09-30 17:12:37 -07:00
committed by Michael Yang
parent 3d0b1734c0
commit 35ac4eb12c

View File

@@ -1777,7 +1777,7 @@ func (s *Server) ChatHandler(c *gin.Context) {
} }
// expire the runner // expire the runner
if len(req.Messages) == 0 && req.KeepAlive != nil && int(req.KeepAlive.Seconds()) == 0 { if len(req.Messages) == 0 && req.KeepAlive != nil && req.KeepAlive.Duration == 0 {
s.sched.expireRunner(m) s.sched.expireRunner(m)
c.JSON(http.StatusOK, api.ChatResponse{ c.JSON(http.StatusOK, api.ChatResponse{