|
@@ -1385,9 +1385,12 @@ func (s *Server) ChatHandler(c *gin.Context) {
|
|
}
|
|
}
|
|
|
|
|
|
resp.Message.Content = sb.String()
|
|
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)
|
|
c.JSON(http.StatusOK, resp)
|