Spaces:
Runtime error
Runtime error
from dependency_injector.resources import AsyncResource | |
from httpx import AsyncClient | |
from typing import Self | |
# TODO: Implement HTTPClientService to abstract away underlying HTTP client. | |
class HTTPClientServiceResource(AsyncResource): | |
async def init(self: Self) -> AsyncClient: | |
return AsyncClient() | |
async def shutdown(self: Self, client: AsyncClient) -> None: | |
await client.aclose() | |