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

Function extractCodexConfig

internal/thinking/apply.go:637–648  ·  view source on GitHub ↗

extractCodexConfig extracts thinking configuration from Codex format request body. Codex API format (OpenAI Responses API): - reasoning.effort: "none", "low", "medium", "high" This is similar to OpenAI but uses nested field "reasoning.effort" instead of "reasoning_effort".

(body []byte)

Source from the content-addressed store, hash-verified

635//
636// This is similar to OpenAI but uses nested field "reasoning.effort" instead of "reasoning_effort".
637func extractCodexConfig(body []byte) ThinkingConfig {
638 // Check reasoning.effort (Codex / OpenAI Responses API format)
639 if effort := gjson.GetBytes(body, "reasoning.effort"); effort.Exists() {
640 value := effort.String()
641 if value == "none" {
642 return ThinkingConfig{Mode: ModeNone, Budget: 0}
643 }
644 return ThinkingConfig{Mode: ModeLevel, Level: ThinkingLevel(value)}
645 }
646
647 return ThinkingConfig{}
648}

Callers 3

extractThinkingConfigFunction · 0.85
ExtractReasoningEffortFunction · 0.85

Calls 2

ThinkingLevelTypeAlias · 0.85
StringMethod · 0.45

Tested by

no test coverage detected