server/routes: catch when JSON tool was used
This commit is contained in:
parent
610054a234
commit
7f2f996cd6
@ -1553,12 +1553,13 @@ func (s *Server) ChatHandler(c *gin.Context) {
|
|||||||
toolCallIndex++
|
toolCallIndex++
|
||||||
}
|
}
|
||||||
res.Message.Content = ""
|
res.Message.Content = ""
|
||||||
sb.Reset()
|
|
||||||
ch <- res
|
ch <- res
|
||||||
// Only way to have multiple calls is to have [] which is derived or provided
|
// Only way to have multiple calls is to have [] which is derived or provided
|
||||||
if templateToolToken == "" {
|
// This case occurs when the tool call is a json block - do not allow tool calls again
|
||||||
|
if templateToolToken == "" || (templateToolToken != "" && !strings.HasPrefix(sb.String(), templateToolToken)) {
|
||||||
checkToolCall = false
|
checkToolCall = false
|
||||||
}
|
}
|
||||||
|
sb.Reset()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user