test_context_overflow_error_invoke_sync() — langchain Function Reference
Architecture documentation for the test_context_overflow_error_invoke_sync() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD b20e25a5_3851_2ae0_71f1_c096e0f9a64f["test_context_overflow_error_invoke_sync()"] 18428dc5_a41b_90c6_88ad_615296ee3311["test_chat_models.py"] b20e25a5_3851_2ae0_71f1_c096e0f9a64f -->|defined in| 18428dc5_a41b_90c6_88ad_615296ee3311 style b20e25a5_3851_2ae0_71f1_c096e0f9a64f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/anthropic/tests/unit_tests/test_chat_models.py lines 2320–2331
def test_context_overflow_error_invoke_sync() -> None:
"""Test context overflow error on invoke (sync)."""
llm = ChatAnthropic(model=MODEL_NAME)
with ( # noqa: PT012
patch.object(llm._client.messages, "create") as mock_create,
pytest.raises(ContextOverflowError) as exc_info,
):
mock_create.side_effect = _CONTEXT_OVERFLOW_BAD_REQUEST_ERROR
llm.invoke([HumanMessage(content="test")])
assert "prompt is too long" in str(exc_info.value)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_context_overflow_error_invoke_sync() do?
test_context_overflow_error_invoke_sync() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/unit_tests/test_chat_models.py.
Where is test_context_overflow_error_invoke_sync() defined?
test_context_overflow_error_invoke_sync() is defined in libs/partners/anthropic/tests/unit_tests/test_chat_models.py at line 2320.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free