mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-08-18 03:57:06 +08:00
19 lines
385 B
Go
19 lines
385 B
Go
package modeladapter
|
|
|
|
func maxAnthropicTokens(req StreamRequest) int {
|
|
if req.AnthropicMaxTokens > 0 {
|
|
return req.AnthropicMaxTokens
|
|
}
|
|
if req.MaxTokens > 0 {
|
|
return req.MaxTokens
|
|
}
|
|
return 65536
|
|
}
|
|
|
|
func maxThinkingBudget(req StreamRequest) int {
|
|
if req.ThinkingBudgetTokens > 0 {
|
|
return req.ThinkingBudgetTokens
|
|
}
|
|
return anthropicThinkingBudget(maxAnthropicTokens(req))
|
|
}
|