MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _contains_anthropic_thinking_blocks

Function _contains_anthropic_thinking_blocks

uncommon_route/proxy.py:2285–2300  ·  view source on GitHub ↗
(body: dict[str, Any] | None)

Source from the content-addressed store, hash-verified

2283
2284
2285def _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
2303def _merge_available_models(

Callers 2

_reasoning_preferenceFunction · 0.85
_prepare_attemptFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected