refactor: provider-agnostic LLMJudge with auto-detection for OpenAI (#1103)#1113
Merged
TimothyZhang7 merged 2 commits intoaden-hive:mainfrom Jan 27, 2026
Merged
Conversation
PR Closed - Requirements Not MetThis PR has been automatically closed because it doesn't meet the requirements. PR Author: @TanujaNair03 To fix:
Why is this required? See #472 for details. |
jhalak999
pushed a commit
to jhalak999/hive
that referenced
this pull request
Feb 17, 2026
…e-agnostic refactor: provider-agnostic LLMJudge with auto-detection for OpenAI (aden-hive#1103)
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.
Description
This PR refactors the
LLMJudgeto be truly provider-agnostic by implementing automatic environment-based detection. While #477 added the ability to manually inject a provider, the judge still defaulted to a hardcoded Anthropic implementation that would fail for users without an Anthropic key or theanthropicpackage. This PR introduces a "Smart Default" system that prioritizesOPENAI_API_KEYwhen available, creating a seamless experience for non-Anthropic users without requiring manual code changes to existing tests.Type of Change
Related Issues
Fixes #1103
Changes Made
_get_fallback_provider()to automatically detect and prioritizeOPENAI_API_KEYfollowed byANTHROPIC_API_KEY._get_client()method and implemented logic to detect mocked clients, ensuring 100% compatibility with existing unit tests._parse_json_resulthelper that robustly handles markdown code blocks and "chatter" from various LLM providers.anthropicclient so the package is no longer a strict requirement for users running only OpenAI models.Testing
cd core && pytest tests/test_llm_judge.py)cd core && ruff check framework/testing/llm_judge.py)Checklist