Home / Function/ test_incomplete_response() — langchain Function Reference

test_incomplete_response() — langchain Function Reference

Architecture documentation for the test_incomplete_response() function in test_responses_api.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  dc484052_27cb_8998_96e4_f406c45f32dd["test_incomplete_response()"]
  992496d5_b7d4_139f_00cf_3e585d851f81["test_responses_api.py"]
  dc484052_27cb_8998_96e4_f406c45f32dd -->|defined in| 992496d5_b7d4_139f_00cf_3e585d851f81
  style dc484052_27cb_8998_96e4_f406c45f32dd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py lines 62–78

def test_incomplete_response() -> None:
    model = ChatOpenAI(
        model=MODEL_NAME, use_responses_api=True, max_completion_tokens=16
    )
    response = model.invoke("Tell me a 100 word story about a bear.")
    assert response.response_metadata["incomplete_details"]
    assert response.response_metadata["incomplete_details"]["reason"]
    assert response.response_metadata["status"] == "incomplete"

    full: AIMessageChunk | None = None
    for chunk in model.stream("Tell me a 100 word story about a bear."):
        assert isinstance(chunk, AIMessageChunk)
        full = chunk if full is None else full + chunk
    assert isinstance(full, AIMessageChunk)
    assert full.response_metadata["incomplete_details"]
    assert full.response_metadata["incomplete_details"]["reason"]
    assert full.response_metadata["status"] == "incomplete"

Domain

Subdomains

Frequently Asked Questions

What does test_incomplete_response() do?
test_incomplete_response() is a function in the langchain codebase, defined in libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py.
Where is test_incomplete_response() defined?
test_incomplete_response() is defined in libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py at line 62.

Analyze Your Own Codebase

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

Try Supermodel Free