From d6493590da3977b5077c13ff3aaad591f71637d6 Mon Sep 17 00:00:00 2001 From: Sheik Irfan Basha Date: Thu, 20 Jul 2023 19:22:13 +0530 Subject: [PATCH] Add Verbose support (#7982) (#7984) - Description: Add verbose support for the extraction_chain - Issue: Fixes #7982 - Dependencies: NA - Twitter handle: sheikirfanbasha @hwchase17 and @agola11 --------- Co-authored-by: Bagatur --- langchain/chains/openai_functions/extraction.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/langchain/chains/openai_functions/extraction.py b/langchain/chains/openai_functions/extraction.py index 35d78357b3..ab4528ca86 100644 --- a/langchain/chains/openai_functions/extraction.py +++ b/langchain/chains/openai_functions/extraction.py @@ -43,12 +43,16 @@ Passage: """ # noqa: E501 -def create_extraction_chain(schema: dict, llm: BaseLanguageModel) -> Chain: +def create_extraction_chain( + schema: dict, llm: BaseLanguageModel, verbose: bool = False +) -> Chain: """Creates a chain that extracts information from a passage. Args: schema: The schema of the entities to extract. llm: The language model to use. + 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. @@ -62,6 +66,7 @@ def create_extraction_chain(schema: dict, llm: BaseLanguageModel) -> Chain: prompt=prompt, llm_kwargs=llm_kwargs, output_parser=output_parser, + verbose=verbose, ) return chain