Home / Function/ test_streaming() — langchain Function Reference

test_streaming() — langchain Function Reference

Architecture documentation for the test_streaming() function in test_chat_models.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  f71b2fff_e51d_83e2_c143_0012dadc82d9["test_streaming()"]
  f27640dd_3870_5548_d153_f9504ae1021f["test_chat_models.py"]
  f71b2fff_e51d_83e2_c143_0012dadc82d9 -->|defined in| f27640dd_3870_5548_d153_f9504ae1021f
  style f71b2fff_e51d_83e2_c143_0012dadc82d9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/tests/integration_tests/test_chat_models.py lines 423–436

def test_streaming() -> None:
    """Test streaming tokens from Anthropic."""
    callback_handler = FakeCallbackHandler()
    callback_manager = CallbackManager([callback_handler])

    llm = ChatAnthropic(  # type: ignore[call-arg, call-arg]
        model_name=MODEL_NAME,
        streaming=True,
        callbacks=callback_manager,
    )

    response = llm.generate([[HumanMessage(content="I'm Pickle Rick")]])
    assert callback_handler.llm_streams > 0
    assert isinstance(response, LLMResult)

Domain

Subdomains

Frequently Asked Questions

What does test_streaming() do?
test_streaming() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/integration_tests/test_chat_models.py.
Where is test_streaming() defined?
test_streaming() is defined in libs/partners/anthropic/tests/integration_tests/test_chat_models.py at line 423.

Analyze Your Own Codebase

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

Try Supermodel Free