Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
isahers1 committed Dec 10, 2024
1 parent 34e8bb9 commit e043a7d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions python/langsmith/evaluation/_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit e043a7d

Please sign in to comment.