Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
|
|
@ -0,0 +1,28 @@
|
|||
package helps
|
||||
|
||||
import (
|
||||
"github.com/router-for-me/CLIProxyAPI/v7/internal/thinking"
|
||||
cliproxyauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
|
||||
cliproxyexecutor "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/executor"
|
||||
)
|
||||
|
||||
// APIKeyModelIsCompat reports whether the selected API-key model enables
|
||||
// compatibility handling for Claude thinking blocks.
|
||||
func APIKeyModelIsCompat(req cliproxyexecutor.Request) bool {
|
||||
modelInfo, ok := cliproxyauth.ResolvedAPIKeyModelInfo(req)
|
||||
return ok && modelInfo != nil && modelInfo.IsCompat
|
||||
}
|
||||
|
||||
// ApplyRequestThinking preserves the registry lookup path unless the auth
|
||||
// manager bound an exact configured API-key model definition to this attempt.
|
||||
func ApplyRequestThinking(body []byte, req cliproxyexecutor.Request, opts cliproxyexecutor.Options, fromFormat, toFormat, provider string) ([]byte, error) {
|
||||
originalSource := opts.OriginalRequest
|
||||
if len(originalSource) == 0 {
|
||||
originalSource = req.Payload
|
||||
}
|
||||
summaryConfig := translatedRequestSummaryConfig(body, req.Payload, originalSource, req.Model, fromFormat, toFormat)
|
||||
if modelInfo, ok := cliproxyauth.ResolvedAPIKeyModelInfo(req); ok {
|
||||
return thinking.ApplyThinkingWithModelInfoAndSummary(body, originalSource, req.Model, fromFormat, toFormat, provider, modelInfo, summaryConfig)
|
||||
}
|
||||
return thinking.ApplyThinkingWithSummary(body, req.Model, fromFormat, toFormat, provider, summaryConfig)
|
||||
}
|
||||
Loading…
Reference in a new issue