Skip to content

Commit 122c68c

Browse files
authored
server: loosen thinking level constraint (#14625)
1 parent 82848a7 commit 122c68c

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

server/routes.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,6 @@ func (s *Server) GenerateHandler(c *gin.Context) {
370370
}
371371
}
372372

373-
// Validate Think value: string values currently only allowed for harmony/gptoss models
374-
if req.Think != nil && req.Think.IsString() && m.Config.Parser != "harmony" {
375-
c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("think value %q is not supported for this model", req.Think.String())})
376-
return
377-
}
378-
379373
caps := []model.Capability{model.CapabilityCompletion}
380374
if req.Suffix != "" {
381375
caps = append(caps, model.CapabilityInsert)
@@ -2240,12 +2234,6 @@ func (s *Server) ChatHandler(c *gin.Context) {
22402234
return
22412235
}
22422236

2243-
// Validate Think value: string values currently only allowed for harmony/gptoss models
2244-
if req.Think != nil && req.Think.IsString() && m.Config.Parser != "harmony" {
2245-
c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("think value %q is not supported for this model", req.Think.String())})
2246-
return
2247-
}
2248-
22492237
var thinkingState *thinking.Parser
22502238
openingTag, closingTag := thinking.InferTags(m.Template.Template)
22512239
if req.Think != nil && req.Think.Bool() && openingTag != "" && closingTag != "" {

0 commit comments

Comments
 (0)