Skip to content

Commit 61c089f

Browse files
jsonbaileyclaude
andcommitted
fix: add future annotations import and log judge init failures
- Add `from __future__ import annotations` to evaluator.py so the self-referential `-> Evaluator` return type does not need quoting - Log a warning when a judge fails to initialize in _initialize_judges instead of silently swallowing the exception Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2a15009 commit 61c089f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

packages/sdk/server-ai/src/ldai/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ def _initialize_judges(
339339
)
340340
if judge:
341341
judges[judge_config.key] = judge
342-
except Exception:
342+
except Exception as e:
343+
log.warning(f'Failed to initialize judge {judge_config.key!r}: {e}')
343344
continue
344345

345346
return judges

packages/sdk/server-ai/src/ldai/evaluator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Evaluator implementation for coordinating multiple judges."""
22

3+
from __future__ import annotations
4+
35
import asyncio
46
from typing import Dict, List
57

@@ -29,7 +31,7 @@ def __init__(self, judges: Dict[str, Judge], judge_configuration: JudgeConfigura
2931
self._judge_configuration = judge_configuration
3032

3133
@classmethod
32-
def noop(cls) -> 'Evaluator':
34+
def noop(cls) -> Evaluator:
3335
return cls({}, JudgeConfiguration(judges=[]))
3436

3537
def evaluate(

0 commit comments

Comments
 (0)