Skip to content

Commit 470db6b

Browse files
committed
ToolCallSuccess: apply black formatting
1 parent bc783a6 commit 470db6b

2 files changed

Lines changed: 22 additions & 18 deletions

File tree

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_tool_call_success/_tool_call_success.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ def __call__( # pylint: disable=docstring-missing-param
141141
"""
142142
return super().__call__(*args, **kwargs)
143143

144-
def _return_short_circuit_failure_result(
145-
self, failed_tools: List[str]
146-
) -> Dict[str, Union[str, float]]:
144+
def _return_short_circuit_failure_result(self, failed_tools: List[str]) -> Dict[str, Union[str, float]]:
147145
"""Return a deterministic fail result without invoking the LLM judge.
148146
149147
Used when the runtime explicitly marks one or more tool calls as

sdk/evaluation/azure-ai-evaluation/tests/unittests/test_tool_call_success_evaluator.py

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,13 @@ def test_unknown_runtime_status_is_ignored(self):
141141

142142
def test_parallel_calls_one_failed_returns_only_the_failed_name(self):
143143
msgs = [
144-
_assistant_parallel_tool_calls([
145-
("c1", "fetch_weather", {"city": "Seattle"}, "completed"),
146-
("c2", "send_email", {"to": "x@example.com"}, "failed"),
147-
("c3", "lookup_user", {"id": "u42"}, "completed"),
148-
]),
144+
_assistant_parallel_tool_calls(
145+
[
146+
("c1", "fetch_weather", {"city": "Seattle"}, "completed"),
147+
("c2", "send_email", {"to": "x@example.com"}, "failed"),
148+
("c3", "lookup_user", {"id": "u42"}, "completed"),
149+
]
150+
),
149151
_tool_result("c1", "Sunny, 72F.", status="completed"),
150152
_tool_result("c2", "", status="failed"),
151153
_tool_result("c3", {"user_id": "u42"}, status="completed"),
@@ -154,11 +156,13 @@ def test_parallel_calls_one_failed_returns_only_the_failed_name(self):
154156

155157
def test_multiple_distinct_failures_dedupe_across_passes(self):
156158
msgs = [
157-
_assistant_parallel_tool_calls([
158-
("c1", "send_email", {"to": "x"}, "failed"),
159-
("c2", "fetch_weather", {"city": "Seattle"}, None),
160-
("c3", "lookup_user", {"id": "u42"}, "incomplete"),
161-
]),
159+
_assistant_parallel_tool_calls(
160+
[
161+
("c1", "send_email", {"to": "x"}, "failed"),
162+
("c2", "fetch_weather", {"city": "Seattle"}, None),
163+
("c3", "lookup_user", {"id": "u42"}, "incomplete"),
164+
]
165+
),
162166
_tool_result("c2", "Sunny", status="failed"),
163167
# c1's tool_result also fails -- must not double-list send_email.
164168
_tool_result("c1", "", status="failed"),
@@ -284,11 +288,13 @@ def test_absent_status_back_compat_unchanged(self):
284288

285289
def test_parallel_tool_calls_in_one_message_no_status_in_output(self):
286290
msgs = [
287-
_assistant_parallel_tool_calls([
288-
("c1", "fetch_weather", {"city": "Seattle"}, "completed"),
289-
("c2", "send_email", {"to": "x@example.com"}, "completed"),
290-
("c3", "lookup_user", {"id": "u42"}, "completed"),
291-
]),
291+
_assistant_parallel_tool_calls(
292+
[
293+
("c1", "fetch_weather", {"city": "Seattle"}, "completed"),
294+
("c2", "send_email", {"to": "x@example.com"}, "completed"),
295+
("c3", "lookup_user", {"id": "u42"}, "completed"),
296+
]
297+
),
292298
_tool_result("c1", "Sunny, 72F.", status="completed"),
293299
_tool_result("c2", "ok", status="completed"),
294300
_tool_result("c3", {"user_id": "u42"}, status="completed"),

0 commit comments

Comments
 (0)