Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
server: only parse tool calls if tools are provided (#5771)
Jeffrey Morgan319fb1ce0339
diff --git a/server/routes.go b/server/routes.goindex b4a8b4acc..347d5221a 100644--- a/server/routes.go+++ b/server/routes.go@@ -1385,9 +1385,12 @@ func (s *Server) ChatHandler(c *gin.Context) {}resp.Message.Content = sb.String()- if toolCalls, ok := m.parseToolCalls(sb.String()); ok {- resp.Message.ToolCalls = toolCalls- resp.Message.Content = ""++ if len(req.Tools) > 0 {+ if toolCalls, ok := m.parseToolCalls(sb.String()); ok {+ resp.Message.ToolCalls = toolCalls+ resp.Message.Content = ""+ }}c.JSON(http.StatusOK, resp)