Home / Function/ test_small_values() — langchain Function Reference

test_small_values() — langchain Function Reference

Architecture documentation for the test_small_values() function in test_utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  905e82d3_6655_e631_6bcf_0daceb941bb1["test_small_values()"]
  43305d93_a58a_e7db_615b_b8a5a18284ab["TestCosineSimilarity"]
  905e82d3_6655_e631_6bcf_0daceb941bb1 -->|defined in| 43305d93_a58a_e7db_615b_b8a5a18284ab
  style 905e82d3_6655_e631_6bcf_0daceb941bb1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/vectorstores/test_utils.py lines 128–134

    def test_small_values(self) -> None:
        """Test with very small values."""
        x: list[list[float]] = [[1e-10, 1e-10]]
        y: list[list[float]] = [[1e-10, 1e-10], [1e-10, -1e-10]]
        result = _cosine_similarity(x, y)
        expected = np.array([[1.0, 0.0]])
        np.testing.assert_array_almost_equal(result, expected)

Domain

Subdomains

Frequently Asked Questions

What does test_small_values() do?
test_small_values() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/vectorstores/test_utils.py.
Where is test_small_values() defined?
test_small_values() is defined in libs/core/tests/unit_tests/vectorstores/test_utils.py at line 128.

Analyze Your Own Codebase

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

Try Supermodel Free