You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Metric.create() metrics score an empty string — agent_response_data_fields defaults to all-False #1170
A metric created with Metric.create(...) and used through measure() sends an empty string to the judge model, so the resulting scores are judgments of nothing. There is no error — the run completes and returns numbers that look valid.
Verified against aixplain==0.2.48 (Python 3.13) by introspection and local execution. No network calls needed to reproduce the core of it.
The chain
Metric.agent_response_data_fields defaults to AgentResponseDataFields(query=False, trace=False, output=False) — all three flags off.
Metric.create(...) never sets agent_response_data_fields (the name does not appear in its body).
give_metric_input() appends only the enabled fields, so with all three False it returns "".
Reproduction (no API key required)
fromaixplain.v2.agent_evaluatorimportAgentResponseDataFieldsclassR: # stand-in for AgentResponseDatainput="What is 2+2?"; output="4"; steps= []
print(repr(AgentResponseDataFields().give_metric_input(R()))) # ''print(repr(AgentResponseDataFields(output=True).give_metric_input(R()))) # 'Output: 4\n'
The first line is what a Metric.create(...) metric sends as {"data": ""}.
Impact
Any evaluation built on Metric.create + measure() silently scores an empty prompt unless the caller knows to set agent_response_data_fields themselves. Because the call succeeds and returns a score, there is nothing to alert the user that the judge never saw the agent's output.
Suggested fixes (any one would do)
Default AgentResponseDataFields to output=True (the minimum useful payload), or
have Metric.create(...) set agent_response_data_fields from its arguments, or
raise in measure() when the resulting metric_input is empty.
Secondary, same method
Metric.create(...) begins with del allowed_actions, kwargs — the allowed_actions parameter is accepted and silently discarded. Either honour it or drop it from the signature.
Related note: the Eval docstring states each metric is invoked with a payload containing output and reference; in the current code EvalCase.reference never reaches the metric at all.
Activity