Home / Function/ test_refresh_includes_models_defined_only_in_augmentations() — langchain Function Reference

test_refresh_includes_models_defined_only_in_augmentations() — langchain Function Reference

Architecture documentation for the test_refresh_includes_models_defined_only_in_augmentations() function in test_cli.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  09fe5e08_a44e_6659_7da6_8aac8ec5ec60["test_refresh_includes_models_defined_only_in_augmentations()"]
  8f48d3cf_da07_6b86_6f4f_33b7967df9e0["test_cli.py"]
  09fe5e08_a44e_6659_7da6_8aac8ec5ec60 -->|defined in| 8f48d3cf_da07_6b86_6f4f_33b7967df9e0
  style 09fe5e08_a44e_6659_7da6_8aac8ec5ec60 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/model-profiles/tests/unit_tests/test_cli.py lines 172–216

def test_refresh_includes_models_defined_only_in_augmentations(
    tmp_path: Path, mock_models_dev_response: dict
) -> None:
    """Ensure models that only exist in augmentations are emitted."""
    data_dir = tmp_path / "data"
    data_dir.mkdir()

    aug_file = data_dir / "profile_augmentations.toml"
    aug_file.write_text("""
provider = "anthropic"

[overrides."custom-offline-model"]
structured_output = true
pdf_inputs = true
max_input_tokens = 123
""")

    mock_response = Mock()
    mock_response.json.return_value = mock_models_dev_response
    mock_response.raise_for_status = Mock()

    with (
        patch("langchain_model_profiles.cli.httpx.get", return_value=mock_response),
        patch("builtins.input", return_value="y"),
    ):
        refresh("anthropic", data_dir)

    profiles_file = data_dir / "_profiles.py"
    assert profiles_file.exists()

    spec = importlib.util.spec_from_file_location(
        "generated_profiles_aug_only", profiles_file
    )
    assert spec
    assert spec.loader
    module = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(module)  # type: ignore[union-attr]

    assert "custom-offline-model" in module._PROFILES  # type: ignore[attr-defined]
    assert (
        module._PROFILES["custom-offline-model"]["structured_output"] is True  # type: ignore[index]
    )
    assert (
        module._PROFILES["custom-offline-model"]["max_input_tokens"] == 123  # type: ignore[index]
    )

Domain

Subdomains

Frequently Asked Questions

What does test_refresh_includes_models_defined_only_in_augmentations() do?
test_refresh_includes_models_defined_only_in_augmentations() is a function in the langchain codebase, defined in libs/model-profiles/tests/unit_tests/test_cli.py.
Where is test_refresh_includes_models_defined_only_in_augmentations() defined?
test_refresh_includes_models_defined_only_in_augmentations() is defined in libs/model-profiles/tests/unit_tests/test_cli.py at line 172.

Analyze Your Own Codebase

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

Try Supermodel Free