diff --git a/src/ragas/metrics/_tool_call_accuracy.py b/src/ragas/metrics/_tool_call_accuracy.py index b89a23b49a..8f29c81be9 100644 --- a/src/ragas/metrics/_tool_call_accuracy.py +++ b/src/ragas/metrics/_tool_call_accuracy.py @@ -35,6 +35,11 @@ def init(self, run_config): async def _get_arg_score( self, preds: t.Dict[str, t.Any], refs: t.Dict[str, t.Any], callbacks: Callbacks ) -> float: + if not refs and not preds: + return 1.0 + if not refs: + return 0.0 + score = 0.0 for arg in refs.keys(): if arg in preds: