Skip to content

The agent engineering platform.

langchain: Fix Evaluator's _check_evaluation_args (#31910)

Christophe Bornetb8e242086560
diff --git a/libs/langchain/langchain/evaluation/schema.py b/libs/langchain/langchain/evaluation/schema.py
index 3d664bf80b..ba068c89b9 100644
--- a/libs/langchain/langchain/evaluation/schema.py
+++ b/libs/langchain/langchain/evaluation/schema.py
@@ -120,10 +120,10 @@ class _EvalArgsMixin:
ValueError: If the evaluator requires an input string but none is provided,
or if the evaluator requires a reference label but none is provided.
"""
- if self.requires_input and input is None:
+ if self.requires_input and input_ is None:
msg = f"{self.__class__.__name__} requires an input string."
raise ValueError(msg)
- if input is not None and not self.requires_input:
+ if input_ is not None and not self.requires_input:
warn(self._skip_input_warning)
if self.requires_reference and reference is None:
msg = f"{self.__class__.__name__} requires a reference string."