| 1334 | |
| 1335 | |
| 1336 | class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): |
| 1337 | def __del__(self) -> None: |
| 1338 | if self.is_closed: |
| 1339 | return |
| 1340 | |
| 1341 | try: |
| 1342 | # TODO(someday): support non asyncio runtimes here |
| 1343 | asyncio.get_running_loop().create_task(self.aclose()) |
| 1344 | except Exception: |
| 1345 | pass |
| 1346 | |
| 1347 | |
| 1348 | class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]): |