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

Method async_fn

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

Source from the content-addressed store, hash-verified

1879
1880 def test_construction_accepts_async_middleware(self) -> None:
1881 async def async_fn(request: APIRequest, call_next: AsyncCallNext) -> Any:
1882 return await call_next(request)
1883
1884 client = make_async_client(middleware=[AsyncOnlyMiddleware(), RecordingMiddleware(), async_fn])
1885 assert len(client._middleware) == 3

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected