From 5597fe23bbbbf7a11f7923ccce6268ed63b8138b Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Tue, 17 Oct 2023 19:53:13 +0000 Subject: [PATCH] feat(client): support passing httpx.URL instances to base_url --- src/finch/_base_client.py | 6 +++--- src/finch/_client.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/finch/_base_client.py b/src/finch/_base_client.py index dd037716..05c11810 100644 --- a/src/finch/_base_client.py +++ b/src/finch/_base_client.py @@ -331,7 +331,7 @@ def __init__( self, *, version: str, - base_url: str, + base_url: str | URL, _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None = DEFAULT_TIMEOUT, @@ -739,7 +739,7 @@ def __init__( self, *, version: str, - base_url: str, + base_url: str | URL, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, transport: Transport | None = None, @@ -1145,7 +1145,7 @@ def __init__( self, *, version: str, - base_url: str, + base_url: str | URL, _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, diff --git a/src/finch/_client.py b/src/finch/_client.py index 15bb4e6f..c388a140 100644 --- a/src/finch/_client.py +++ b/src/finch/_client.py @@ -4,7 +4,7 @@ import os import asyncio -from typing import Union, Mapping, Optional +from typing import Union, Mapping import httpx @@ -66,7 +66,7 @@ def __init__( client_id: str | None = None, client_secret: str | None = None, webhook_secret: str | None = None, - base_url: Optional[str] = None, + base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, @@ -169,7 +169,7 @@ def copy( client_id: str | None = None, client_secret: str | None = None, webhook_secret: str | None = None, - base_url: str | None = None, + base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.Client | None = None, connection_pool_limits: httpx.Limits | None = None, @@ -361,7 +361,7 @@ def __init__( client_id: str | None = None, client_secret: str | None = None, webhook_secret: str | None = None, - base_url: Optional[str] = None, + base_url: str | httpx.URL | None = None, timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, @@ -464,7 +464,7 @@ def copy( client_id: str | None = None, client_secret: str | None = None, webhook_secret: str | None = None, - base_url: str | None = None, + base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, http_client: httpx.AsyncClient | None = None, connection_pool_limits: httpx.Limits | None = None,