Home / Function/ _get_default_httpx_client() — langchain Function Reference

_get_default_httpx_client() — langchain Function Reference

Architecture documentation for the _get_default_httpx_client() function in _client_utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  a6c4f69e_4a77_eb7c_cb0e_5d5e236133f6["_get_default_httpx_client()"]
  15814c96_373f_f86b_f2fa_7830cc4d0ae3["_client_utils.py"]
  a6c4f69e_4a77_eb7c_cb0e_5d5e236133f6 -->|defined in| 15814c96_373f_f86b_f2fa_7830cc4d0ae3
  577d0a26_5bb4_d33f_d7ac_056487e55112["_build_sync_httpx_client()"]
  a6c4f69e_4a77_eb7c_cb0e_5d5e236133f6 -->|calls| 577d0a26_5bb4_d33f_d7ac_056487e55112
  5fea48ba_21fe_a9a0_3cb6_ddd1445db0ea["_cached_sync_httpx_client()"]
  a6c4f69e_4a77_eb7c_cb0e_5d5e236133f6 -->|calls| 5fea48ba_21fe_a9a0_3cb6_ddd1445db0ea
  style a6c4f69e_4a77_eb7c_cb0e_5d5e236133f6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/langchain_openai/chat_models/_client_utils.py lines 85–97

def _get_default_httpx_client(
    base_url: str | None, timeout: Any
) -> _SyncHttpxClientWrapper:
    """Get default httpx client.

    Uses cached client unless timeout is `httpx.Timeout`, which is not hashable.
    """
    try:
        hash(timeout)
    except TypeError:
        return _build_sync_httpx_client(base_url, timeout)
    else:
        return _cached_sync_httpx_client(base_url, timeout)

Domain

Subdomains

Frequently Asked Questions

What does _get_default_httpx_client() do?
_get_default_httpx_client() is a function in the langchain codebase, defined in libs/partners/openai/langchain_openai/chat_models/_client_utils.py.
Where is _get_default_httpx_client() defined?
_get_default_httpx_client() is defined in libs/partners/openai/langchain_openai/chat_models/_client_utils.py at line 85.
What does _get_default_httpx_client() call?
_get_default_httpx_client() calls 2 function(s): _build_sync_httpx_client, _cached_sync_httpx_client.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free