MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / extractThinkingConfig

Function extractThinkingConfig

internal/thinking/apply.go:407–427  ·  view source on GitHub ↗

extractThinkingConfig extracts provider-specific thinking config from request body.

(body []byte, provider string)

Source from the content-addressed store, hash-verified

405
406// extractThinkingConfig extracts provider-specific thinking config from request body.
407func extractThinkingConfig(body []byte, provider string) ThinkingConfig {
408 if len(body) == 0 || !gjson.ValidBytes(body) {
409 return ThinkingConfig{}
410 }
411
412 switch provider {
413 case "claude":
414 return extractClaudeConfig(body)
415 case "gemini", "antigravity":
416 return extractGeminiConfig(body, provider)
417 case "openai":
418 return extractOpenAIConfig(body)
419 case "codex", "xai":
420 return extractCodexConfig(body)
421 case "kimi":
422 // Kimi uses OpenAI-compatible reasoning_effort format
423 return extractOpenAIConfig(body)
424 default:
425 return ThinkingConfig{}
426 }
427}
428
429func hasThinkingConfig(config ThinkingConfig) bool {
430 return config.Mode != ModeBudget || config.Budget != 0 || config.Level != ""

Callers 4

ApplyThinkingFunction · 0.85
applyUserDefinedModelFunction · 0.85
ExtractReasoningEffortFunction · 0.85

Calls 4

extractClaudeConfigFunction · 0.85
extractGeminiConfigFunction · 0.85
extractOpenAIConfigFunction · 0.85
extractCodexConfigFunction · 0.85

Tested by

no test coverage detected