new sdk v0.1.85 (#2421)
This commit is contained in:
@@ -7,16 +7,8 @@ from .http_client import AsyncHttpClient
|
||||
|
||||
|
||||
class BaseClientWrapper:
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
api_key: typing.Optional[str] = None,
|
||||
authorization: typing.Optional[str] = None,
|
||||
base_url: str,
|
||||
timeout: typing.Optional[float] = None,
|
||||
):
|
||||
def __init__(self, *, api_key: typing.Optional[str] = None, base_url: str, timeout: typing.Optional[float] = None):
|
||||
self._api_key = api_key
|
||||
self._authorization = authorization
|
||||
self._base_url = base_url
|
||||
self._timeout = timeout
|
||||
|
||||
@@ -28,8 +20,6 @@ class BaseClientWrapper:
|
||||
}
|
||||
if self._api_key is not None:
|
||||
headers["x-api-key"] = self._api_key
|
||||
if self._authorization is not None:
|
||||
headers["authorization"] = self._authorization
|
||||
return headers
|
||||
|
||||
def get_base_url(self) -> str:
|
||||
@@ -44,12 +34,11 @@ class SyncClientWrapper(BaseClientWrapper):
|
||||
self,
|
||||
*,
|
||||
api_key: typing.Optional[str] = None,
|
||||
authorization: typing.Optional[str] = None,
|
||||
base_url: str,
|
||||
timeout: typing.Optional[float] = None,
|
||||
httpx_client: httpx.Client,
|
||||
):
|
||||
super().__init__(api_key=api_key, authorization=authorization, base_url=base_url, timeout=timeout)
|
||||
super().__init__(api_key=api_key, base_url=base_url, timeout=timeout)
|
||||
self.httpx_client = HttpClient(
|
||||
httpx_client=httpx_client,
|
||||
base_headers=self.get_headers,
|
||||
@@ -63,12 +52,11 @@ class AsyncClientWrapper(BaseClientWrapper):
|
||||
self,
|
||||
*,
|
||||
api_key: typing.Optional[str] = None,
|
||||
authorization: typing.Optional[str] = None,
|
||||
base_url: str,
|
||||
timeout: typing.Optional[float] = None,
|
||||
httpx_client: httpx.AsyncClient,
|
||||
):
|
||||
super().__init__(api_key=api_key, authorization=authorization, base_url=base_url, timeout=timeout)
|
||||
super().__init__(api_key=api_key, base_url=base_url, timeout=timeout)
|
||||
self.httpx_client = AsyncHttpClient(
|
||||
httpx_client=httpx_client,
|
||||
base_headers=self.get_headers,
|
||||
|
||||
Reference in New Issue
Block a user