From e043a7d4ec837445561a08f1eb938e5232863c08 Mon Sep 17 00:00:00 2001 From: isaac hershenson Date: Tue, 10 Dec 2024 14:15:32 -0800 Subject: [PATCH] fmt --- python/langsmith/evaluation/_runner.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/python/langsmith/evaluation/_runner.py b/python/langsmith/evaluation/_runner.py index 55f8865cb..aea7a86cf 100644 --- a/python/langsmith/evaluation/_runner.py +++ b/python/langsmith/evaluation/_runner.py @@ -1929,12 +1929,17 @@ def _evaluators_include_attachments( return False def evaluator_has_attachments(evaluator: Any) -> bool: - sig = inspect.signature(evaluator) - params = list(sig.parameters.values()) - positional_params = [ - p for p in params if p.kind in (p.POSITIONAL_ONLY, p.POSITIONAL_OR_KEYWORD) - ] - return any(p.name == "attachments" for p in positional_params) + try: + sig = inspect.signature(evaluator) + params = list(sig.parameters.values()) + positional_params = [ + p + for p in params + if p.kind in (p.POSITIONAL_ONLY, p.POSITIONAL_OR_KEYWORD) + ] + return any(p.name == "attachments" for p in positional_params) + except Exception: + return False return any(evaluator_has_attachments(e) for e in evaluators)