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 (Optional[FilterDirective]) β Filter directive to fix.
allowed_comparators (Optional[Sequence[Comparator]]) β allowed comparators. Defaults to all comparators.
allowed_operators (Optional[Sequence[Operator]]) β allowed operators. Defaults to all operators.
allowed_attributes (Optional[Sequence[str]]) β allowed attributes. Defaults to all attributes.
- Returns
Fixed filter directive.
- Return type
Optional[FilterDirective]