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

Method _fallback

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

Source from the content-addressed store, hash-verified

134 self.fallback_model = fallback_model
135
136 def _fallback(self, request: APIRequest) -> APIRequest:
137 body = request.json
138 assert isinstance(body, dict)
139 return request.copy(body={**cast("dict[str, object]", body), "model": self.fallback_model})
140
141 @override
142 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