Skip to content

Commit

Permalink
Provided default values for tags and inheritable_tags args in BaseRun… (
Browse files Browse the repository at this point in the history
#6858)

when running AsyncCallbackManagerForChainRun (from
langchain.callbacks.manager import AsyncCallbackManagerForChainRun),
provided default values for tags and inheritable_tages of empty lists in
manager.py BaseRunManager.


- Description: In manager.py, `BaseRunManager`, default values were
provided for the `__init__` args `tags` and `inheritable_tags`. They
default to empty lists (`[]`).
- Issue: When trying to use Nvidia NeMo Guardrails with LangChain, the
following exception was raised:
  • Loading branch information
Siraj-Aizlewood committed Jun 30, 2023
1 parent bd6a0ee commit 521c6f0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions langchain/callbacks/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ def __init__(
handlers: List[BaseCallbackHandler],
inheritable_handlers: List[BaseCallbackHandler],
parent_run_id: Optional[UUID] = None,
tags: List[str],
inheritable_tags: List[str],
tags: Optional[List[str]] = None,
inheritable_tags: Optional[List[str]] = None,
) -> None:
"""Initialize the run manager.
Expand All @@ -391,15 +391,15 @@ def __init__(
The list of inheritable handlers.
parent_run_id (UUID, optional): The ID of the parent run.
Defaults to None.
tags (List[str]): The list of tags.
inheritable_tags (List[str]): The list of inheritable tags.
tags (Optional[List[str]]): The list of tags.
inheritable_tags (Optional[List[str]]): The list of inheritable tags.
"""
self.run_id = run_id
self.handlers = handlers
self.inheritable_handlers = inheritable_handlers
self.tags = tags
self.inheritable_tags = inheritable_tags
self.parent_run_id = parent_run_id
self.tags = tags or []
self.inheritable_tags = inheritable_tags or []

@classmethod
def get_noop_manager(cls: Type[BRM]) -> BRM:
Expand Down

0 comments on commit 521c6f0

Please sign in to comment.