[codex] Add contextual precision grouping#2729
Open
cat0825 wants to merge 1 commit into
Open
Conversation
|
@cat0825 is attempting to deploy a commit to the Confident AI Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Update: I opened #2737 as the source-first follow-up to #2594/#2669. I am treating this draft as superseded rather than continuing the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
group_byhook toContextualPrecisionMetricfor scoring overlapping retrieval chunks as retrieval units.group_byis not provided.group_byreturnsNone.group_byto inspect the original retrieval context item, includingRetrievedContextData.source.Closes #2594
Context
PR #2659 currently remains open but conflicting. This PR applies the same current-main direction as a focused opt-in grouping implementation with deterministic tests.
Validation
poetry run pytest tests/test_metrics/test_contextual_precision_grouping.py -qOPENAI_API_KEY= poetry run pytest tests/test_metrics/test_contextual_precision_metric.py tests/test_metrics/test_contextual_precision_grouping.py -qpoetry run black --check deepeval/metrics/contextual_precision/contextual_precision.py tests/test_metrics/test_contextual_precision_grouping.pypoetry run ruff check deepeval/metrics/contextual_precision/contextual_precision.py tests/test_metrics/test_contextual_precision_grouping.pyNote: running the existing OpenAI-backed contextual precision tests with the local
OPENAI_API_KEYpresent fails in this environment before metric execution because the machine has a SOCKS proxy configured andsocksiois not installed. The command above clearsOPENAI_API_KEYso those integration-style tests follow the repository skip rule while the new deterministic tests run.