mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 23:54:14 +00:00
- 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>
This commit is contained in:
parent
812a1643db
commit
d6493590da
@ -43,12 +43,16 @@ Passage:
|
|||||||
""" # noqa: E501
|
""" # 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.
|
"""Creates a chain that extracts information from a passage.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
schema: The schema of the entities to extract.
|
schema: The schema of the entities to extract.
|
||||||
llm: The language model to use.
|
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:
|
Returns:
|
||||||
Chain that can be used to extract information from a passage.
|
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,
|
prompt=prompt,
|
||||||
llm_kwargs=llm_kwargs,
|
llm_kwargs=llm_kwargs,
|
||||||
output_parser=output_parser,
|
output_parser=output_parser,
|
||||||
|
verbose=verbose,
|
||||||
)
|
)
|
||||||
return chain
|
return chain
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user