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

Method handle_async

tests/test_middleware.py:150–154  ·  view source on GitHub ↗
(self, request: APIRequest, call_next: AsyncCallNext)

Source from the content-addressed store, hash-verified

148
149 @override
150 async def handle_async(self, request: APIRequest, call_next: AsyncCallNext) -> Any:
151 response = await call_next(request)
152 if response.status_code == 529:
153 return await call_next(self._fallback(request))
154 return response
155
156
157class ShrinkMaxTokensOnTooLarge(Middleware):

Callers

nothing calls this directly

Calls 1

_fallbackMethod · 0.95

Tested by

no test coverage detected