test_anthropic_proxy_support() — langchain Function Reference
Architecture documentation for the test_anthropic_proxy_support() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD e6757ba3_5d26_98cf_2601_ca45a473ca1d["test_anthropic_proxy_support()"] 18428dc5_a41b_90c6_88ad_615296ee3311["test_chat_models.py"] e6757ba3_5d26_98cf_2601_ca45a473ca1d -->|defined in| 18428dc5_a41b_90c6_88ad_615296ee3311 style e6757ba3_5d26_98cf_2601_ca45a473ca1d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/anthropic/tests/unit_tests/test_chat_models.py lines 77–95
def test_anthropic_proxy_support() -> None:
"""Test that both sync and async clients support proxy configuration."""
proxy_url = "http://proxy.example.com:8080"
# Test sync client with proxy
llm_sync = ChatAnthropic(model=MODEL_NAME, anthropic_proxy=proxy_url)
sync_client = llm_sync._client
assert sync_client is not None
# Test async client with proxy - this should not raise TypeError
async_client = llm_sync._async_client
assert async_client is not None
# Test that clients with different proxy settings are not cached together
llm_no_proxy = ChatAnthropic(model=MODEL_NAME)
llm_with_proxy = ChatAnthropic(model=MODEL_NAME, anthropic_proxy=proxy_url)
# Different proxy settings should result in different cached clients
assert llm_no_proxy._client._client is not llm_with_proxy._client._client
Domain
Subdomains
Source
Frequently Asked Questions
What does test_anthropic_proxy_support() do?
test_anthropic_proxy_support() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/unit_tests/test_chat_models.py.
Where is test_anthropic_proxy_support() defined?
test_anthropic_proxy_support() is defined in libs/partners/anthropic/tests/unit_tests/test_chat_models.py at line 77.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free