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 <baskaryan@gmail.com>
pull/8007/head
Sheik Irfan Basha 1 year ago committed by GitHub
parent 812a1643db
commit d6493590da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save