Provided default values for tags and inheritable_tags args in BaseRun… #6858
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…Manager
To avoid the error message:
TypeError: BaseRunManager.init() missing 2 required keyword-only arguments: 'tags' and 'inheritable_tags'
when running AsyncCallbackManagerForChainRun (from langchain.callbacks.manager import AsyncCallbackManagerForChainRun), provided default values for tags and inheritable_tages of empty lists in manager.py BaseRunManager.
BaseRunManager
, default values were provided for the__init__
argstags
andinheritable_tags
. They default to empty lists ([]
).I was using the NeMo Guardrails
LLMRails
module to create an app objects:self.app = LLMRails(config, verbose =True)
The I tried to use:
bot_message = self.app.generate_async(prompt=self.sys_msg, messages=history)
The LLMRails
class makes use of
LLMGenerationActions`, which comes from:from nemoguardrails.actions.llm.generation import LLMGenerationActions
In the generations.py module we have:
from nemoguardrails.logging.callbacks import logging_callbacks
and in callbacks.py, we have
from langchain.callbacks.manager import AsyncCallbackManagerForChainRun
and the code (Let's call this 'Code A'):
In the LangChain manager.py module, the class
AsyncCallbackManagerForChainRun
inherits theAsyncRunManager
class, which in turn inherits theBaseRunManager
class, which previously had (let's call this 'Code B'):As you can see, Code A fails to provide the tags and inheritable_tags arguments. My guess was that these can be optional arguments, but perhaps I'm wrong. So, I changed Code B to: