get_query_constructor_prompt#
- langchain.chains.query_constructor.base.get_query_constructor_prompt(
- document_contents: str,
- attribute_info: Sequence[AttributeInfo | dict],
- *,
- examples: Sequence | None = None,
- allowed_comparators: Sequence[Comparator] = (Comparator.EQ, Comparator.NE, Comparator.GT, Comparator.GTE, Comparator.LT, Comparator.LTE, Comparator.CONTAIN, Comparator.LIKE, Comparator.IN, Comparator.NIN),
- allowed_operators: Sequence[Operator] = (Operator.AND, Operator.OR, Operator.NOT),
- enable_limit: bool = False,
- schema_prompt: BasePromptTemplate | None = None,
- **kwargs: Any,
Create query construction prompt.
- Parameters:
document_contents (str) β The contents of the document to be queried.
attribute_info (Sequence[AttributeInfo | dict]) β A list of AttributeInfo objects describing the attributes of the document.
examples (Sequence | None) β Optional list of examples to use for the chain.
allowed_comparators (Sequence[Comparator]) β Sequence of allowed comparators.
allowed_operators (Sequence[Operator]) β Sequence of allowed operators.
enable_limit (bool) β Whether to enable the limit operator. Defaults to False.
schema_prompt (BasePromptTemplate | None) β Prompt for describing query schema. Should have string input variables allowed_comparators and allowed_operators.
kwargs (Any) β Additional named params to pass to FewShotPromptTemplate init.
- Returns:
A prompt template that can be used to construct queries.
- Return type:
Examples using get_query_constructor_prompt