langchain: Fix Evaluator's _check_evaluation_args (#31910)

Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
Christophe Bornet 2025-07-08 16:31:02 +02:00 committed by GitHub
parent a3e3fd20f2
commit b8e2420865
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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."