Home / Function/ test_context_overflow_error_stream_async_responses_api() — langchain Function Reference

test_context_overflow_error_stream_async_responses_api() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/partners/openai/tests/unit_tests/chat_models/test_base.py lines 3366–3378

async def test_context_overflow_error_stream_async_responses_api() -> None:
    """Test context overflow error on stream (async, responses API)."""
    llm = ChatOpenAI(use_responses_api=True)

    with (  # noqa: PT012
        patch.object(llm.root_async_client.responses, "create") as mock_create,
        pytest.raises(ContextOverflowError) as exc_info,
    ):
        mock_create.side_effect = _CONTEXT_OVERFLOW_API_ERROR
        async for _ in llm.astream([HumanMessage(content="test")]):
            pass

    assert "exceeds the context window" in str(exc_info.value)

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free