Provided default values for tags and inheritable_tags args in BaseRun… (#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:
pull/6957/head^2
Siraj Aizlewood 1 year ago committed by GitHub
parent bd6a0ee9e9
commit 521c6f0233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -379,8 +379,8 @@ class BaseRunManager(RunManagerMixin):
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.
@ -391,15 +391,15 @@ class BaseRunManager(RunManagerMixin):
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:

Loading…
Cancel
Save