Implementation:Openai Openai python Eval Run Failed Webhook
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Python |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete type for representing an eval run failed webhook event provided by the openai-python SDK.
Description
EvalRunFailedWebhookEvent is a Pydantic model class that represents the webhook payload sent when an evaluation run has failed. It extends BaseModel and includes an event identifier, a Unix timestamp for when the failure occurred, a nested Data payload containing the eval run ID, a literal type field fixed to "eval.run.failed", and an optional object field fixed to "event".
Usage
Import this type when building a webhook handler that needs to process eval run failure events from the OpenAI API. Use it to deserialize incoming webhook payloads and trigger error-handling or alerting workflows.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/webhooks/eval_run_failed_webhook_event.py
Signature
class Data(BaseModel):
"""Event data payload."""
id: str
class EvalRunFailedWebhookEvent(BaseModel):
"""Sent when an eval run has failed."""
id: str
created_at: int
data: Data
type: Literal["eval.run.failed"]
object: Optional[Literal["event"]] = None
Import
from openai.types.webhooks import EvalRunFailedWebhookEvent
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| id | str | Yes | The unique ID of the event. |
| created_at | int | Yes | Unix timestamp (in seconds) of when the eval run failed. |
| data | Data | Yes | Event data payload containing the eval run ID. |
| data.id | str | Yes | The unique ID of the eval run. |
| type | Literal["eval.run.failed"] | Yes | The type of the event. Always "eval.run.failed". |
| object | Optional[Literal["event"]] | No | The object of the event. Always "event" when present. |
Usage Examples
from openai.types.webhooks import EvalRunFailedWebhookEvent
# Parse a webhook payload
event = EvalRunFailedWebhookEvent.model_validate(payload)
print(f"Eval run {event.data.id} failed at {event.created_at}")
print(f"Event type: {event.type}") # "eval.run.failed"