"vscode:/vscode.git/clone" did not exist on "abc32537ea68ae3b8c452f3e5e4a1b3ce0f96e30"
Unverified Commit 319fb1ce authored by Jeffrey Morgan's avatar Jeffrey Morgan Committed by GitHub
Browse files

server: only parse tool calls if tools are provided (#5771)

* server: only parse tool calls if tools are provided

* still set `resp.Message.Content`
parent b2554455
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment