test_profile() — langchain Function Reference
Architecture documentation for the test_profile() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 9c76b482_4c59_c355_156d_7d240623ec96["test_profile()"] 18428dc5_a41b_90c6_88ad_615296ee3311["test_chat_models.py"] 9c76b482_4c59_c355_156d_7d240623ec96 -->|defined in| 18428dc5_a41b_90c6_88ad_615296ee3311 style 9c76b482_4c59_c355_156d_7d240623ec96 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/anthropic/tests/unit_tests/test_chat_models.py lines 2055–2076
def test_profile() -> None:
model = ChatAnthropic(model="claude-sonnet-4-20250514")
assert model.profile
assert not model.profile["structured_output"]
model = ChatAnthropic(model="claude-sonnet-4-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 = ChatAnthropic(model="claude-sonnet-4-5")
assert model.profile
assert model.profile["tool_calling"]
# Test passing in profile
model = ChatAnthropic(model="claude-sonnet-4-5", profile={"tool_calling": False})
assert model.profile == {"tool_calling": False}
Domain
Subdomains
Source
Frequently Asked Questions
What does test_profile() do?
test_profile() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/unit_tests/test_chat_models.py.
Where is test_profile() defined?
test_profile() is defined in libs/partners/anthropic/tests/unit_tests/test_chat_models.py at line 2055.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free