import { ... } from "@langchain/core/structured_query";Casts a value that might be string or number to actual string or number. Since LLM might return back an integer/float as a string, we need to cast it back to a number, as many vector databases can't handle number as string values as a comparator.
Checks if the provided value is a boolean.
Checks if a provided filter is empty. The filter can be a function, an object, a string, or undefined.
Checks if the provided value is a floating-point number.
Checks if the provided value is an integer.
Checks if the provided argument is an object and not an array.
Checks if the provided value is a string that cannot be parsed into a number.
Abstract class that provides a blueprint for creating specific translator classes. Defines two abstract methods: formatFunction and mergeFilters.
Class that extends the BaseTranslator class and provides concrete implementations for the abstract methods. Also declares three types: VisitOperationOutput, VisitComparisonOutput, and VisitStructuredQueryOutput, which are used as the return types for the visitOperation, visitComparison, and visitStructuredQuery methods respectively.
Class representing a comparison filter directive. It extends the FilterDirective class.
Abstract class representing an expression. Subclasses must implement the exprName property and the accept method.
Abstract class representing a filter directive. It extends the Expression class.
A class that extends BaseTranslator to translate structured queries
into functional filters.
Class representing an operation filter directive. It extends the FilterDirective class.
Class representing a structured query expression. It extends the Expression class.
Abstract class for visiting expressions. Subclasses must implement visitOperation, visitComparison, and visitStructuredQuery methods.