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-classicchainsopenai_functionsextractioncreate_extraction_chain
    Function●Since v1.0Deprecated

    create_extraction_chain

    Creates a chain that extracts information from a passage.

    Copy
    create_extraction_chain(
      schema: dict,
      llm: BaseLanguageModel,
      prompt: BasePromptTemplate | None = None,
      tags: list[str] | None = None,
      verbose: bool = False
    ) -> Chain

    Parameters

    NameTypeDescription
    schema*dict

    The schema of the entities to extract.

    llm*BaseLanguageModel

    The language model to use.

    promptBasePromptTemplate | None
    Default:None

    The prompt to use for extraction.

    tagslist[str] | None
    Default:None

    Optional list of tags to associate with the chain.

    verbosebool
    Default:False

    Whether to run in verbose mode. In verbose mode, some intermediate logs will be printed to the console.

    View source on GitHub