Skip to content

Commit

Permalink
Add Verbose support (langchain-ai#7982) (langchain-ai#7984)
Browse files Browse the repository at this point in the history
- Description: Add verbose support for the extraction_chain
- Issue: Fixes langchain-ai#7982 
- Dependencies: NA
- Twitter handle: sheikirfanbasha
@hwchase17 and @agola11

---------

Co-authored-by: Bagatur <[email protected]>
  • Loading branch information
sheikirfanbasha and baskaryan authored Jul 20, 2023
1 parent 812a164 commit d649359
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion langchain/chains/openai_functions/extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,16 @@ def _get_extraction_function(entity_schema: dict) -> dict:
""" # 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.
Expand All @@ -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

Expand Down

0 comments on commit d649359

Please sign in to comment.