Normalize openapi_call/openapi_call_output types in evaluator preprocessing#4832
Normalize openapi_call/openapi_call_output types in evaluator preprocessing#4832
Conversation
Co-authored-by: m7md7sien <16615690+m7md7sien@users.noreply.github.com>
| "code_interpreter_call", | ||
| "computer_call", | ||
| "azure_fabric", | ||
| "openapi_call", |
There was a problem hiding this comment.
We shouldn't remove it from unsupported tools.
There was a problem hiding this comment.
Restored "openapi_call" to UNSUPPORTED_TOOLS in all quality evaluators (coherence, fluency, customer_satisfaction, groundedness, relevance, intent_resolution, task_completion, task_adherence). Only the 5 tool evaluators mentioned in the issue have it removed. Commit: 96d5768
| # Raise error in case of unsupported tools for evaluators that enabled check_for_unsupported_tools | ||
| if self.check_for_unsupported_tools: | ||
| if content_type == ContentType.TOOL_CALL or content_type == ContentType.OPENAPI_CALL: | ||
| name = ( |
There was a problem hiding this comment.
We shouldn't do that either.
There was a problem hiding this comment.
Reverted the name resolution change in all quality evaluators — they now keep the original "openapi_call" if content_type == ContentType.OPENAPI_CALL logic. Commit: 96d5768
Co-authored-by: m7md7sien <16615690+m7md7sien@users.noreply.github.com>
| "code_interpreter_call", | ||
| "computer_call", | ||
| "azure_fabric", | ||
| "openapi_call", |
There was a problem hiding this comment.
Undo this in all evaluators.
There was a problem hiding this comment.
Restored "openapi_call" to UNSUPPORTED_TOOLS in all 5 tool evaluators. Commit: 4c8f881
assets/evaluators/builtin/tool_call_success/evaluator/_tool_call_success.py
Outdated
Show resolved
Hide resolved
| last_content = content[-1] | ||
| if (isinstance(last_content, dict) and | ||
| last_content.get("type") in ("function_call", "mcp_approval_request")): | ||
| last_content.get("type") in ("function_call", "mcp_approval_request", "openapi_call")): |
There was a problem hiding this comment.
Remove the handling of the openapi_call in the _handle_intermediate_response method in all evaluators you added this in, we only handle function_call and mcp_approval_request
There was a problem hiding this comment.
Removed "openapi_call" from _is_intermediate_response in all 16 evaluator files — the check is now back to only ("function_call", "mcp_approval_request"). Commit: 48487e9
| "code_interpreter_call", | ||
| "computer_call", | ||
| "azure_fabric", | ||
| "openapi_call", |
There was a problem hiding this comment.
openapi_call is still unsupported here, do not remove it
| }, | ||
| ] | ||
|
|
||
| OPENAPI_CALL_ONLY_RESPONSE: List[Dict[str, Any]] = [ |
There was a problem hiding this comment.
This is not needed because we only handle mcp_approval_request-only and function_call_only responses. Remove it.
There was a problem hiding this comment.
Removed OPENAPI_CALL_ONLY_RESPONSE, OPENAPI_CALL_FULL_RESPONSE fixtures and test_openapi_call_response from all test files. Commit: 48487e9
…tests Co-authored-by: m7md7sien <16615690+m7md7sien@users.noreply.github.com>
Test Results for assets-test677 tests 677 ✅ 29s ⏱️ Results for commit d663fbd. ♻️ This comment has been updated with latest results. |
|
@copilot you should run the code health validation script to ensure it passes. |
Evaluators fail when given conversations containing OpenAPI tool responses because
_normalize_function_call_typesonly handledfunction_call/function_call_output→tool_call/tool_result, not theopenapi_call/openapi_call_outputvariants.Changes
Core normalization (
_normalize_function_call_types)Added
openapi_call→tool_callandopenapi_call_output→tool_result(withopenapi_call_outputfield rename totool_result), mirroring the existingfunction_callhandling:Validation (
UNSUPPORTED_TOOLS)For all evaluators (
_tool_call_success,_tool_call_accuracy,_tool_selection,_tool_input_accuracy,_tool_output_utilization,_intent_resolution,_task_completion,_task_adherence,_groundedness,_relevance,_retrieval,_fluency,_coherence,_customer_satisfaction,_deflection_rate,_response_completeness):"openapi_call"remains inUNSUPPORTED_TOOLS— conversations containingopenapi_callcontent are rejected as not supported.openapi_callcontent types uses the"openapi_call"string, consistent with the existing pattern._is_intermediate_response) only handlesfunction_callandmcp_approval_request—openapi_callis not added.Original prompt
Work item: AB#5061130
Created via Azure DevOps
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.