Comparison Class — langchain Architecture
Architecture documentation for the Comparison class in structured_query.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 7fc2d26d_a784_bbfc_8102_85f9362176d2["Comparison"] 66dc61b8_a5e5_91c3_400b_bf5fe08394f1["FilterDirective"] 7fc2d26d_a784_bbfc_8102_85f9362176d2 -->|extends| 66dc61b8_a5e5_91c3_400b_bf5fe08394f1 2910db70_4057_4517_fbc4_a618465c787c["structured_query.py"] 7fc2d26d_a784_bbfc_8102_85f9362176d2 -->|defined in| 2910db70_4057_4517_fbc4_a618465c787c f3e5c43e_8109_6fc2_7114_06668d1b5f10["__init__()"] 7fc2d26d_a784_bbfc_8102_85f9362176d2 -->|method| f3e5c43e_8109_6fc2_7114_06668d1b5f10
Relationship Graph
Source Code
libs/core/langchain_core/structured_query.py lines 126–151
class Comparison(FilterDirective):
"""Comparison to a value."""
comparator: Comparator
"""The comparator to use."""
attribute: str
"""The attribute to compare."""
value: Any
"""The value to compare to."""
def __init__(
self, comparator: Comparator, attribute: str, value: Any, **kwargs: Any
) -> None:
"""Create a Comparison.
Args:
comparator: The comparator to use.
attribute: The attribute to compare.
value: The value to compare to.
"""
# super exists from BaseModel
super().__init__(
comparator=comparator, attribute=attribute, value=value, **kwargs
)
Defined In
Extends
Source
Frequently Asked Questions
What is the Comparison class?
Comparison is a class in the langchain codebase, defined in libs/core/langchain_core/structured_query.py.
Where is Comparison defined?
Comparison is defined in libs/core/langchain_core/structured_query.py at line 126.
What does Comparison extend?
Comparison extends FilterDirective.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free