langchain.chains.openai_functions.extraction.create_extraction_chain¶
langchain.chains.openai_functions.extraction.create_extraction_chain(schema: dict, llm: BaseLanguageModel, prompt: Optional[BasePromptTemplate] = None, verbose: bool = False) → Chain[source]¶
Creates a chain that extracts information from a passage.
Parameters
schema – The schema of the entities to extract.
llm – The language model to use.
prompt – The prompt to use for extraction.
verbose – Whether to run in verbose mode. In verbose mode, some intermediate
logs will be printed to the console. Defaults to langchain.verbose value.
Returns
Chain that can be used to extract information from a passage.
Examples using create_extraction_chain¶
Anthropic Functions
Set env var OPENAI_API_KEY or load from a .env file: