extractThinkingConfig extracts provider-specific thinking config from request body.
(body []byte, provider string)
| 405 | |
| 406 | // extractThinkingConfig extracts provider-specific thinking config from request body. |
| 407 | func 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 | |
| 429 | func hasThinkingConfig(config ThinkingConfig) bool { |
| 430 | return config.Mode != ModeBudget || config.Budget != 0 || config.Level != "" |
no test coverage detected