Home / Function/ func_call() — langchain Function Reference

func_call() — langchain Function Reference

Architecture documentation for the func_call() function in parser.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  3f85c67d_a1d6_347e_82d3_f54f9a623333["func_call()"]
  7507a1db_f02a_e2de_50fc_37162a6893c2["QueryTransformer"]
  3f85c67d_a1d6_347e_82d3_f54f9a623333 -->|defined in| 7507a1db_f02a_e2de_50fc_37162a6893c2
  e1bff898_9f8b_39c2_649c_3d6911fd2ab9["_match_func_name()"]
  3f85c67d_a1d6_347e_82d3_f54f9a623333 -->|calls| e1bff898_9f8b_39c2_649c_3d6911fd2ab9
  style 3f85c67d_a1d6_347e_82d3_f54f9a623333 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/query_constructor/parser.py lines 107–132

    def func_call(self, func_name: Any, args: list) -> FilterDirective:
        """Transform a function name and args into a FilterDirective.

        Args:
            func_name: The name of the function.
            args: The arguments passed to the function.

        Returns:
            The filter directive.

        Raises:
            ValueError: If the function is a comparator and the first arg is not in the
            allowed attributes.
        """
        func = self._match_func_name(str(func_name))
        if isinstance(func, Comparator):
            if self.allowed_attributes and args[0] not in self.allowed_attributes:
                msg = (
                    f"Received invalid attributes {args[0]}. Allowed attributes are "
                    f"{self.allowed_attributes}"
                )
                raise ValueError(msg)
            return Comparison(comparator=func, attribute=args[0], value=args[1])
        if len(args) == 1 and func in (Operator.AND, Operator.OR):
            return args[0]
        return Operation(operator=func, arguments=args)

Subdomains

Frequently Asked Questions

What does func_call() do?
func_call() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/query_constructor/parser.py.
Where is func_call() defined?
func_call() is defined in libs/langchain/langchain_classic/chains/query_constructor/parser.py at line 107.
What does func_call() call?
func_call() calls 1 function(s): _match_func_name.

Analyze Your Own Codebase

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

Try Supermodel Free