langchain.chains.openai_functions.extraction.create_extraction_chain_pydantic¶

langchain.chains.openai_functions.extraction.create_extraction_chain_pydantic(pydantic_schema: Any, llm: BaseLanguageModel, prompt: Optional[BasePromptTemplate] = None, verbose: bool = False) Chain[source]¶

Creates a chain that extracts information from a passage using pydantic schema.

Parameters
  • pydantic_schema (Any) – The pydantic schema of the entities to extract.

  • llm (BaseLanguageModel) – The language model to use.

  • prompt (Optional[BasePromptTemplate]) – The prompt to use for extraction.

  • verbose (bool) – Whether to run in verbose mode. In verbose mode, some intermediate logs will be printed to the console. Defaults to the global verbose value, accessible via langchain.globals.get_verbose()

Returns

Chain that can be used to extract information from a passage.

Return type

Chain

Examples using create_extraction_chain_pydantic¶