(
*,
upstream_body: dict[str, Any],
source_preview_body: dict[str, Any] | None,
)
| 2270 | |
| 2271 | |
| 2272 | def _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 | |
| 2285 | def _contains_anthropic_thinking_blocks(body: dict[str, Any] | None) -> bool: |