LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-classicchainsquery_constructorbaseget_query_constructor_prompt
    Function●Since v1.0

    get_query_constructor_prompt

    Create query construction prompt.

    Copy
    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

    Used in Docs

    • Self Querying with SAP HANA Cloud Vector Engine

    Parameters

    NameTypeDescription
    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.

    examplesSequence | None
    Default:None

    Optional list of examples to use for the chain.

    allowed_comparatorsSequence[Comparator]
    Default:tuple(Comparator)

    Sequence of allowed comparators.

    allowed_operatorsSequence[Operator]
    Default:tuple(Operator)

    Sequence of allowed operators.

    enable_limitbool
    Default:False

    Whether to enable the limit operator.

    schema_promptBasePromptTemplate | None
    Default:None

    Prompt for describing query schema. Should have string input variables allowed_comparators and allowed_operators.

    kwargsAny
    Default:{}

    Additional named params to pass to FewShotPromptTemplate init.

    View source on GitHub