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

Method _fallback

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

Source from the content-addressed store, hash-verified

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