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

Function _can_reuse_native_anthropic_body

uncommon_route/proxy.py:2272–2282  ·  view source on GitHub ↗
(
    *,
    upstream_body: dict[str, Any],
    source_preview_body: dict[str, Any] | None,
)

Source from the content-addressed store, hash-verified

2270
2271
2272def _can_reuse_native_anthropic_body(
2273 *,
2274 upstream_body: dict[str, Any],
2275 source_preview_body: dict[str, Any] | None,
2276) -> bool:
2277 if source_preview_body is None:
2278 return False
2279 for key in ("messages", "tools", "tool_choice", "temperature", "top_p", "stream", "stop"):
2280 if upstream_body.get(key) != source_preview_body.get(key):
2281 return False
2282 return True
2283
2284
2285def _contains_anthropic_thinking_blocks(body: dict[str, Any] | None) -> bool:

Callers 1

_prepare_attemptFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected