Skip to content

Commit 0aad4df

Browse files
feat(client): support passing httpx.URL instances to base_url (#138)
1 parent 78cd8ba commit 0aad4df

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/finch/_base_client.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def __init__(
331331
self,
332332
*,
333333
version: str,
334-
base_url: str,
334+
base_url: str | URL,
335335
_strict_response_validation: bool,
336336
max_retries: int = DEFAULT_MAX_RETRIES,
337337
timeout: float | Timeout | None = DEFAULT_TIMEOUT,
@@ -739,7 +739,7 @@ def __init__(
739739
self,
740740
*,
741741
version: str,
742-
base_url: str,
742+
base_url: str | URL,
743743
max_retries: int = DEFAULT_MAX_RETRIES,
744744
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
745745
transport: Transport | None = None,
@@ -1145,7 +1145,7 @@ def __init__(
11451145
self,
11461146
*,
11471147
version: str,
1148-
base_url: str,
1148+
base_url: str | URL,
11491149
_strict_response_validation: bool,
11501150
max_retries: int = DEFAULT_MAX_RETRIES,
11511151
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,

src/finch/_client.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import os
66
import asyncio
7-
from typing import Union, Mapping, Optional
7+
from typing import Union, Mapping
88

99
import httpx
1010

@@ -66,7 +66,7 @@ def __init__(
6666
client_id: str | None = None,
6767
client_secret: str | None = None,
6868
webhook_secret: str | None = None,
69-
base_url: Optional[str] = None,
69+
base_url: str | httpx.URL | None = None,
7070
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
7171
max_retries: int = DEFAULT_MAX_RETRIES,
7272
default_headers: Mapping[str, str] | None = None,
@@ -169,7 +169,7 @@ def copy(
169169
client_id: str | None = None,
170170
client_secret: str | None = None,
171171
webhook_secret: str | None = None,
172-
base_url: str | None = None,
172+
base_url: str | httpx.URL | None = None,
173173
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
174174
http_client: httpx.Client | None = None,
175175
connection_pool_limits: httpx.Limits | None = None,
@@ -361,7 +361,7 @@ def __init__(
361361
client_id: str | None = None,
362362
client_secret: str | None = None,
363363
webhook_secret: str | None = None,
364-
base_url: Optional[str] = None,
364+
base_url: str | httpx.URL | None = None,
365365
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
366366
max_retries: int = DEFAULT_MAX_RETRIES,
367367
default_headers: Mapping[str, str] | None = None,
@@ -464,7 +464,7 @@ def copy(
464464
client_id: str | None = None,
465465
client_secret: str | None = None,
466466
webhook_secret: str | None = None,
467-
base_url: str | None = None,
467+
base_url: str | httpx.URL | None = None,
468468
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
469469
http_client: httpx.AsyncClient | None = None,
470470
connection_pool_limits: httpx.Limits | None = None,

0 commit comments

Comments
 (0)