Home / Function/ test_mixed_input_types() — langchain Function Reference

test_mixed_input_types() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/vectorstores/test_utils.py lines 70–76

    def test_mixed_input_types(self) -> None:
        """Test with mixed input types (list and numpy array)."""
        x: list[list[float]] = [[1, 0], [0, 1]]
        y: np.ndarray = np.array([[1, 0], [0, 1]])
        result = _cosine_similarity(x, y)
        expected = np.array([[1.0, 0.0], [0.0, 1.0]])
        np.testing.assert_array_almost_equal(result, expected)

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free