Home / Function/ test_anthropic_streaming_callback() — langchain Function Reference

test_anthropic_streaming_callback() — langchain Function Reference

Architecture documentation for the test_anthropic_streaming_callback() function in test_llms.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  ea4bbc17_f865_df9e_d68e_b09bccc01285["test_anthropic_streaming_callback()"]
  c4009766_f7e3_5acb_b9c7_0d2d714545e2["test_llms.py"]
  ea4bbc17_f865_df9e_d68e_b09bccc01285 -->|defined in| c4009766_f7e3_5acb_b9c7_0d2d714545e2
  style ea4bbc17_f865_df9e_d68e_b09bccc01285 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/tests/integration_tests/test_llms.py lines 45–56

def test_anthropic_streaming_callback() -> None:
    """Test that streaming correctly invokes on_llm_new_token callback."""
    callback_handler = FakeCallbackHandler()
    callback_manager = CallbackManager([callback_handler])
    llm = AnthropicLLM(
        model=MODEL,  # type: ignore[call-arg]
        streaming=True,
        callbacks=callback_manager,
        verbose=True,
    )
    llm.invoke("Write me a sentence with 100 words.")
    assert callback_handler.llm_streams > 1

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free