diff --git a/nemoguardrails/llm/params.py b/nemoguardrails/llm/params.py index 83717407c..27de824ce 100644 --- a/nemoguardrails/llm/params.py +++ b/nemoguardrails/llm/params.py @@ -41,9 +41,7 @@ def __enter__(self): if hasattr(self.llm, param): self.original_params[param] = getattr(self.llm, param) setattr(self.llm, param, value) - elif hasattr(self.llm, "model_kwargs") and param in getattr( - self.llm, "model_kwargs", {} - ): + elif param in getattr(self.llm, "model_kwargs", {}): self.original_params[param] = self.llm.model_kwargs[param] self.llm.model_kwargs[param] = value else: