Skip to content

Commit edd1690

Browse files
jsonbaileyclaude
andcommitted
fix: Guard against None tracker in Judge.evaluate()
Raise a clear RuntimeError if create_tracker returns None rather than letting it crash with AttributeError on track_metrics_of_async. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a41c7e3 commit edd1690

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/sdk/server-ai/src/ldai/judge/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ async def evaluate(
7171
judge_result.sampled = True
7272

7373
tracker = self._ai_config.create_tracker()
74+
if tracker is None:
75+
raise RuntimeError(
76+
"AIConfig.create_tracker returned None. "
77+
"Ensure the config was obtained from the client rather than constructed directly."
78+
)
7479
messages = self._construct_evaluation_messages(input_text, output_text)
7580
assert self._evaluation_response_structure is not None
7681

0 commit comments

Comments
 (0)