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

Function extractOpenAIConfig

internal/thinking/apply.go:618–629  ·  view source on GitHub ↗

extractOpenAIConfig extracts thinking configuration from OpenAI format request body. OpenAI API format: - reasoning_effort: "none", "low", "medium", "high" (discrete levels) OpenAI uses level-based thinking configuration only, no numeric budget support. The "none" value is treated specially to ret

(body []byte)

Source from the content-addressed store, hash-verified

616// OpenAI uses level-based thinking configuration only, no numeric budget support.
617// The "none" value is treated specially to return ModeNone.
618func extractOpenAIConfig(body []byte) ThinkingConfig {
619 // Check reasoning_effort (OpenAI Chat Completions format)
620 if effort := gjson.GetBytes(body, "reasoning_effort"); effort.Exists() {
621 value := effort.String()
622 if value == "none" {
623 return ThinkingConfig{Mode: ModeNone, Budget: 0}
624 }
625 return ThinkingConfig{Mode: ModeLevel, Level: ThinkingLevel(value)}
626 }
627
628 return ThinkingConfig{}
629}
630
631// extractCodexConfig extracts thinking configuration from Codex format request body.
632//

Callers 2

extractThinkingConfigFunction · 0.85

Calls 2

ThinkingLevelTypeAlias · 0.85
StringMethod · 0.45

Tested by

no test coverage detected