diff --git a/src/murf/client.py b/src/murf/client.py index 4282fc5..4459f36 100644 --- a/src/murf/client.py +++ b/src/murf/client.py @@ -3,6 +3,7 @@ import typing import os import httpx +from .version import __version__ class Murf(BaseClient): """ @@ -51,6 +52,10 @@ def __init__( follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.Client] = None, ): + default_params = {'origin': f'python_sdk_{__version__}'} + _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None + httpx_client=httpx_client if httpx_client is not None else httpx.Client(params=default_params, timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.Client(params=default_params, timeout=_defaulted_timeout) + super().__init__( base_url=base_url, environment=environment, @@ -109,6 +114,10 @@ def __init__( follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.AsyncClient] = None, ): + default_params = {'origin': f'python_sdk_{__version__}'} + _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None + httpx_client=httpx_client if httpx_client is not None else httpx.AsyncClient(params=default_params, timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.AsyncClient(params=default_params, timeout=_defaulted_timeout) + super().__init__( base_url=base_url, environment=environment, diff --git a/src/murf/dubbing_client.py b/src/murf/dubbing_client.py index f22f46e..72cab6c 100644 --- a/src/murf/dubbing_client.py +++ b/src/murf/dubbing_client.py @@ -3,6 +3,7 @@ import typing import os import httpx +from .version import __version__ class MurfDub(BaseClient): """ @@ -51,6 +52,10 @@ def __init__( follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.Client] = None, ): + default_params = {'origin': f'python_sdk_{__version__}'} + _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None + httpx_client=httpx_client if httpx_client is not None else httpx.Client(params=default_params, timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.Client(params=default_params, timeout=_defaulted_timeout) + super().__init__( base_url=base_url, environment=environment, @@ -109,6 +114,10 @@ def __init__( follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.AsyncClient] = None, ): + default_params = {'origin': f'python_sdk_{__version__}'} + _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None + httpx_client=httpx_client if httpx_client is not None else httpx.AsyncClient(params=default_params, timeout=_defaulted_timeout, follow_redirects=follow_redirects) if follow_redirects is not None else httpx.AsyncClient(params=default_params, timeout=_defaulted_timeout) + super().__init__( base_url=base_url, environment=environment,