| Name | Type | Description |
|---|---|---|
evaluation_name* | str | Name of the evaluation metric (e.g.
|
score_value | Optional[float] | Default: NoneNumeric score returned by the evaluator. |
score_label | Optional[str] | Default: None |
explanation | Optional[str] | Default: None |
response_id | Optional[str] | Default: None |
error_type | Optional[str] | Default: None |
run_id | Optional[Union[str, UUID]] | Default: None |
Emit a gen_ai.evaluation.result event for an agent span.
Per the OpenTelemetry semantic conventions for GenAI events <https://github.com/open-telemetry/semantic-conventions/blob/main/model/gen-ai/events.yaml>_,
the event SHOULD be parented to the GenAI operation span being
evaluated. This method activates the target span's context
before emitting, so the event is correctly correlated.
The event is emitted via the OTel Logs/Events API (not the
deprecated span.add_event()), following the OTel deprecation of Span Events <https://opentelemetry.io/blog/2026/deprecating-span-events/>_.
This ensures the event lands in the customEvents table in
Azure Monitor / Application Insights (via
AzureMonitorLogExporter), where it is independently
queryable.
When the OTel Logs API is not available, falls back to the
legacy span.add_event() path.
Human-readable label such as "pass" or
"fail".
Free-form explanation of the score.
The gen_ai.response.id of the completion
being evaluated, when available.
Set when the evaluation itself errored.
Explicit run ID whose span should receive the event.
When omitted, the tracer auto-selects the most recent
invoke_agent span.