Home / Function/ test_model_retry_initialization_custom() — langchain Function Reference

test_model_retry_initialization_custom() — langchain Function Reference

Architecture documentation for the test_model_retry_initialization_custom() function in test_model_retry.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  634429f2_48fb_8a28_e896_23159353bb58["test_model_retry_initialization_custom()"]
  6a114635_155a_5b86_2f48_fb8ca99f7545["test_model_retry.py"]
  634429f2_48fb_8a28_e896_23159353bb58 -->|defined in| 6a114635_155a_5b86_2f48_fb8ca99f7545
  style 634429f2_48fb_8a28_e896_23159353bb58 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_model_retry.py lines 103–122

def test_model_retry_initialization_custom() -> None:
    """Test ModelRetryMiddleware initialization with custom values."""
    retry = ModelRetryMiddleware(
        max_retries=5,
        retry_on=(ValueError, RuntimeError),
        on_failure="error",
        backoff_factor=1.5,
        initial_delay=0.5,
        max_delay=30.0,
        jitter=False,
    )

    assert retry.max_retries == 5
    assert retry.tools == []
    assert retry.retry_on == (ValueError, RuntimeError)
    assert retry.on_failure == "error"
    assert retry.backoff_factor == 1.5
    assert retry.initial_delay == 0.5
    assert retry.max_delay == 30.0
    assert retry.jitter is False

Domain

Subdomains

Frequently Asked Questions

What does test_model_retry_initialization_custom() do?
test_model_retry_initialization_custom() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_model_retry.py.
Where is test_model_retry_initialization_custom() defined?
test_model_retry_initialization_custom() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_model_retry.py at line 103.

Analyze Your Own Codebase

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

Try Supermodel Free