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)
| 616 | // OpenAI uses level-based thinking configuration only, no numeric budget support. |
| 617 | // The "none" value is treated specially to return ModeNone. |
| 618 | func 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 | // |
no test coverage detected