Skip to content

Commit

Permalink
feat(client): support passing httpx.URL instances to base_url (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Oct 17, 2023
1 parent 7c92b90 commit fe61308
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/anthropic/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions src/anthropic/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import os
import asyncio
from typing import Union, Mapping, Optional
from typing import Union, Mapping

import httpx
from tokenizers import Tokenizer # type: ignore[import]
Expand Down Expand Up @@ -64,7 +64,7 @@ def __init__(
*,
api_key: str | None = None,
auth_token: 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,
Expand Down Expand Up @@ -176,7 +176,7 @@ def copy(
*,
api_key: str | None = None,
auth_token: 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,
Expand Down Expand Up @@ -316,7 +316,7 @@ def __init__(
*,
api_key: str | None = None,
auth_token: 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,
Expand Down Expand Up @@ -428,7 +428,7 @@ def copy(
*,
api_key: str | None = None,
auth_token: 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,
Expand Down

0 comments on commit fe61308

Please sign in to comment.