# get_query_constructor_prompt

> **Function** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/chains/query_constructor/base/get_query_constructor_prompt)

Create query construction prompt.

## Signature

```python
get_query_constructor_prompt(
    document_contents: str,
    attribute_info: Sequence[AttributeInfo | dict],
    *,
    examples: Sequence | None = None,
    allowed_comparators: Sequence[Comparator] = tuple(Comparator),
    allowed_operators: Sequence[Operator] = tuple(Operator),
    enable_limit: bool = False,
    schema_prompt: BasePromptTemplate | None = None,
    **kwargs: Any = {},
) -> BasePromptTemplate
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `document_contents` | `str` | Yes | The contents of the document to be queried. |
| `attribute_info` | `Sequence[AttributeInfo \| dict]` | Yes | A list of AttributeInfo objects describing the attributes of the document. |
| `examples` | `Sequence \| None` | No | Optional list of examples to use for the chain. (default: `None`) |
| `allowed_comparators` | `Sequence[Comparator]` | No | Sequence of allowed comparators. (default: `tuple(Comparator)`) |
| `allowed_operators` | `Sequence[Operator]` | No | Sequence of allowed operators. (default: `tuple(Operator)`) |
| `enable_limit` | `bool` | No | Whether to enable the limit operator. (default: `False`) |
| `schema_prompt` | `BasePromptTemplate \| None` | No | Prompt for describing query schema. Should have string input variables allowed_comparators and allowed_operators. (default: `None`) |
| `kwargs` | `Any` | No | Additional named params to pass to FewShotPromptTemplate init. (default: `{}`) |

## Returns

`BasePromptTemplate`

A prompt template that can be used to construct queries.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/b302691ff9ad841804e93e5addbdc53b6974473b/libs/langchain/langchain_classic/chains/query_constructor/base.py#L201)