test_stream_usage_override() — langchain Function Reference
Architecture documentation for the test_stream_usage_override() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 7c8b71f6_0db6_3cc1_57f5_e227e9e05867["test_stream_usage_override()"] f27640dd_3870_5548_d153_f9504ae1021f["test_chat_models.py"] 7c8b71f6_0db6_3cc1_57f5_e227e9e05867 -->|defined in| f27640dd_3870_5548_d153_f9504ae1021f style 7c8b71f6_0db6_3cc1_57f5_e227e9e05867 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/anthropic/tests/integration_tests/test_chat_models.py lines 157–163
async def test_stream_usage_override() -> None:
# check we override with kwarg
model = ChatAnthropic(model_name=MODEL_NAME) # type: ignore[call-arg]
assert model.stream_usage
async for token in model.astream("hi", stream_usage=False):
assert isinstance(token, AIMessageChunk)
assert token.usage_metadata is None
Domain
Subdomains
Source
Frequently Asked Questions
What does test_stream_usage_override() do?
test_stream_usage_override() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/integration_tests/test_chat_models.py.
Where is test_stream_usage_override() defined?
test_stream_usage_override() is defined in libs/partners/anthropic/tests/integration_tests/test_chat_models.py at line 157.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free