Skip to content

Commit c06a3c1

Browse files
committed
Add support for custom AidboxClient class
1 parent a7aaf68 commit c06a3c1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

aidbox_python_sdk/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ async def register_app(sdk: SDK, client: AsyncAidboxClient):
5151

5252

5353
async def init_client(settings: Settings):
54+
AidboxClient = settings.AIDBOX_CLIENT_CLASS
5455
basic_auth = BasicAuth(
5556
login=settings.APP_INIT_CLIENT_ID,
5657
password=settings.APP_INIT_CLIENT_SECRET,
5758
)
5859

59-
return AsyncAidboxClient(
60+
return AidboxClient(
6061
"{}".format(settings.APP_INIT_URL), authorization=basic_auth.encode()
6162
)
6263

aidbox_python_sdk/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import os
22
from pathlib import Path
33

4+
from .aidboxpy import AsyncAidboxClient
5+
46

57
class Required:
68
def __init__(self, v_type=None):
@@ -30,6 +32,7 @@ class Settings:
3032
APP_SECRET = Required(v_type=str)
3133
AIO_HOST = Required(v_type=str)
3234
AIO_PORT = Required(v_type=str)
35+
AIDBOX_CLIENT_CLASS = AsyncAidboxClient
3336

3437
def __init__(self, **custom_settings):
3538
"""

0 commit comments

Comments
 (0)