QueryTransformer#

class langchain.chains.query_constructor.parser.QueryTransformer(*args: Any, allowed_comparators: Sequence[Comparator] | None = None, allowed_operators: Sequence[Operator] | None = None, allowed_attributes: Sequence[str] | None = None, **kwargs: Any)[source]#

Transform a query string into an intermediate representation.

Methods

__init__(*args[, allowed_comparators, ...])

args(*items)

date(item)

datetime(item)

false()

float(item)

func_call(func_name, args)

int(item)

list(item)

program(*items)

string(item)

transform(tree)

Transform the given tree, and return the final result

true()

Parameters:
  • args (Any)

  • allowed_comparators (Sequence[Comparator] | None)

  • allowed_operators (Sequence[Operator] | None)

  • allowed_attributes (Sequence[str] | None)

  • kwargs (Any)

__init__(*args: Any, allowed_comparators: Sequence[Comparator] | None = None, allowed_operators: Sequence[Operator] | None = None, allowed_attributes: Sequence[str] | None = None, **kwargs: Any)[source]#
Parameters:
  • args (Any)

  • allowed_comparators (Sequence[Comparator] | None)

  • allowed_operators (Sequence[Operator] | None)

  • allowed_attributes (Sequence[str] | None)

  • kwargs (Any)

args(*items: Any) tuple[source]#
Parameters:

items (Any)

Return type:

tuple

date(item: Any) ISO8601Date[source]#
Parameters:

item (Any)

Return type:

ISO8601Date

datetime(item: Any) ISO8601DateTime[source]#
Parameters:

item (Any)

Return type:

ISO8601DateTime

false() bool[source]#
Return type:

bool

float(item: Any) float[source]#
Parameters:

item (Any)

Return type:

float

func_call(func_name: Any, args: list) FilterDirective[source]#
Parameters:
  • func_name (Any)

  • args (list)

Return type:

FilterDirective

int(item: Any) int[source]#
Parameters:

item (Any)

Return type:

int

list(item: Any) list[source]#
Parameters:

item (Any)

Return type:

list

program(*items: Any) tuple[source]#
Parameters:

items (Any)

Return type:

tuple

string(item: Any) str[source]#
Parameters:

item (Any)

Return type:

str

transform(tree: Tree[_Leaf_T]) _Return_T#

Transform the given tree, and return the final result

Parameters:

tree (Tree[_Leaf_T])

Return type:

_Return_T

true() bool[source]#
Return type:

bool