Skip to content

Commit 605c44c

Browse files
committed
fix: default base_url to http client passed
1 parent cd67365 commit 605c44c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

portkey_ai/api_resources/base_client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ def __init__(
180180
)
181181

182182
self.allHeaders = self._build_headers(create_model_instance(Options))
183+
if http_client:
184+
http_client.base_url = (
185+
http_client.base_url if http_client.base_url != "" else self.base_url
186+
)
187+
183188
self._client = http_client or httpx.Client(
184189
base_url=self.base_url,
185190
headers={
@@ -895,6 +900,10 @@ def __init__(
895900
)
896901

897902
self.allHeaders = self._build_headers(create_model_instance(Options))
903+
if http_client:
904+
http_client.base_url = (
905+
http_client.base_url if http_client.base_url != "" else self.base_url
906+
)
898907
self._client = http_client or AsyncHttpxClientWrapper(
899908
base_url=self.base_url,
900909
headers={

0 commit comments

Comments
 (0)