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]