(body: dict[str, Any] | None)
| 2283 | |
| 2284 | |
| 2285 | def _contains_anthropic_thinking_blocks(body: dict[str, Any] | None) -> bool: |
| 2286 | if not isinstance(body, dict): |
| 2287 | return False |
| 2288 | messages = body.get("messages") |
| 2289 | if not isinstance(messages, list): |
| 2290 | return False |
| 2291 | for message in messages: |
| 2292 | if not isinstance(message, dict): |
| 2293 | continue |
| 2294 | content = message.get("content") |
| 2295 | if not isinstance(content, list): |
| 2296 | continue |
| 2297 | for block in content: |
| 2298 | if isinstance(block, dict) and block.get("type") in {"thinking", "redacted_thinking"}: |
| 2299 | return True |
| 2300 | return False |
| 2301 | |
| 2302 | |
| 2303 | def _merge_available_models( |
no test coverage detected