Home / Function/ test_chat_openai() — langchain Function Reference

test_chat_openai() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/partners/openai/tests/integration_tests/chat_models/test_base.py lines 35–53

def test_chat_openai() -> None:
    """Test ChatOpenAI wrapper."""
    chat = ChatOpenAI(
        temperature=0.7,
        base_url=None,
        organization=None,
        openai_proxy=None,
        timeout=10.0,
        max_retries=3,
        http_client=None,
        n=1,
        max_tokens=MAX_TOKEN_COUNT,  # type: ignore[call-arg]
        default_headers=None,
        default_query=None,
    )
    message = HumanMessage(content="Hello")
    response = chat.invoke([message])
    assert isinstance(response, BaseMessage)
    assert isinstance(response.content, str)

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free