explodinggradients / ragas

Supercharge Your LLM Application Evaluations 🚀
https://docs.ragas.io
Apache License 2.0
7.3k stars 746 forks source link

Fixes ToolCallAccuracy raises ZeroDivisionError when called without any arguments. #1685

Closed sahusiddharth closed 3 days ago

sahusiddharth commented 5 days ago
  1. Check for both empty dictionaries:
    • If both refs and preds are empty, return 1.0 as you specified in your logic.
  2. Check for empty refs:
    • If refs is empty but preds is not, return 0.0 since there's nothing to compare.
shahules786 commented 3 days ago

That's a nice catch @sahusiddharth