Home / Function/ test_validate_model_on_init() — langchain Function Reference

test_validate_model_on_init() — langchain Function Reference

Architecture documentation for the test_validate_model_on_init() function in test_embeddings.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c241bef1_7bc1_342b_6c83_6ce1da4d0704["test_validate_model_on_init()"]
  19edcbbb_8204_9855_a4b7_99dca4b148ba["test_embeddings.py"]
  c241bef1_7bc1_342b_6c83_6ce1da4d0704 -->|defined in| 19edcbbb_8204_9855_a4b7_99dca4b148ba
  style c241bef1_7bc1_342b_6c83_6ce1da4d0704 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/ollama/tests/unit_tests/test_embeddings.py lines 17–26

def test_validate_model_on_init(mock_validate_model: Any) -> None:
    """Test that the model is validated on initialization when requested."""
    OllamaEmbeddings(model=MODEL_NAME, validate_model_on_init=True)
    mock_validate_model.assert_called_once()
    mock_validate_model.reset_mock()

    OllamaEmbeddings(model=MODEL_NAME, validate_model_on_init=False)
    mock_validate_model.assert_not_called()
    OllamaEmbeddings(model=MODEL_NAME)
    mock_validate_model.assert_not_called()

Domain

Subdomains

Frequently Asked Questions

What does test_validate_model_on_init() do?
test_validate_model_on_init() is a function in the langchain codebase, defined in libs/partners/ollama/tests/unit_tests/test_embeddings.py.
Where is test_validate_model_on_init() defined?
test_validate_model_on_init() is defined in libs/partners/ollama/tests/unit_tests/test_embeddings.py at line 17.

Analyze Your Own Codebase

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

Try Supermodel Free