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

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

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

    load_query_constructor_chain

    Copy
    load_query_constructor_chain(
      llm: BaseLanguageModel,
      document_contents: str,
      attribute_info: Sequence[AttributeInfo
    View source on GitHub
    |
    dict
    ]
    ,
    examples
    :
    list
    |
    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
    =
    {
    }
    )
    ->
    LLMChain

    Parameters

    NameTypeDescription
    llm*BaseLanguageModel

    BaseLanguageModel to use for the chain.

    document_contents*str

    The contents of the document to be queried.

    attribute_info*Sequence[AttributeInfo | dict]

    Sequence of attributes in the document.

    exampleslist | None
    Default:None
    allowed_comparatorsSequence[Comparator]
    Default:tuple(Comparator)
    allowed_operatorsSequence[Operator]
    Default:tuple(Operator)
    enable_limitbool
    Default:False
    schema_promptBasePromptTemplate | None
    Default:None
    **kwargsAny
    Default:{}

    Load a query constructor chain.

    Optional list of examples to use for the chain.

    Sequence of allowed comparators. Defaults to all Comparator objects.

    Sequence of allowed operators. Defaults to all Operator objects.

    Whether to enable the limit operator.

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

    Arbitrary named params to pass to LLMChain.