MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / _fallback

Method _fallback

tests/test_middleware.py:164–167  ·  view source on GitHub ↗
(self, request: APIRequest)

Source from the content-addressed store, hash-verified

162 self.fallback_model = fallback_model
163
164 def _fallback(self, request: APIRequest) -> APIRequest:
165 body = request.json
166 assert isinstance(body, dict)
167 return request.copy(body={**cast("dict[str, object]", body), "model": self.fallback_model})
168
169 @override
170 def handle(self, request: APIRequest, call_next: CallNext) -> Any:

Callers 2

handleMethod · 0.95
handle_asyncMethod · 0.95

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected