mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-05 23:24:05 +08:00
fix: unable to control enable think in chat (#17785)
This commit is contained in:
@@ -131,6 +131,7 @@ type ChatCompletionsRequest struct {
|
||||
StoreHistory *bool `json:"store_history,omitempty"`
|
||||
Legacy bool `json:"legacy,omitempty"`
|
||||
Stream *bool `json:"stream"`
|
||||
Thinking string `json:"thinking"`
|
||||
Temperature *float64 `json:"temperature,omitempty"`
|
||||
TopP *float64 `json:"top_p,omitempty"`
|
||||
FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"`
|
||||
@@ -182,6 +183,15 @@ func (h *ChatSessionHandler) ChatCompletions(c *gin.Context) {
|
||||
|
||||
// Build generation config
|
||||
genConfig := make(map[string]interface{})
|
||||
if req.Thinking != "" {
|
||||
switch req.Thinking {
|
||||
case "enabled":
|
||||
genConfig["thinking"] = true
|
||||
case "disabled":
|
||||
genConfig["thinking"] = false
|
||||
case "", "default":
|
||||
}
|
||||
}
|
||||
if req.Temperature != nil {
|
||||
genConfig["temperature"] = *req.Temperature
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user