Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support customizing the "verify" argument in requests. #139

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/anthropic/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import uuid
import inspect
import platform
import ssl
from types import TracebackType
from random import random
from typing import (
Expand Down Expand Up @@ -657,6 +658,7 @@ def __init__(
transport: Transport | None = None,
proxies: ProxiesTypes | None = None,
limits: Limits | None = DEFAULT_LIMITS,
verify: bool | str | ssl.SSLContext = True,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
_strict_response_validation: bool,
Expand All @@ -677,6 +679,7 @@ def __init__(
proxies=proxies, # type: ignore
transport=transport, # type: ignore
limits=limits,
verify=verify,
headers={"Accept": "application/json"},
)

Expand Down Expand Up @@ -1011,6 +1014,7 @@ def __init__(
transport: Transport | None = None,
proxies: ProxiesTypes | None = None,
limits: Limits | None = DEFAULT_LIMITS,
verify: bool | str | ssl.SSLContext = True,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
) -> None:
Expand All @@ -1030,6 +1034,7 @@ def __init__(
proxies=proxies, # type: ignore
transport=transport, # type: ignore
limits=limits,
verify=verify,
headers={"Accept": "application/json"},
)

Expand Down
6 changes: 6 additions & 0 deletions src/anthropic/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def __init__(
proxies: Optional[ProxiesTypes] = None,
# See httpx documentation for [limits](https://www.python-httpx.org/advanced/#pool-limit-configuration)
connection_pool_limits: httpx.Limits | None = DEFAULT_LIMITS,
# See httpx documentation for [verify](https://www.python-httpx.org/advanced/#ssl-certificates)
verify: bool | str | ssl.SSLContext = True,
# Enable or disable schema validation for data returned by the API.
# When enabled an error APIResponseValidationError is raised
# if the API responds with invalid data for the expected schema.
Expand Down Expand Up @@ -106,6 +108,7 @@ def __init__(
transport=transport,
proxies=proxies,
limits=connection_pool_limits,
verify=verify,
custom_headers=default_headers,
custom_query=default_query,
_strict_response_validation=_strict_response_validation,
Expand Down Expand Up @@ -264,6 +267,8 @@ def __init__(
proxies: Optional[ProxiesTypes] = None,
# See httpx documentation for [limits](https://www.python-httpx.org/advanced/#pool-limit-configuration)
connection_pool_limits: httpx.Limits | None = DEFAULT_LIMITS,
# See httpx documentation for [verify](https://www.python-httpx.org/advanced/#ssl-certificates)
verify: bool | str | ssl.SSLContext = True,
# Enable or disable schema validation for data returned by the API.
# When enabled an error APIResponseValidationError is raised
# if the API responds with invalid data for the expected schema.
Expand Down Expand Up @@ -297,6 +302,7 @@ def __init__(
transport=transport,
proxies=proxies,
limits=connection_pool_limits,
verify=verify,
custom_headers=default_headers,
custom_query=default_query,
_strict_response_validation=_strict_response_validation,
Expand Down