mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 20:30:51 +08:00
fix(thinking): map reasoning_effort to thinkingConfig
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
package thinking
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
@@ -44,29 +43,6 @@ func ParseSuffix(model string) SuffixResult {
|
||||
}
|
||||
}
|
||||
|
||||
// ParseSuffixWithError extracts thinking suffix and returns an error on invalid format.
|
||||
//
|
||||
// Invalid format cases:
|
||||
// - Contains "(" but does not end with ")"
|
||||
// - Contains ")" without any "("
|
||||
//
|
||||
// The error message includes the original input for debugging context.
|
||||
func ParseSuffixWithError(model string) (SuffixResult, error) {
|
||||
lastOpen := strings.LastIndex(model, "(")
|
||||
if lastOpen == -1 {
|
||||
if strings.Contains(model, ")") {
|
||||
return SuffixResult{ModelName: model, HasSuffix: false}, NewThinkingError(ErrInvalidSuffix, fmt.Sprintf("invalid suffix format: %s", model))
|
||||
}
|
||||
return SuffixResult{ModelName: model, HasSuffix: false}, nil
|
||||
}
|
||||
|
||||
if !strings.HasSuffix(model, ")") {
|
||||
return SuffixResult{ModelName: model, HasSuffix: false}, NewThinkingError(ErrInvalidSuffix, fmt.Sprintf("invalid suffix format: %s", model))
|
||||
}
|
||||
|
||||
return ParseSuffix(model), nil
|
||||
}
|
||||
|
||||
// ParseNumericSuffix attempts to parse a raw suffix as a numeric budget value.
|
||||
//
|
||||
// This function parses the raw suffix content (from ParseSuffix.RawSuffix) as an integer.
|
||||
|
||||
Reference in New Issue
Block a user