-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: Deprecate functions for 0.3 #2130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR implements a comprehensive deprecation of legacy functions in preparation for Ragas version 0.3. The changes systematically remove the deprecated _ascore
method from all metric classes across the codebase and update documentation to use new metric class names.
The core changes include:
-
Metric Method Deprecation: Removal of the
_ascore
method from 20+ metric classes including Faithfulness, AnswerCorrectness, ContextRecall, AspectCritic, and many others. These methods were legacy wrappers that accepted dictionary inputs and converted them to typedSingleTurnSample
orMultiTurnSample
objects before calling the newer_single_turn_ascore
or_multi_turn_ascore
methods. -
Base Class Cleanup: Complete removal of the deprecated
score()
,ascore()
, and_ascore()
methods from the baseMetric
class, eliminating 77 lines of legacy code including synchronous scoring functionality and Jupyter environment support. -
Metric Class Renaming: Updates throughout documentation and examples to replace deprecated metric class names like
ContextPrecision
andContextRecall
with more explicit names likeLLMContextPrecisionWithReference
andLLMContextRecall
. This provides better clarity about whether metrics use LLMs and what input data they require. -
Documentation Updates: Comprehensive updates to integration guides (Langfuse, Haystack, LlamaIndex, R2R, Griptape, etc.) and tutorial notebooks to use the new API patterns and metric names.
-
Code Consolidation: Many metrics had their logic consolidated from separate
_ascore
and_single_turn_ascore
methods into a single_single_turn_ascore
implementation, eliminating unnecessary dictionary conversions and improving type safety.
The changes represent a move from dictionary-based APIs to strongly-typed object interfaces, improving type safety and API consistency. The refactoring maintains all existing functionality while providing a cleaner, more maintainable codebase aligned with modern Python practices.
Confidence score: 4/5
• This PR is mostly safe to merge with some potential compatibility concerns for users still relying on deprecated methods
• The score reflects the systematic nature of the changes and thorough documentation updates, but there are a few potential issues that need attention
• Files that need more attention: ragas/src/ragas/metrics/__init__.py
(missing import for context_utilization
), ragas/src/ragas/metrics/_answer_correctness.py
(potential deprecated method call), and any integration tests that might still use the old API
43 files reviewed, 2 comments
Hey @wlbksy thanks for the PR. We will look into it. Were you able to try out ragas-experimental ? https://docs.ragas.io/en/latest/experimental/ |
Haven't tried it yet — will check it out when I get a chance. |
No description provided.