Home / Function/ test_profile() — langchain Function Reference

test_profile() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  85455e86_3b50_3e81_fa14_84c22996f798["test_profile()"]
  48232d20_f8c1_b597_14fa_7dc407e9bfe5["test_base.py"]
  85455e86_3b50_3e81_fa14_84c22996f798 -->|defined in| 48232d20_f8c1_b597_14fa_7dc407e9bfe5
  style 85455e86_3b50_3e81_fa14_84c22996f798 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/tests/unit_tests/chat_models/test_base.py lines 128–153

def test_profile() -> None:
    model = ChatOpenAI(model="gpt-4")
    assert model.profile
    assert not model.profile["structured_output"]

    model = ChatOpenAI(model="gpt-5")
    assert model.profile
    assert model.profile["structured_output"]
    assert model.profile["tool_calling"]

    # Test overwriting a field
    model.profile["tool_calling"] = False
    assert not model.profile["tool_calling"]

    # Test we didn't mutate
    model = ChatOpenAI(model="gpt-5")
    assert model.profile
    assert model.profile["tool_calling"]

    # Test passing in profile
    model = ChatOpenAI(model="gpt-5", profile={"tool_calling": False})
    assert model.profile == {"tool_calling": False}

    # Test overrides for gpt-5 input tokens
    model = ChatOpenAI(model="gpt-5")
    assert model.profile["max_input_tokens"] == 272_000

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free