Skip to content

Commit 08fb1e0

Browse files
authored
feat: add kwargs in evaluate function of agent and common grader (#159)
1 parent 4ccc0ee commit 08fb1e0

18 files changed

Lines changed: 31 additions & 19 deletions

openjudge/graders/agent/action/action_alignment.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ async def _aevaluate(
215215
action: str,
216216
history: Optional[List[Dict[str, Any]]] = None,
217217
context: Optional[str] = None,
218+
**kwargs: Any,
218219
) -> GraderScore:
219220
"""
220221
Evaluate action alignment with plan

openjudge/graders/agent/action/action_loop.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def __init__(
5050
async def _aevaluate(
5151
self,
5252
messages: List[Dict[str, Any]],
53+
**kwargs: Any,
5354
) -> GraderScore:
5455
"""
5556
Detect loops in action sequences by comparing all pairs of action signatures.

openjudge/graders/agent/observation/observation_information_gain.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def __init__(
6060
async def _aevaluate(
6161
self,
6262
messages: List[Dict[str, Any]],
63+
**kwargs: Any,
6364
) -> GraderScore:
6465
"""
6566
Evaluate information gain and redundancy in observation observations.

openjudge/graders/agent/tool/tool_call_accuracy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ async def _aevaluate(
280280
tool_definitions: Dict[str, Any] | List[Dict[str, Any]],
281281
tool_calls: Dict[str, Any] | List[Dict[str, Any]] | None = None,
282282
response: str | List[Dict[str, Any]] | None = None,
283+
**kwargs: Any,
283284
) -> GraderScore | GraderError:
284285
"""
285286
Evaluate tool call accuracy

openjudge/graders/agent/tool/tool_call_precision_recall_match.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ async def _aevaluate(
199199
self,
200200
tool_calls: List[Dict[str, Any]],
201201
reference_tool_calls: List[Dict[str, Any]],
202+
**kwargs: Any,
202203
) -> GraderScore | GraderError:
203204
"""
204205
Evaluate tool call precision/recall against reference.

openjudge/graders/agent/tool/tool_call_step_sequence_match.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ async def _aevaluate(
358358
self,
359359
messages: List[Dict[str, Any]],
360360
reference_tool_calls: List[List[Dict[str, Any]]],
361+
**kwargs: Any,
361362
) -> GraderScore | GraderError:
362363
"""
363364
Evaluate tool call sequence matching against reference.

openjudge/graders/agent/tool/tool_call_success.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ async def _aevaluate(
267267
tool_definitions: Union[Dict[str, Any], List[Dict[str, Any]]],
268268
tool_calls: Union[Dict[str, Any], List[Dict[str, Any]]],
269269
tool_responses: Union[str, List[str]],
270+
**kwargs: Any,
270271
) -> GraderScore:
271272
"""
272273
Evaluate tool call success

openjudge/graders/agent/tool/tool_parameter_check.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ async def _aevaluate(
214214
query: Union[str, List[Dict[str, Any]]],
215215
tool_definitions: Union[Dict[str, Any], List[Dict[str, Any]]],
216216
tool_calls: Union[Dict[str, Any], List[Dict[str, Any]]],
217+
**kwargs: Any,
217218
) -> GraderScore:
218219
"""
219220
Evaluate tool parameter extraction correctness

openjudge/graders/agent/tool/tool_selection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ async def _aevaluate(
230230
query: Union[str, List[Dict[str, Any]]],
231231
tool_definitions: Union[Dict[str, Any], List[Dict[str, Any]]],
232232
tool_calls: Union[Dict[str, Any], List[Dict[str, Any]]],
233+
**kwargs: Any,
233234
) -> GraderScore:
234235
"""
235236
Evaluate tool selection

openjudge/graders/agent/trajectory/trajectory_accuracy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ def _format_messages(
270270
async def _aevaluate(
271271
self,
272272
messages: List[Dict[str, Any]],
273+
**kwargs: Any,
273274
) -> GraderScore | GraderError:
274275
"""
275276
Evaluate trajectory accuracy

0 commit comments

Comments
 (0)