langchain.retrievers.self_query.tencentvectordb.TencentVectorDBTranslator

class langchain.retrievers.self_query.tencentvectordb.TencentVectorDBTranslator(meta_keys: Optional[Sequence[str]] = None)[source]

Translate StructuredQuery to Tencent VectorDB query.

Initialize the translator.

Parameters

meta_keys (Optional[Sequence[str]]) – List of meta keys to be used in the query. Default: [].

Attributes

COMPARATOR_MAP

allowed_comparators

allowed_operators

Methods

__init__([meta_keys])

Initialize the translator.

visit_comparison(comparison)

Visit a comparison node and return the translated query.

visit_operation(operation)

Visit an operation node and return the translated query.

visit_structured_query(structured_query)

Visit a structured query node and return the translated query.

__init__(meta_keys: Optional[Sequence[str]] = None)[source]

Initialize the translator.

Parameters

meta_keys (Optional[Sequence[str]]) – List of meta keys to be used in the query. Default: [].

visit_comparison(comparison: Comparison) str[source]

Visit a comparison node and return the translated query.

Parameters

comparison (Comparison) – Comparison node to be visited.

Returns

Translated query.

Return type

str

visit_operation(operation: Operation) str[source]

Visit an operation node and return the translated query.

Parameters

operation (Operation) – Operation node to be visited.

Returns

Translated query.

Return type

str

visit_structured_query(structured_query: StructuredQuery) Tuple[str, dict][source]

Visit a structured query node and return the translated query.

Parameters

structured_query (StructuredQuery) – StructuredQuery node to be visited.

Returns

Translated query and query kwargs.

Return type

Tuple[str, dict]