Home / Function/ test_benchmark_model() — langchain Function Reference

test_benchmark_model() — langchain Function Reference

Architecture documentation for the test_benchmark_model() function in test_benchmark.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  d7961510_c664_7a24_8eab_aeed146a2fed["test_benchmark_model()"]
  5e831729_2795_1f58_ae62_be5b412ef31a["test_benchmark.py"]
  d7961510_c664_7a24_8eab_aeed146a2fed -->|defined in| 5e831729_2795_1f58_ae62_be5b412ef31a
  style d7961510_c664_7a24_8eab_aeed146a2fed fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/language_models/chat_models/test_benchmark.py lines 7–21

def test_benchmark_model() -> None:
    """Add rate limiter."""
    tic = time.time()

    model = GenericFakeChatModel(
        messages=cycle(["hello", "world", "!"]),
    )

    for _ in range(1_000):
        model.invoke("foo")
    toc = time.time()

    # Verify that the time taken to run the loop is less than 1 seconds

    assert (toc - tic) < 1

Subdomains

Frequently Asked Questions

What does test_benchmark_model() do?
test_benchmark_model() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/language_models/chat_models/test_benchmark.py.
Where is test_benchmark_model() defined?
test_benchmark_model() is defined in libs/core/tests/unit_tests/language_models/chat_models/test_benchmark.py at line 7.

Analyze Your Own Codebase

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

Try Supermodel Free