You've already forked RekomenciBackend
add pipline
This commit is contained in:
@@ -2,10 +2,12 @@ from collections.abc import AsyncIterable
|
||||
|
||||
from aioboto3.session import Session
|
||||
from dishka import Provider, Scope, provide
|
||||
from httpx import AsyncClient
|
||||
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, create_async_engine
|
||||
|
||||
from template_project.adapters.ml_api_gateway import MlApiGateway
|
||||
from template_project.adapters.s3_storage import AioBoto3ClientLike
|
||||
from template_project.web_api.configuration import DatabaseConfiguration, S3Config
|
||||
from template_project.web_api.configuration import DatabaseConfiguration, MlApiConfiguration, S3Config
|
||||
|
||||
|
||||
class ConnectionProvider(Provider):
|
||||
@@ -35,3 +37,8 @@ class ConnectionProvider(Provider):
|
||||
aws_secret_access_key=config.secret_key,
|
||||
) as s3_client:
|
||||
yield s3_client
|
||||
|
||||
@provide(scope=Scope.APP)
|
||||
async def ml_api_gateway(self, config: MlApiConfiguration) -> AsyncIterable[MlApiGateway]:
|
||||
async with AsyncClient(base_url=config.url) as client:
|
||||
yield MlApiGateway(client)
|
||||
|
||||
Reference in New Issue
Block a user