Skip to content
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

Added functionality for adding metadata using validate api #72

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sanjanag
Copy link
Member

@sanjanag sanjanag commented Apr 8, 2025

Key Info

  • Implementation plan: link
  • Priority:

What changed?

What do you want the reviewer(s) to focus on?


Checklist

  • Did you link the GitHub issue?
  • Did you follow deployment steps or bump the version if needed?
  • Did you add/update tests?
  • What QA did you do?
    • Tested...

@@ -114,9 +117,11 @@ def validate(
- Additional keys from a [`ThresholdedTrustworthyRAGScore`](/codex/api/python/types.validator/#class-thresholdedtrustworthyragscore) dictionary: each corresponds to a [TrustworthyRAG](/tlm/api/python/utils.rag/#class-trustworthyrag) evaluation metric, and points to the score for this evaluation as well as a boolean `is_bad` flagging whether the score falls below the corresponding threshold.
"""
scores, is_bad_response = self.detect(query, context, response, prompt, form_prompt)
metadata = {} if metadata is None else metadata
metadata = {**metadata, **scores}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to guard the addition of **scores behind a flag in Validator.__init__(), such as log_scores: bool = True?
Still undecided on what the default should be, but this might help make the behavior more explicit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants