mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
fix(executor): properly handle thinking application errors
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// Package thinking provides unified thinking configuration processing logic.
|
||||
package thinking
|
||||
|
||||
import "net/http"
|
||||
|
||||
// ErrorCode represents the type of thinking configuration error.
|
||||
type ErrorCode string
|
||||
|
||||
@@ -69,3 +71,8 @@ func NewThinkingErrorWithModel(code ErrorCode, message, model string) *ThinkingE
|
||||
Model: model,
|
||||
}
|
||||
}
|
||||
|
||||
// StatusCode implements a portable status code interface for HTTP handlers.
|
||||
func (e *ThinkingError) StatusCode() int {
|
||||
return http.StatusBadRequest
|
||||
}
|
||||
|
||||
@@ -55,6 +55,9 @@ func (a *Applier) Apply(body []byte, config thinking.ThinkingConfig, modelInfo *
|
||||
if config.Mode == thinking.ModeAuto {
|
||||
return a.applyBudgetFormat(body, config)
|
||||
}
|
||||
if config.Mode == thinking.ModeBudget {
|
||||
return a.applyBudgetFormat(body, config)
|
||||
}
|
||||
|
||||
// For non-auto modes, choose format based on model capabilities
|
||||
support := modelInfo.Thinking
|
||||
|
||||
Reference in New Issue
Block a user