langchain.chains.query_constructor.base.fix_filter_directive¶
langchain.chains.query_constructor.base.fix_filter_directive(filter: Optional[FilterDirective], *, allowed_comparators: Optional[Sequence[Comparator]] = None, allowed_operators: Optional[Sequence[Operator]] = None, allowed_attributes: Optional[Sequence[str]] = None) → Optional[FilterDirective][source]¶
Fix invalid filter directive.
Parameters
filter – Filter directive to fix.
allowed_comparators – allowed comparators. Defaults to all comparators.
allowed_operators – allowed operators. Defaults to all operators.
allowed_attributes – allowed attributes. Defaults to all attributes.
Returns
Fixed filter directive.