Home / Function/ _validate_func() — langchain Function Reference

_validate_func() — langchain Function Reference

Architecture documentation for the _validate_func() function in structured_query.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c613e8c3_4678_966f_08bb_558583123227["_validate_func()"]
  18e3bab6_a53a_ad0f_2cea_5bfc37a5d878["Visitor"]
  c613e8c3_4678_966f_08bb_558583123227 -->|defined in| 18e3bab6_a53a_ad0f_2cea_5bfc37a5d878
  style c613e8c3_4678_966f_08bb_558583123227 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/structured_query.py lines 24–44

    def _validate_func(self, func: Operator | Comparator) -> None:
        if (
            isinstance(func, Operator)
            and self.allowed_operators is not None
            and func not in self.allowed_operators
        ):
            msg = (
                f"Received disallowed operator {func}. Allowed "
                f"comparators are {self.allowed_operators}"
            )
            raise ValueError(msg)
        if (
            isinstance(func, Comparator)
            and self.allowed_comparators is not None
            and func not in self.allowed_comparators
        ):
            msg = (
                f"Received disallowed comparator {func}. Allowed "
                f"comparators are {self.allowed_comparators}"
            )
            raise ValueError(msg)

Domain

Subdomains

Frequently Asked Questions

What does _validate_func() do?
_validate_func() is a function in the langchain codebase, defined in libs/core/langchain_core/structured_query.py.
Where is _validate_func() defined?
_validate_func() is defined in libs/core/langchain_core/structured_query.py at line 24.

Analyze Your Own Codebase

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

Try Supermodel Free