Home / Function/ test_openai_proxy() — langchain Function Reference

test_openai_proxy() — langchain Function Reference

Architecture documentation for the test_openai_proxy() function in test_base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  90ecaf26_0d6a_3b6a_6082_b0874d0d5cf4["test_openai_proxy()"]
  bd382a4e_442c_13ae_530c_6e34bc43623d["test_base.py"]
  90ecaf26_0d6a_3b6a_6082_b0874d0d5cf4 -->|defined in| bd382a4e_442c_13ae_530c_6e34bc43623d
  style 90ecaf26_0d6a_3b6a_6082_b0874d0d5cf4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/tests/integration_tests/chat_models/test_base.py lines 638–655

def test_openai_proxy() -> None:
    """Test ChatOpenAI with proxy."""
    chat_openai = ChatOpenAI(openai_proxy="http://localhost:8080")
    mounts = chat_openai.client._client._client._mounts
    assert len(mounts) == 1
    for value in mounts.values():
        proxy = value._pool._proxy_url.origin
        assert proxy.scheme == b"http"
        assert proxy.host == b"localhost"
        assert proxy.port == 8080

    async_client_mounts = chat_openai.async_client._client._client._mounts
    assert len(async_client_mounts) == 1
    for value in async_client_mounts.values():
        proxy = value._pool._proxy_url.origin
        assert proxy.scheme == b"http"
        assert proxy.host == b"localhost"
        assert proxy.port == 8080

Domain

Subdomains

Frequently Asked Questions

What does test_openai_proxy() do?
test_openai_proxy() is a function in the langchain codebase, defined in libs/partners/openai/tests/integration_tests/chat_models/test_base.py.
Where is test_openai_proxy() defined?
test_openai_proxy() is defined in libs/partners/openai/tests/integration_tests/chat_models/test_base.py at line 638.

Analyze Your Own Codebase

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

Try Supermodel Free